|
@@ -97,21 +97,6 @@ class Practice extends Backend
|
|
|
$this->error('未找到记录');
|
|
|
}
|
|
|
$info = $this->exam_model->where(['user_id'=>$this->auth->id,'exam_collection_id'=>$ids])->find();
|
|
|
- // if(empty($info)){
|
|
|
- // $arr = [
|
|
|
- // 'exam_collection_id' => $ids,
|
|
|
- // 'user_id' => $this->auth->id,
|
|
|
- // 'user_username' => $this->auth->username,
|
|
|
- // 'user_nickname' => $this->auth->nickname,
|
|
|
- // 'user_depart_id' => $this->auth->depart_id,
|
|
|
- // 'exam_collection_name' => $row->exam_collection_name,
|
|
|
- // 'exam_collection_type' =>1,
|
|
|
- // 'sim_type' => $row->sim_type,
|
|
|
- // 'seat_id' => 1,
|
|
|
- // 'sim_id' => 12,
|
|
|
- // ];
|
|
|
- // $this->exam_model->save($arr);
|
|
|
- // }
|
|
|
if(!empty($info)){
|
|
|
if(!empty($this->auth->seat_id) && !empty($info['seat_id']) && $this->auth->seat_id!=$info['seat_id']){
|
|
|
$this->error('已在其他座号有开始的练习,不允许换座号');
|
|
@@ -209,9 +194,51 @@ class Practice extends Backend
|
|
|
$fangfa_content = [];
|
|
|
|
|
|
$other_content = [];
|
|
|
+ $content = [];
|
|
|
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
+ if(!empty($params['other_report'])){
|
|
|
+ //获取数组
|
|
|
+ $other_report = json_decode($params['other_report'],true);
|
|
|
+ if(count($other_report)==1){
|
|
|
+ $other_report[1] = [
|
|
|
+ 'xh_id' => 1,
|
|
|
+ 'xx_id' => '',
|
|
|
+ 'xx_name' => '',
|
|
|
+ 'yy_id' => '',
|
|
|
+ 'yy_name' => '',
|
|
|
+ 'bw_id' => '',
|
|
|
+ 'bw_name' => '',
|
|
|
+ 'pc_id' => '',
|
|
|
+ 'pc_name' => ''
|
|
|
+ ];
|
|
|
+ $other_report[2] = [
|
|
|
+ 'xh_id' => 2,
|
|
|
+ 'xx_id' => '',
|
|
|
+ 'xx_name' => '',
|
|
|
+ 'yy_id' => '',
|
|
|
+ 'yy_name' => '',
|
|
|
+ 'bw_id' => '',
|
|
|
+ 'bw_name' => '',
|
|
|
+ 'pc_id' => '',
|
|
|
+ 'pc_name' => ''
|
|
|
+ ];
|
|
|
+ }else if(count($other_report)==2){
|
|
|
+ $other_report[2] = [
|
|
|
+ 'xh_id' => 2,
|
|
|
+ 'xx_id' => '',
|
|
|
+ 'xx_name' => '',
|
|
|
+ 'yy_id' => '',
|
|
|
+ 'yy_name' => '',
|
|
|
+ 'bw_id' => '',
|
|
|
+ 'bw_name' => '',
|
|
|
+ 'pc_id' => '',
|
|
|
+ 'pc_name' => ''
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $params['other_report'] = json_encode($other_report);
|
|
|
+ }
|
|
|
|
|
|
//更新考试结束时间
|
|
|
$row->end_time = date('Y-m-d H:i:s');
|
|
@@ -270,304 +297,188 @@ class Practice extends Backend
|
|
|
//根据故障部位查找,匹配可能原因
|
|
|
$yy_arr = Fault::where(['parent_fault_id'=>['in',$partent_fault_id],'sim_type'=>$info['sim_type'],'fault_type'=>2])->column('fault_id');
|
|
|
|
|
|
- //获取数组
|
|
|
- $other_report = json_decode($params['other_report'],true);
|
|
|
if(!empty($other_report)){
|
|
|
- foreach ($other_report as $key => $em){
|
|
|
- //故障现象
|
|
|
- $xianxian_arr[] = $em['xx_id'];
|
|
|
- }
|
|
|
- foreach ($partent_fault_id as $k1 =>$t){
|
|
|
- $kscore = 0;
|
|
|
- if(!in_array($t,$xianxian_arr)){
|
|
|
- $xianxian_score = 5+$xianxian_score;
|
|
|
- $xianxian_content[] = [
|
|
|
- 'gzxz_id'=>$t,
|
|
|
- 'cx_id'=>$t,
|
|
|
- 'cx_type'=>'故障现象少写',
|
|
|
- 'cx_name'=>Fault::where(['fault_id'=>$t])->value('name'),
|
|
|
- 'cx_score'=>-5,
|
|
|
- ];
|
|
|
-
|
|
|
- $other_content[] = [
|
|
|
- 'gzxz_id'=>$t,
|
|
|
- 'cx_score'=>-5,
|
|
|
- ];
|
|
|
- }else{
|
|
|
- // echo "存在里面".$t."###".$k1."<br/>";
|
|
|
- $t1= $t;
|
|
|
- $jian = '';
|
|
|
- foreach ($other_report as $ky => $item) {
|
|
|
- if ($item['xx_id'] == $t) {
|
|
|
- $jian = $ky;
|
|
|
+ foreach ($other_report as $k => $v) {
|
|
|
+ if(!empty($v['xx_id'])){
|
|
|
+ if(in_array($v['xx_id'],$partent_fault_id)){
|
|
|
+ //故障现象正确
|
|
|
+
|
|
|
+ $kscore = 0;
|
|
|
+ //故障部位 故障部位错误
|
|
|
+ $buwei_id= '';
|
|
|
+ $paichu_id= '';
|
|
|
+ $yy_id = [];
|
|
|
+ foreach($fault_arr as $kk1 =>$va1){
|
|
|
+ $fault_find = Fault::where(['fault_id'=>$va1])->find();
|
|
|
+ if($fault_find['parent_fault_id']==$v['xx_id']){
|
|
|
+ $buwei_id = $fault_find['fault_id'];
|
|
|
+ $paichu_id = $fault_find['ref_type4_fault_id'];
|
|
|
+ $yy_id = Fault::where(['parent_fault_id'=>$fault_find['parent_fault_id'],'sim_type'=>$info['sim_type'],'fault_type'=>2])->column('fault_id');
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- // 故障部位算分 start
|
|
|
- //获取故障部位
|
|
|
- $buweiarr = Fault::where(['parent_fault_id'=>$t,'sim_type'=>$info['sim_type'],'fault_type'=>['in',[3,30]],'fault_state'=>0])
|
|
|
- ->column('fault_id');
|
|
|
- if(!in_array($other_report[$jian]['bw_id'],$buweiarr)){
|
|
|
- $buwei_score = 1+$buwei_score;
|
|
|
- $kscore = 1+$kscore;
|
|
|
- $xianxian_content[] = [
|
|
|
- 'gzxz_id'=>$t,
|
|
|
- 'cx_id'=>$other_report[$jian]['bw_id'],
|
|
|
- 'cx_type'=>'故障部位错写',
|
|
|
- 'cx_name'=>Fault::where(['fault_id'=>$other_report[$jian]['bw_id']])->value('name'),
|
|
|
- ];
|
|
|
- }
|
|
|
- //出题故障部位和获取的故障部位里面有重复的
|
|
|
- // 获取两个数组的交集
|
|
|
- $intersection = array_intersect($buweiarr, $fault_arr);
|
|
|
- // halt($intersection);
|
|
|
- foreach($intersection as $kk =>$va){
|
|
|
- if($other_report[$jian]['bw_id']!=$va){
|
|
|
+
|
|
|
+
|
|
|
+ if($v['bw_id']!=$buwei_id){
|
|
|
$buwei_score = 1+$buwei_score;
|
|
|
$kscore = 1+$kscore;
|
|
|
- $xianxian_content[] = [
|
|
|
- 'gzxz_id'=>$t,
|
|
|
- 'cx_id'=>$va,
|
|
|
- 'cx_type'=>'故障部位少写',
|
|
|
- 'cx_name'=>Fault::where(['fault_id'=>$va])->value('name'),
|
|
|
+ $content[] = [
|
|
|
+ 'gzxz_id'=>$v['xx_id'],
|
|
|
+ 'cx_id'=>$v['bw_id'],
|
|
|
+ 'cx_type'=>'故障部位错写',
|
|
|
+ 'cx_name'=>Fault::where(['fault_id'=>$v['bw_id']])->value('name'),
|
|
|
];
|
|
|
}
|
|
|
- }
|
|
|
- unset($va);
|
|
|
- // 故障部位算分 end
|
|
|
-
|
|
|
- // 排除方法算分 start
|
|
|
- $paichuarr = Fault::where(['parent_fault_id'=>$t,'sim_type'=>$info['sim_type'],'fault_type'=>4,'fault_state'=>0])
|
|
|
- ->column('fault_id');
|
|
|
- if(!in_array($other_report[$jian]['pc_id'],$paichuarr)){
|
|
|
- $fangfa_score = 1+$fangfa_score;
|
|
|
- $kscore = 1+$kscore;
|
|
|
- $xianxian_content[] = [
|
|
|
- 'gzxz_id'=>$t,
|
|
|
- 'cx_id'=>$other_report[$jian]['pc_id'],
|
|
|
- 'cx_type'=>'排除方法错写',
|
|
|
- 'cx_name'=>Fault::where(['fault_id'=>$other_report[$jian]['pc_id']])->value('name'),
|
|
|
- ];
|
|
|
- }
|
|
|
- //出题排除方法和获取的排除方法里面有重复的
|
|
|
- // 获取两个数组的交集
|
|
|
- $intersection1 = array_intersect($paichuarr, $paichu_arr);
|
|
|
- foreach($intersection1 as $kk1 =>$va1){
|
|
|
- if($other_report[$jian]['pc_id']!=$va1){
|
|
|
- $fangfa_score = 1+$fangfa_score;
|
|
|
+ //故障部位少写
|
|
|
+ //获取当前的故障部位
|
|
|
+ if($buwei_id!=$v['bw_id']){
|
|
|
+ $buwei_score = 1+$buwei_score;
|
|
|
$kscore = 1+$kscore;
|
|
|
- $xianxian_content[] = [
|
|
|
- 'gzxz_id'=>$t,
|
|
|
- 'cx_id'=>$va1,
|
|
|
- 'cx_type'=>'排除方法少写',
|
|
|
- 'cx_name'=>Fault::where(['fault_id'=>$va1])->value('name'),
|
|
|
+ $content[] = [
|
|
|
+ 'gzxz_id'=>$v['xx_id'],
|
|
|
+ 'cx_id'=>$buwei_id,
|
|
|
+ 'cx_type'=>'故障部位少写',
|
|
|
+ 'cx_name'=>Fault::where(['fault_id'=>$buwei_id])->value('name'),
|
|
|
];
|
|
|
}
|
|
|
- }
|
|
|
- unset($va1);
|
|
|
- // 排除方法算分 end
|
|
|
|
|
|
- // 可能原因算分 start
|
|
|
- $yuanyinarr = Fault::where(['parent_fault_id'=>$t,'sim_type'=>$info['sim_type'],'fault_type'=>2,'fault_state'=>0])
|
|
|
- ->column('fault_id');
|
|
|
- foreach (explode(',',$other_report[$jian]['yy_id']) as $key => $value) {
|
|
|
- if(!in_array($value,$yuanyinarr)){
|
|
|
- $yuanyin_socre = 1+$yuanyin_socre;
|
|
|
+ //排除方法 错写
|
|
|
+ if($v['pc_id']!=$paichu_id){
|
|
|
+ $buwei_score = 1+$buwei_score;
|
|
|
$kscore = 1+$kscore;
|
|
|
- $xianxian_content[] = [
|
|
|
- 'gzxz_id'=>$t,
|
|
|
- 'cx_id'=>$value,
|
|
|
- 'cx_type'=>'可能原因错写',
|
|
|
- 'cx_name'=>Fault::where(['fault_id'=>$value])->value('name'),
|
|
|
+ $content[] = [
|
|
|
+ 'gzxz_id'=>$v['xx_id'],
|
|
|
+ 'cx_id'=>$v['pc_id'],
|
|
|
+ 'cx_type'=>'排除方法错写',
|
|
|
+ 'cx_name'=>Fault::where(['fault_id'=>$v['pc_id']])->value('name'),
|
|
|
];
|
|
|
}
|
|
|
- }
|
|
|
- //出题可能原因和获取的可能原因里面有重复的
|
|
|
- // 获取两个数组的交集
|
|
|
- $intersection2 = array_intersect($yy_arr, $yuanyinarr);
|
|
|
- $intersection22 = array_intersect($intersection2, explode(',',$other_report[$jian]['yy_id']));
|
|
|
- foreach($yuanyinarr as $kk2 =>$va2){
|
|
|
- if(!in_array($va2,$intersection22)){
|
|
|
- $yuanyin_socre = 1+$yuanyin_socre;
|
|
|
+ //排放方法 少写
|
|
|
+ if($paichu_id!=$v['pc_id']){
|
|
|
+ $fangfa_score = 1+$fangfa_score;
|
|
|
$kscore = 1+$kscore;
|
|
|
- $xianxian_content[] = [
|
|
|
- 'gzxz_id'=>$t,
|
|
|
- 'cx_id'=>$va2,
|
|
|
- 'cx_type'=>'可能原因少写',
|
|
|
- 'cx_name'=>Fault::where(['fault_id'=>$va2])->value('name'),
|
|
|
+ $content[] = [
|
|
|
+ 'gzxz_id'=>$v['xx_id'],
|
|
|
+ 'cx_id'=>$v['pc_id'],
|
|
|
+ 'cx_type'=>'排除方法少写',
|
|
|
+ 'cx_name'=>Fault::where(['fault_id'=>$buwei_id])->value('name'),
|
|
|
];
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ //可能原因 错写
|
|
|
+ foreach (explode(',',$v['yy_id']) as $key => $value) {
|
|
|
+ if(!in_array($value,$yy_id)){
|
|
|
+ $yuanyin_socre = 1+$yuanyin_socre;
|
|
|
+ $kscore = 1+$kscore;
|
|
|
+ $content[] = [
|
|
|
+ 'gzxz_id'=>$v['xx_id'],
|
|
|
+ 'cx_id'=>$value,
|
|
|
+ 'cx_type'=>'可能原因错写',
|
|
|
+ 'cx_name'=>Fault::where(['fault_id'=>$value])->value('name'),
|
|
|
+ ];
|
|
|
+ echo $v['xx_id']."@@@".$value."@@@".$kscore."<br/>";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //可能原因 少写
|
|
|
+ foreach ($yy_id as $key1 => $value1) {
|
|
|
+ $yy_id_arr = explode(',',$v['yy_id']);
|
|
|
+ if(!in_array($value1,$yy_id_arr)){
|
|
|
+ $yuanyin_socre = 1+$yuanyin_socre;
|
|
|
+ $kscore = 1+$kscore;
|
|
|
+ $content[] = [
|
|
|
+ 'gzxz_id'=>$v['xx_id'],
|
|
|
+ 'cx_id'=>$value1,
|
|
|
+ 'cx_type'=>'可能原因少写',
|
|
|
+ 'cx_name'=>Fault::where(['fault_id'=>$value1])->value('name'),
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- unset($va2);
|
|
|
- // 可能原因算分 end
|
|
|
-
|
|
|
- if($kscore>5){
|
|
|
- $kscore = '-5';
|
|
|
- }else if($kscore>0){
|
|
|
- $kscore = '-'.$kscore;
|
|
|
+ if($kscore>5){
|
|
|
+ $kscore = '-5';
|
|
|
+ }else if($kscore>0){
|
|
|
+ $kscore = '-'.$kscore;
|
|
|
+ }else{
|
|
|
+ $kscore=0;
|
|
|
+ }
|
|
|
+ $other_content[$k] = [
|
|
|
+ 'gzxz_id'=>$v['xx_id'],
|
|
|
+ 'xh_id' => $k,
|
|
|
+ 'xx_id' => $v['xx_id'],
|
|
|
+ 'xx_name' => $v['xx_name'],
|
|
|
+ 'yy_id' =>$v['yy_id'],
|
|
|
+ 'yy_name' => $v['yy_name'],
|
|
|
+ 'bw_id' => $v['bw_id'],
|
|
|
+ 'bw_name' => $v['bw_name'],
|
|
|
+ 'pc_id' => $v['pc_id'],
|
|
|
+ 'pc_name' => $v['pc_name'],
|
|
|
+ 'cx_type'=>'',
|
|
|
+ 'cx_name'=>$content,
|
|
|
+ 'cx_score'=>$kscore,
|
|
|
+ ];
|
|
|
}else{
|
|
|
- $kscore=0;
|
|
|
+ $xianxian_score = 5+$xianxian_score;
|
|
|
+ $other_content[$k] = [
|
|
|
+ 'gzxz_id'=>$v['xx_id'],
|
|
|
+ 'xh_id' => $k,
|
|
|
+ 'xx_id' => $v['xx_id'],
|
|
|
+ 'xx_name' => $v['xx_name'],
|
|
|
+ 'yy_id' =>$v['yy_id'],
|
|
|
+ 'yy_name' => $v['yy_name'],
|
|
|
+ 'bw_id' => $v['bw_id'],
|
|
|
+ 'bw_name' => $v['bw_name'],
|
|
|
+ 'pc_id' => $v['pc_id'],
|
|
|
+ 'pc_name' => $v['pc_name'],
|
|
|
+ 'cx_type'=>'故障现象错写',
|
|
|
+ 'cx_name'=>Fault::where(['fault_id'=>$v['xx_id']])->value('name'),
|
|
|
+ 'cx_score'=>-5,
|
|
|
+ ];
|
|
|
}
|
|
|
- // echo $t1."####".$kscore."<br/>";
|
|
|
- $other_content[] = [
|
|
|
- 'gzxz_id'=>$t,
|
|
|
- 'cx_score'=>$kscore,
|
|
|
+ }else{
|
|
|
+ $xianxian_score = 5+$xianxian_score;
|
|
|
+ $other_content[$k] = [
|
|
|
+ 'gzxz_id'=>'',
|
|
|
+ 'xh_id' => $k,
|
|
|
+ 'xx_id' => '',
|
|
|
+ 'xx_name' => '',
|
|
|
+ 'yy_id' => '',
|
|
|
+ 'yy_name' => '',
|
|
|
+ 'bw_id' => '',
|
|
|
+ 'bw_name' => '',
|
|
|
+ 'pc_id' => '',
|
|
|
+ 'pc_name' => '',
|
|
|
+ 'cx_type'=>'未作答',
|
|
|
+ 'cx_name'=>'',
|
|
|
+ 'cx_score'=>-5,
|
|
|
];
|
|
|
}
|
|
|
}
|
|
|
- unset($em);
|
|
|
-
|
|
|
- // echo "<pre>";
|
|
|
- // print_r($xianxian_content);
|
|
|
-
|
|
|
- // echo "<pre>";
|
|
|
- // print_r($other_content);
|
|
|
- // die();
|
|
|
}else{
|
|
|
foreach ($partent_fault_id as $key => $em){
|
|
|
$xianxian_score = 5+$xianxian_score;
|
|
|
- $xianxian_content[] = [
|
|
|
+ $other_content[] = [
|
|
|
'gzxz_id'=>$em,
|
|
|
- 'cx_id'=>$em,
|
|
|
+ 'xh_id' => $key,
|
|
|
+ 'xx_id' => '',
|
|
|
+ 'xx_name' => '',
|
|
|
+ 'yy_id' => '',
|
|
|
+ 'yy_name' => '',
|
|
|
+ 'bw_id' => '',
|
|
|
+ 'bw_name' => '',
|
|
|
+ 'pc_id' => '',
|
|
|
+ 'pc_name' => '',
|
|
|
'cx_type'=>'未作答',
|
|
|
- // 'cx_name'=>Fault::where(['fault_id'=>$em])->value('name'),
|
|
|
'cx_name'=>'',
|
|
|
- ];
|
|
|
- $other_content[] = [
|
|
|
- 'gzxz_id'=>$em,
|
|
|
'cx_score'=>-5,
|
|
|
];
|
|
|
}
|
|
|
unset($em);
|
|
|
}
|
|
|
-
|
|
|
- // //获取数组
|
|
|
- // $other_report = json_decode($params['other_report'],true);
|
|
|
- // if(!empty($other_report)){
|
|
|
- // foreach ($other_report as $key => $em){
|
|
|
- // //故障现象
|
|
|
- // $xianxian_arr[] = $em['xx_id'];
|
|
|
- // //故障部位
|
|
|
- // $buwei_arr[] = $em['bw_id'];
|
|
|
- // //可能原因
|
|
|
- // foreach(explode(',',$em['yy_id']) as $k3 =>$t13){
|
|
|
- // $yuanyin_arr[] = $t13;
|
|
|
- // }
|
|
|
- // //排除方法
|
|
|
- // $fangfa_arr[] = $em['pc_id'];
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // //故障现象 分数 start
|
|
|
- // foreach ($partent_fault_id as $k1 =>$t){
|
|
|
- // if(!in_array($t,$xianxian_arr)){
|
|
|
- // $xianxian_score = 1+$xianxian_score;
|
|
|
- // $xianxian_content[] = [
|
|
|
- // 'cx_id'=>$t,
|
|
|
- // 'cx_type'=>'少写',
|
|
|
- // 'cx_name'=>Fault::where(['fault_id'=>$t])->value('name'),
|
|
|
- // ];
|
|
|
- // }
|
|
|
- // }
|
|
|
- // foreach ($xianxian_arr as $k2 =>$t2){
|
|
|
- // if(!in_array($t2,$partent_fault_id)){
|
|
|
- // $xianxian_score = 1+$xianxian_score;
|
|
|
- // $xianxian_content[] = [
|
|
|
- // 'cx_id'=>$t2,
|
|
|
- // 'cx_type'=>'错写',
|
|
|
- // 'cx_name'=>Fault::where(['fault_id'=>$t2])->value('name'),
|
|
|
- // ];
|
|
|
- // }
|
|
|
- // }
|
|
|
- // //故障现象 end
|
|
|
-
|
|
|
-
|
|
|
- // //故障部位 start
|
|
|
- // foreach ($fault_arr as $k11 =>$t11){
|
|
|
- // if(!in_array($t11,$buwei_arr)){
|
|
|
- // $buwei_score = 1+$buwei_score;
|
|
|
- // $buwei_content[] = [
|
|
|
- // 'cx_id'=>$t11,
|
|
|
- // 'cx_type'=>'少写',
|
|
|
- // 'cx_name'=>Fault::where(['fault_id'=>$t11])->value('name'),
|
|
|
- // ];
|
|
|
- // }
|
|
|
- // }
|
|
|
- // foreach ($buwei_arr as $k12 =>$t12){
|
|
|
- // if(!empty($t12) && !in_array($t12,$fault_arr)){
|
|
|
- // //错写
|
|
|
- // $buwei_score = 1+$buwei_score;
|
|
|
- // $buwei_content[] = [
|
|
|
- // 'cx_id'=>$t12,
|
|
|
- // 'cx_type'=>'错写',
|
|
|
- // 'cx_name'=>Fault::where(['fault_id'=>$t12])->value('name'),
|
|
|
- // ];
|
|
|
- // }
|
|
|
- // }
|
|
|
- // //故障部位 end
|
|
|
-
|
|
|
- // //排除方法 start
|
|
|
- // //循环固定的排除方法,匹配作答的排除方法
|
|
|
- // foreach ($paichu_arr as $k21 =>$t21){
|
|
|
- // if(!in_array($t21,$fangfa_arr)){
|
|
|
- // $fangfa_score = 1+$fangfa_score;
|
|
|
- // $fangfa_content[] = [
|
|
|
- // 'cx_id'=>$t21,
|
|
|
- // 'cx_type'=>'少写',
|
|
|
- // 'cx_name'=>Fault::where(['fault_id'=>$t21])->value('name'),
|
|
|
- // ];
|
|
|
- // }
|
|
|
- // }
|
|
|
- // //循环作答的排除方法,,匹配固定的排除方法
|
|
|
- // foreach ($fangfa_arr as $k22 =>$t22){
|
|
|
- // if(!empty($t22) && !in_array($t22,$paichu_arr)){
|
|
|
- // $fangfa_score = 1+$fangfa_score;
|
|
|
- // $fangfa_content[] = [
|
|
|
- // 'cx_id'=>$t22,
|
|
|
- // 'cx_type'=>'错写',
|
|
|
- // 'cx_name'=>Fault::where(['fault_id'=>$t22])->value('name'),
|
|
|
- // ];
|
|
|
- // }
|
|
|
- // }
|
|
|
- // //排除方法 end
|
|
|
-
|
|
|
- // //可能原因 start
|
|
|
- // //循环固定的可能原因,匹配作答的可能原因
|
|
|
- // foreach ($yy_arr as $k31 =>$t31){
|
|
|
- // if(!in_array($t31,$yuanyin_arr)){
|
|
|
- // // echo $t31."<br/>";
|
|
|
- // $yuanyin_socre = 1+$yuanyin_socre;
|
|
|
- // $yuanyin_content[] = [
|
|
|
- // 'cx_id'=>$t31,
|
|
|
- // 'cx_type'=>'少写',
|
|
|
- // 'cx_name'=>Fault::where(['fault_id'=>$t31])->value('name'),
|
|
|
- // ];
|
|
|
- // }
|
|
|
- // }
|
|
|
- // //循环作答的排除方法,,匹配固定的排除方法
|
|
|
- // foreach ($yuanyin_arr as $k32 =>$t32){
|
|
|
- // if(!empty($t32) && !in_array($t32,$yy_arr)){
|
|
|
- // $yuanyin_socre = 1+$yuanyin_socre;
|
|
|
- // $yuanyin_content[] = [
|
|
|
- // 'cx_id'=>$t32,
|
|
|
- // 'cx_type'=>'错写',
|
|
|
- // 'cx_name'=>Fault::where(['fault_id'=>$t32])->value('name'),
|
|
|
- // ];
|
|
|
- // }
|
|
|
- // }
|
|
|
- // $uniqueArray = array_unique($yuanyin_arr);
|
|
|
- // $diff = array_diff_assoc($yuanyin_arr, $uniqueArray);
|
|
|
- // if(!empty($diff)){
|
|
|
- // foreach ($diff as $k323 =>$t323){
|
|
|
- // $yuanyin_socre = 1+$yuanyin_socre;
|
|
|
- // $yuanyin_content[] = [
|
|
|
- // 'cx_id'=>$t323,
|
|
|
- // 'cx_type'=>'错写',
|
|
|
- // 'cx_name'=>Fault::where(['fault_id'=>$t323])->value('name'),
|
|
|
- // ];
|
|
|
- // }
|
|
|
- // }
|
|
|
- // //可能原因 end
|
|
|
+ // echo "故障现象得分:".$xianxian_score."<br/>";
|
|
|
+ // echo "故障部位得分:".$buwei_score."<br/>";
|
|
|
+ // echo "排除方法得分:".$fangfa_score."<br/>";
|
|
|
+ // echo "可能原因得分:".$yuanyin_socre."<br/>";
|
|
|
+ // die();
|
|
|
|
|
|
$weixiu_score = $xianxian_score+$yuanyin_socre+$buwei_score+$fangfa_score;
|
|
|
if($weixiu_score>15){
|
|
@@ -701,46 +612,8 @@ class Practice extends Backend
|
|
|
$report_score = 15-$row['xianxian_score']-$row['yuanyin_socre']-$row['buwei_score']-$row['fangfa_score'];
|
|
|
$row['report_score'] = $report_score>0?$report_score:0;
|
|
|
|
|
|
- $row['xianxian_content_name'] = '';
|
|
|
- if(!empty($row['xianxian_content']))
|
|
|
- {
|
|
|
- $row['xianxian_content_name'] = json_decode($row['xianxian_content'],true);
|
|
|
- }
|
|
|
- $row['yuanyin_content_name'] = '';
|
|
|
- if(!empty($row['yuanyin_content']))
|
|
|
- {
|
|
|
- $row['yuanyin_content_name'] = json_decode($row['yuanyin_content'],true);
|
|
|
- }
|
|
|
- $row['buwei_content_name'] = '';
|
|
|
- if(!empty($row['buwei_content']))
|
|
|
- {
|
|
|
- $row['buwei_content_name'] = json_decode($row['buwei_content'],true);
|
|
|
- }
|
|
|
- $row['fangfa_content_name'] = '';
|
|
|
- if(!empty($row['fangfa_content']))
|
|
|
- {
|
|
|
- $row['fangfa_content_name'] = json_decode($row['fangfa_content'],true);
|
|
|
- }
|
|
|
- $other_report = !empty($row['other_report']) ? json_decode($row['other_report'],true):[];
|
|
|
$other_jielun = !empty($row['other_jielun']) ? json_decode($row['other_jielun'],true):[];
|
|
|
-
|
|
|
- $fault_right_list = Db::name('real_exam_fault')->where(['exam_id'=>$ids,'flag'=>1])->select();
|
|
|
- //根据故障部位 数组
|
|
|
- $fault_arr = [$fault_right_list[0]['fault_id'],$fault_right_list[1]['fault_id'],$fault_right_list[2]['fault_id']];
|
|
|
-
|
|
|
- //查找故障现象 数组
|
|
|
- $partent_fault_id = Fault::where(['fault_id'=>['in',$fault_arr],'sim_type'=>$rows['sim_type']])->column('parent_fault_id');
|
|
|
- $arr1= [];
|
|
|
- foreach ($partent_fault_id as $key => $value) {
|
|
|
- $arr1[] = [
|
|
|
- 'gzxz_id' => $value,
|
|
|
- 'xianxian_content' => $row['xianxian_content_name'],
|
|
|
- 'other_report' => $other_report,
|
|
|
- 'other_jielun' => $other_jielun,
|
|
|
- ];
|
|
|
- }
|
|
|
- $this->view->assign('other_report', $other_report);
|
|
|
- $this->view->assign('partent_fault_id', $arr1);
|
|
|
+ $this->view->assign('other_jielun', $other_jielun);
|
|
|
|
|
|
$this->view->assign('row', $row);
|
|
|
return $this->view->fetch();
|