false, 'html' => getSubmissionStatusDetails($custom_test_submission) )); } else { ob_start(); $styler = new CustomTestSubmissionDetailsStyler(); if (!hasViewPermission($problem_extra_config['view_details_type'], $myUser, $problem, $submission)) { $styler->fade_all_details = true; } echoJudgementDetails($custom_test_submission_result['details'], $styler, 'custom_test_details'); $result = ob_get_contents(); ob_end_clean(); echo json_encode(array( 'judged' => true, 'html' => getSubmissionStatusDetails($custom_test_submission), 'result' => $result )); } die(); } $can_use_zip_upload = true; foreach ($submission_requirement as $req) { if ($req['type'] == 'source code') { $can_use_zip_upload = false; } } function handleUpload($zip_file_name, $content, $tot_size) { global $problem, $contest, $myUser, $is_in_contest; $content['config'][] = array('problem_id', $problem['id']); if ($is_in_contest && $contest['extra_config']["contest_type"]!='IOI' && !isset($contest['extra_config']["problem_{$problem['id']}"])) { $content['final_test_config'] = $content['config']; $content['config'][] = array('test_sample_only', 'on'); } $esc_content = DB::escape(json_encode($content)); $language = '/'; foreach ($content['config'] as $row) { if (strEndWith($row[0], '_language')) { $language = $row[1]; break; } } if ($language != '/') { Cookie::set('uoj_preferred_language', $language, time() + 60 * 60 * 24 * 365, '/'); } $esc_language = DB::escape($language); $result = array(); $result['status'] = "Waiting"; $result_json = json_encode($result); if ($is_in_contest) { DB::query("insert into submissions (problem_id, contest_id, submit_time, submitter, content, language, tot_size, status, result, is_hidden) values (${problem['id']}, ${contest['id']}, now(), '${myUser['username']}', '$esc_content', '$esc_language', $tot_size, '${result['status']}', '$result_json', 0)"); } else { DB::query("insert into submissions (problem_id, submit_time, submitter, content, language, tot_size, status, result, is_hidden) values (${problem['id']}, now(), '${myUser['username']}', '$esc_content', '$esc_language', $tot_size, '${result['status']}', '$result_json', {$problem['is_hidden']})"); } } function handleCustomTestUpload($zip_file_name, $content, $tot_size) { global $problem, $contest, $myUser; $content['config'][] = array('problem_id', $problem['id']); $content['config'][] = array('custom_test', 'on'); $esc_content = DB::escape(json_encode($content)); $language = '/'; foreach ($content['config'] as $row) { if (strEndWith($row[0], '_language')) { $language = $row[1]; break; } } if ($language != '/') { Cookie::set('uoj_preferred_language', $language, time() + 60 * 60 * 24 * 365, '/'); } $esc_language = DB::escape($language); $result = array(); $result['status'] = "Waiting"; $result_json = json_encode($result); DB::insert("insert into custom_test_submissions (problem_id, submit_time, submitter, content, status, result) values ({$problem['id']}, now(), '{$myUser['username']}', '$esc_content', '{$result['status']}', '$result_json')"); } if ($can_use_zip_upload) { $zip_answer_form = newZipSubmissionForm('zip_answer', $submission_requirement, 'uojRandAvaiableSubmissionFileName', 'handleUpload'); $zip_answer_form->extra_validator = function() { global $ban_in_contest; if ($ban_in_contest) { return '请耐心等待比赛结束后题目对所有人可见了再提交'; } return ''; }; $zip_answer_form->succ_href = $is_in_contest ? "/contest/{$contest['id']}/submissions" : '/submissions'; $zip_answer_form->runAtServer(); } $answer_form = newSubmissionForm('answer', $submission_requirement, 'uojRandAvaiableSubmissionFileName', 'handleUpload'); $answer_form->extra_validator = function() { global $ban_in_contest; if ($ban_in_contest) { return '请耐心等待比赛结束后题目对所有人可见了再提交'; } return ''; }; $answer_form->succ_href = $is_in_contest ? "/contest/{$contest['id']}/submissions" : '/submissions'; $answer_form->runAtServer(); if ($custom_test_requirement) { $custom_test_form = newSubmissionForm('custom_test', $custom_test_requirement, function() { return uojRandAvaiableFileName('/tmp/'); }, 'handleCustomTestUpload'); $custom_test_form->appendHTML(<< EOD ); $custom_test_form->succ_href = 'none'; $custom_test_form->extra_validator = function() { global $ban_in_contest, $custom_test_submission; if ($ban_in_contest) { return '请耐心等待比赛结束后题目对所有人可见了再提交'; } if ($custom_test_submission && $custom_test_submission['status'] != 'Judged') { return '上一个测评尚未结束'; } return ''; }; $custom_test_form->ctrl_enter_submit = true; $custom_test_form->setAjaxSubmit(<<submit_button_config['text'] = UOJLocale::get('problems::run'); $custom_test_form->runAtServer(); } ?>
array( 'name' => UOJLocale::get('contests::contest dashboard'), 'url' => "/contest/{$contest['id']}" ), 'submissions' => array( 'name' => UOJLocale::get('contests::contest submissions'), 'url' => "/contest/{$contest['id']}/submissions" ), 'standings' => array( 'name' => UOJLocale::get('contests::contest standings'), 'url' => "/contest/{$contest['id']}/standings" ), ); if ($contest['cur_progress'] > CONTEST_TESTING) { $tabs_info['after_contest_standings'] = array( 'name' => UOJLocale::get('contests::after contest standings'), 'url' => "/contest/{$contest['id']}/after_contest_standings" ); $tabs_info['self_reviews'] = array( 'name' => UOJLocale::get('contests::contest self reviews'), 'url' => "/contest/{$contest['id']}/self_reviews" ); } if (hasContestPermission(Auth::user(), $contest)) { $tabs_info['backstage'] = array( 'name' => UOJLocale::get('contests::contest backstage'), 'url' => "/contest/{$contest['id']}/backstage" ); } ?>

. #.

时间限制:   空间限制:   上传者:

printHTML(); ?>

printHTML(); ?>
printHTML(); ?>