S2OJ/web/app/controllers/contest_registration.php

44 lines
2.0 KiB
PHP
Raw Normal View History

2016-07-18 16:39:37 +00:00
<?php
requirePHPLib('form');
2022-03-17 04:00:03 +00:00
2016-07-18 16:39:37 +00:00
if (!validateUInt($_GET['id']) || !($contest = queryContest($_GET['id']))) {
become404Page();
}
2022-04-03 10:18:17 +00:00
if (!isNormalUser($myUser)) {
become403Page();
}
2016-07-18 16:39:37 +00:00
genMoreContestInfo($contest);
2022-03-17 04:00:03 +00:00
if (!Auth::check()) {
2016-07-18 16:39:37 +00:00
redirectToLogin();
} elseif (hasRegistered($myUser, $contest) || $contest['cur_progress'] != CONTEST_NOT_STARTED) {
2016-07-18 16:39:37 +00:00
redirectTo('/contests');
}
$register_form = new UOJForm('register');
$register_form->handle = function() {
global $myUser, $contest;
2022-03-20 00:07:46 +00:00
DB::query("replace into contests_registrants (username, contest_id, has_participated) values ('{$myUser['username']}', {$contest['id']}, 0)");
2016-07-18 16:39:37 +00:00
updateContestPlayerNum($contest);
};
$register_form->submit_button_config['class_str'] = 'btn btn-primary';
$register_form->submit_button_config['text'] = '报名比赛';
$register_form->succ_href = "/contests";
$register_form->runAtServer();
?>
<?php echoUOJPageHeader(HTML::stripTags($contest['name']) . ' - 报名') ?>
<h1 class="page-header">比赛规则</h1>
<ul>
2022-03-17 03:02:44 +00:00
<li>比赛报名后不算正式参赛,报名后进了比赛页面也不算参赛,<strong>看了题目才算正式参赛</strong></li>
2022-03-20 00:07:46 +00:00
<li>比赛中途可以提交,若同一题有多次提交按<strong>最后一次不是 Compile Error 的提交</strong>算成绩。其实UOJ会自动无视你所有 Compile Error 的提交)</li>
2016-07-18 16:39:37 +00:00
<li>比赛中途提交后,可以看到<strong>测样例</strong>的结果。(若为提交答案题则对于每个测试点,该测试点有分则该测试点为满分)</li>
<li>比赛结束后会进行最终测试,最终测试后的排名为最终排名。</li>
<li>比赛排名按分数为第一关键字,完成题目的总时间为第二关键字。完成题目的总时间等于完成每道题所花时间之和(无视掉爆零的题目)。</li>
2022-03-20 00:07:46 +00:00
<li>请遵守比赛规则,一位选手在一场比赛内不得报名多个账号,选手之间不能交流或者抄袭代码,如果被检测到将以 0 分处理或者封禁。</li>
2016-07-18 16:39:37 +00:00
</ul>
<?php $register_form->printHTML(); ?>
<?php echoUOJPageFooter() ?>