Beispiel #1
0
 public static function stop($record_id)
 {
     $record = new MDL_Record($record_id);
     $judger_id = $record->getJudger()->getID();
     $record_meta = $record->getInfo()->getRecordMeta();
     $status = $record_meta->getVar('status');
     if ($status == MDL_Judge_Record::STATUS_STOPPED) {
         return;
     }
     $record_meta->setVar('status', MDL_Judge_Record::STATUS_STOPPED);
     $record_meta->setVar('result_text', MDL_Judge_Record::RESULT_EXECUTOR_ERROR);
     $task_name = $record->getTaskName();
     if ($judger_id != 0) {
         MDL_Judger_Access::stopJudge($task_name, $record->getJudger());
         if ($status != MDL_Judge_Record::STATUS_WAITING) {
             $record->getJudger()->unlock();
         }
     }
 }
Beispiel #2
0
 public static function recordComplete($info)
 {
     $record = new MDL_Record($info['record_id'], MDL_Record::GET_ALL);
     $record_meta = $record->getInfo()->getRecordMeta();
     if ($record_meta->getVar('status') == self::STATUS_STOPPED) {
         return;
     }
     $meta = array('result_text' => $info['fatal'], 'status' => self::STATUS_STOPPED, 'time' => $info['time'], 'memory' => $info['memory'], 'score' => $info['score']);
     $record_meta->setVars($meta);
     //unlock judger
     $judger = $record->getJudger();
     $judger->unlock();
     //process task queue
     MDL_Judger_Process::processTaskQueue();
 }