|
@@ -170,7 +170,13 @@ class Exams extends Backend
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
//是否采用模型验证
|
|
|
- $params['total'] = 100-$params['fault_one_score']-$params['fault_two_score']-$params['fault_three_score']-$params['xianxian_score']-$params['yuanyin_socre']-$params['buwei_score']-$params['fangfa_score']-$params['overtime_score'];
|
|
|
+ $koufen = 0;
|
|
|
+ foreach ($other_jielun as $key => $value) {
|
|
|
+ if(!empty($value['cx_score'])){
|
|
|
+ $koufen = $koufen+abs($value['cx_score']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $params['total'] = 100-$params['fault_one_score']-$params['fault_two_score']-$params['fault_three_score']-$params['overtime_score']-$koufen;
|
|
|
$result = Db::name('real_exam_score')->where('id', $row['id'])->update($params);
|
|
|
|
|
|
$rows->total_score = $params['total'];
|
|
@@ -210,11 +216,28 @@ class Exams extends Backend
|
|
|
|
|
|
$row['fault_score'] = 75-$row['fault_one_score']-$row['fault_two_score']-$row['fault_three_score'];
|
|
|
|
|
|
- $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['weixiu_score'] = 10-$row['overtime_score']??0;
|
|
|
$other_jielun = !empty($row['other_jielun']) ? json_decode($row['other_jielun'],true):[];
|
|
|
+
|
|
|
+
|
|
|
+ $koufen = 0;
|
|
|
+ foreach ($other_jielun as $key => $value) {
|
|
|
+ if(!empty($value['cx_score'])){
|
|
|
+ $koufen = $koufen+abs($value['cx_score']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $report_score = 15-$koufen;
|
|
|
+ $row['report_score'] = $report_score>0?$report_score:0;
|
|
|
+
|
|
|
+
|
|
|
+ $total = $row['fault_score']+$row['report_score']+$row['weixiu_score'];
|
|
|
+ Db::name('real_exam_score')->where('exam_id', $ids)->update(['total'=>$total]);
|
|
|
+ Db::name('real_exam')->where('exam_id', $ids)->update(['total_score'=>$total]);
|
|
|
+
|
|
|
+ $row['total'] = $total;
|
|
|
+
|
|
|
$this->view->assign('other_jielun', $other_jielun);
|
|
|
|
|
|
$diffInSeconds = $rows['endtime'] - $rows['starttime']; // 两个时间戳之间的差异(秒)
|