...
|
...
|
@@ -439,10 +439,13 @@ class Exam extends Api |
|
|
{
|
|
|
$user_id = $this->auth->id;
|
|
|
$study_id = $this->request->param('study_id');
|
|
|
$question_id = $this->request->param('question_id');
|
|
|
$question_id = $this->request->param('question_id/a');
|
|
|
$type = $this->request->param('type');
|
|
|
$answer = $this->request->param('answer');
|
|
|
|
|
|
|
|
|
// 题目ID过滤
|
|
|
$question_id = implode(',',array_filter($question_id));
|
|
|
|
|
|
$study_exam_num = $this->request->param('study_exam_num');
|
|
|
if(empty($study_id) || empty($question_id) || empty($type) || empty($study_exam_num)){
|
|
|
$this->error('缺少必要参数');
|
...
|
...
|
@@ -515,7 +518,7 @@ class Exam extends Api |
|
|
->value('answer');
|
|
|
|
|
|
if(!empty($correct)){
|
|
|
$correct = explode(',',$correct);
|
|
|
$correct = str_split(str_replace([',',',',' '],'',$correct));
|
|
|
}
|
|
|
$answer1 = [];
|
|
|
if(!empty($answer)){
|
...
|
...
|
@@ -558,7 +561,7 @@ class Exam extends Api |
|
|
$this->error('参数有误');
|
|
|
}else{
|
|
|
//查询该题的正确答案
|
|
|
$correct = Db::name('dan')
|
|
|
$correct = Db::name('pan')
|
|
|
->where('id',$question_id)
|
|
|
->value('answer');
|
|
|
//判断用户是否回答正确
|
...
|
...
|
|