소스 검색

20250216 优化调整

贾小兵 1 주 전
부모
커밋
6622c39f8d

+ 11 - 3
application/admin/controller/student/Collection.php

@@ -316,9 +316,11 @@ class Collection extends Backend
                                 $buwei_id= '';
                                 $paichu_id= '';
                                 $yy_id = [];
+                                $xx_id = 0;
                                 foreach($fault_arr as $kk1 =>$va1){
                                     $fault_find = Fault::where(['fault_id'=>$va1])->find();
                                     if($fault_find['parent_fault_id']==$v['xx_id']){
+                                        $xx_id = $fault_find['parent_fault_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');
@@ -327,7 +329,9 @@ class Collection extends Backend
 
 
                                 if($v['bw_id']!=$buwei_id){
-                                    $buwei_score = 1+$buwei_score;
+                                    if($v['xx_id']==$xx_id){
+                                        $buwei_score = 1+$buwei_score;
+                                    }
                                     $kscore = 1+$kscore;
                                     $content[] = [
                                         'gzxz_id'=>$v['xx_id'],
@@ -339,7 +343,9 @@ class Collection extends Backend
                                 //故障部位少写
                                 //获取当前的故障部位
                                 if($buwei_id!=$v['bw_id']){
-                                    $buwei_score = 1+$buwei_score;
+                                    if($v['xx_id']==$xx_id){
+                                        $buwei_score = 1+$buwei_score;
+                                    }
                                     $kscore = 1+$kscore;
                                     $content[] = [
                                         'gzxz_id'=>$v['xx_id'],
@@ -362,7 +368,9 @@ class Collection extends Backend
                                 }
                                 //排放方法  少写
                                 if($paichu_id!=$v['pc_id']){
-                                    $fangfa_score = 1+$fangfa_score;
+                                    if($v['xx_id']==$xx_id){
+                                        $buwei_score = 1+$buwei_score;
+                                    }
                                     $kscore = 1+$kscore;
                                     $content[] = [
                                         'gzxz_id'=>$v['xx_id'],

+ 16 - 2
application/admin/controller/student/Exam.php

@@ -69,12 +69,26 @@ class Exam 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);
 
 

+ 19 - 2
application/admin/controller/student/Exercise.php

@@ -601,8 +601,6 @@ class Exercise 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; 
 
@@ -612,6 +610,25 @@ class Exercise extends Backend
         $row['shijian'] = $minutes.'分'.$seconds.'秒';
         
         $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);
         $this->view->assign('row', $row);
         return $this->view->fetch();

+ 17 - 1
application/admin/controller/student/Practice.php

@@ -608,10 +608,26 @@ class Practice 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; 
 
         $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']; // 两个时间戳之间的差异(秒)

+ 26 - 3
application/admin/controller/teacher/Exams.php

@@ -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']; // 两个时间戳之间的差异(秒)

+ 1 - 1
public/assets/js/backend/student/exercise.js

@@ -84,7 +84,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 if(Config.isloading==1 && countdownTime>0){
                     dingshi = setInterval(function() {
                         window.location.reload();
-                    }, 2000);
+                    }, 30000);
                 }
             });