@@ -17,7 +17,7 @@ use addons\exam\model\RoomGradeModel;
use addons\exam\model\RoomModel;
use addons\exam\model\RoomSignupModel;
use app\admin\model\exam\MaterialQuestionModel;
-
+use think\Db;
/**
* 考试相关服务
*/
@@ -271,6 +271,11 @@ class ExamService
$user_questions[$key]['answer_score'] = $answer_score;
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);
// 递增参与人次
@@ -118,6 +118,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'upload'], function (
formatter: Table.api.formatter.status,
operate: false
},
+ {
+ field: 'total_count',
+ title: '总答题次数',
+ },
+ field: 'right_count',
+ title: '答对数',
+ field: 'error_count',
+ title: '答错数',
/*{
field: 'createtime',
title: __('Createtime'),