Ejemplo n.º 1
0
 public function submitPaper()
 {
     $fscore = AnswerModel::instance()->saveProblemAnswer($this->userInfo['user_id'], $this->examId, FillBaseModel::FILL_PROBLEM_TYPE, false);
     $inarr['fillsum'] = $fscore;
     StudentService::instance()->submitExamPaper($this->userInfo['user_id'], $this->examId, $inarr);
     $this->checkActionAfterSubmit();
     redirect(U('Home/Question/navigation', array('eid' => $this->examId)));
 }
Ejemplo n.º 2
0
 public function submitPaper()
 {
     $allscore = ExamService::instance()->getBaseScoreByExamId($this->examId);
     $jright = AnswerModel::instance()->saveProblemAnswer($this->userInfo['user_id'], $this->examId, JudgeBaseModel::JUDGE_PROBLEM_TYPE, false);
     $inarr['judgesum'] = $jright * $allscore['judgescore'];
     StudentService::instance()->submitExamPaper($this->userInfo['user_id'], $this->examId, $inarr);
     $this->checkActionAfterSubmit();
     redirect(U('Home/Question/navigation', array('eid' => $this->examId)));
 }
Ejemplo n.º 3
0
 public function submitPaper()
 {
     $start_timeC = strftime("%Y-%m-%d %X", strtotime($this->examBase['start_time']));
     $end_timeC = strftime("%Y-%m-%d %X", strtotime($this->examBase['end_time']));
     $allscore = ExamService::instance()->getBaseScoreByExamId($this->examId);
     $inarr['choosesum'] = $this->chooseSumScore == -1 ? 0 : $this->chooseSumScore;
     $inarr['judgesum'] = $this->judgeSumScore == -1 ? 0 : $this->judgeSumScore;
     $inarr['fillsum'] = $this->fillSumScore == -1 ? 0 : $this->fillSumScore;
     $pright = AnswerModel::instance()->getRightProgramCount($this->userInfo['user_id'], $this->examId, $start_timeC, $end_timeC);
     $inarr['programsum'] = round($pright * $allscore['programscore']);
     $inarr['score'] = $inarr['choosesum'] + $inarr['judgesum'] + $inarr['fillsum'] + $inarr['programsum'];
     StudentService::instance()->submitExamPaper($this->userInfo['user_id'], $this->examId, $inarr);
     redirect(U('Home/Index/score'));
 }
Ejemplo n.º 4
0
 public function doRejudgeProgramByExamIdAndUserId($eid, $userId, $programScore, $start_timeC, $end_timeC)
 {
     $row_cnt = AnswerModel::instance()->getRightProgramCount($userId, $eid, $start_timeC, $end_timeC);
     $programsum = round($row_cnt * $programScore);
     //$program over
     return $programsum;
 }