|
@@ -17,7 +17,7 @@ use addons\exam\model\RoomGradeModel;
|
|
use addons\exam\model\RoomModel;
|
|
use addons\exam\model\RoomModel;
|
|
use addons\exam\model\RoomSignupModel;
|
|
use addons\exam\model\RoomSignupModel;
|
|
use app\admin\model\exam\MaterialQuestionModel;
|
|
use app\admin\model\exam\MaterialQuestionModel;
|
|
-
|
|
|
|
|
|
+use think\Db;
|
|
/**
|
|
/**
|
|
* 考试相关服务
|
|
* 考试相关服务
|
|
*/
|
|
*/
|
|
@@ -271,6 +271,11 @@ class ExamService
|
|
$user_questions[$key]['answer_score'] = $answer_score;
|
|
$user_questions[$key]['answer_score'] = $answer_score;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //记录总答题次数,答对数,答错数
|
|
|
|
+ Db::name('exam_question')->where('id',$question['id'])->setInc('total_count');
|
|
|
|
+ $field = $user_questions[$key]['is_right'] ? 'right_count' : 'error_count';
|
|
|
|
+ Db::name('exam_question')->where('id',$question['id'])->setInc($field);
|
|
}
|
|
}
|
|
|
|
|
|
// 递增参与人次
|
|
// 递增参与人次
|