Exemplo n.º 1
0
 public function ajaxRejudgeAction()
 {
     // 获取参数
     $solutionId = (int) Request::getPOST('solution-id');
     $solutionInfo = OjSolutionInterface::getById(array('id' => $solutionId));
     if (empty($solutionInfo)) {
         $this->renderError('Solution不存在!');
     }
     // 主站只有OJ管理员才可以重判,或者timeout
     if (!$this->isOjAdmin && $solutionInfo['result'] != StatusVars::TIME_OUT) {
         $this->renderError('你没有权限重判!');
     }
     // 重判
     OjSolutionInterface::rejudge(array('id' => $solutionId));
     $this->renderAjax(0);
 }