public function ACT_submit() { if (!$this->acl->check('general')) { $this->deny(); } if ($this->config->getVar('judge_allowed') != 1) { $this->deny(); } $user_id = $this->acl->getUser()->getID(); $prob_id = $_POST['prob_id']; $lang = $_POST['lang']; $source = file_get_contents($_FILES['source']['tmp_name']); $problem = new MDL_Problem($prob_id); if (!$problem->getProblemMeta()->display || !$problem->getProblemMeta()->verified) { $this->deny(); } $default_display = MDL_Config::getInstance()->getVar('record_display_default'); $display = new MDL_Record_Display($default_display); $record_id = MDL_Judge_Single::submit($user_id, $prob_id, $lang, $source, $display); MDL_Judger_Process::processTaskQueue(); $this->locator->redirect('record_detail', array(), '/' . $record_id); }
public function ACT_submit() { if (!$this->acl->check('general')) { $this->deny(); } if ($this->config->getVar('judge_allowed') != 1) { $this->deny(); } $user = $this->acl->getUser(); $contest_id = $_POST['contest_id']; $contest = new MDL_Contest($contest_id); $contest_user = new MDL_Contest_User($contest, $user); if (!$contest_user->canSubmit()) { $this->deny(); } $prob_id = $_POST['prob_id']; $language = $_POST['lang']; $source = file_get_contents($_FILES['source']['tmp_name']); $record_display = $contest->getConfig()->getRecordDisplay('during'); $record_id = MDL_Judge_Single::submit($user->getID(), $prob_id, $language, $source, $record_display); $contest_user->addRecord($record_id); MDL_Judger_Process::processTaskQueue(); $this->locator->redirect('record/detail', array(), '/' . $record_id); }
public function ACT_stopjudge() { $record_id = $this->path_option->getPathSection(2); MDL_Judge_Single::stop($record_id); $this->locator->redirect('admin_record_list'); }