...
|
...
|
@@ -206,6 +206,7 @@ class Exam extends Api |
|
|
$info['exam_num'] = $is_have['study_exam_num'] + 1;
|
|
|
}
|
|
|
|
|
|
$answer_data = [];
|
|
|
//单选题库
|
|
|
$info['dan'] = Db::name('dan')
|
|
|
->field('id,content,type,option,answer')
|
...
|
...
|
@@ -221,7 +222,8 @@ class Exam extends Api |
|
|
}else{
|
|
|
$answer['study_exam_num'] = $is_have['study_exam_num'] + 1;
|
|
|
}
|
|
|
Db::name('answer_detail')->insertGetId($answer);
|
|
|
// Db::name('answer_detail')->insertGetId($answer);
|
|
|
$answer_data[] = $answer;
|
|
|
$v['option'] = json_decode($v['option'],true);
|
|
|
if($v['type'] == 2){
|
|
|
foreach ($v['option'] as &$val){
|
...
|
...
|
@@ -245,7 +247,8 @@ class Exam extends Api |
|
|
}else{
|
|
|
$answer['study_exam_num'] = $is_have['study_exam_num'] + 1;
|
|
|
}
|
|
|
Db::name('answer_detail')->insertGetId($answer);
|
|
|
// Db::name('answer_detail')->insertGetId($answer);
|
|
|
$answer_data[] = $answer;
|
|
|
$v['option'] = json_decode($v['option'],true);
|
|
|
if($v['type'] == 2){
|
|
|
foreach ($v['option'] as &$val){
|
...
|
...
|
@@ -269,7 +272,8 @@ class Exam extends Api |
|
|
}else{
|
|
|
$answer['study_exam_num'] = $is_have['study_exam_num'] + 1;
|
|
|
}
|
|
|
Db::name('answer_detail')->insertGetId($answer);
|
|
|
// Db::name('answer_detail')->insertGetId($answer);
|
|
|
$answer_data[] = $answer;
|
|
|
$v['option'] = array([
|
|
|
'name'=>'A',
|
|
|
'gender'=>'正确'
|
...
|
...
|
@@ -280,7 +284,7 @@ class Exam extends Api |
|
|
]
|
|
|
);
|
|
|
}
|
|
|
|
|
|
Db::name('answer_detail')->insertAll($answer_data);
|
|
|
$this->success('success',$info);
|
|
|
|
|
|
|
...
|
...
|
|