Просмотр исходного кода

20250227 练习和考试调整

贾小兵 1 месяц назад
Родитель
Сommit
bc3f794d55

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

@@ -96,11 +96,18 @@ class Exercise extends Backend
                 //匹配的学员自动加入  mx_real_exam_fault 考试故障关联表
                 $fault_list = Fault::where(['sim_type' => $params['sim_type'], 'fault_state' => 0,'fault_type'=>3])->select();
                 foreach ($fault_list as $key=> $item1){
+                    $fault_key = [1,5,10];
                     if($params['sim_type']=='0002'){
-                        $fault_key = [1,4,10];
+                        $fault_key1 = 1;
+                        $fault_key2 = 5;
+                        $fault_key3 = rand(10,11);
                     }else{
-                        $fault_key = [1,3,5];
+                        $fault_key1 = rand(0, 1);
+                        $fault_key2 = rand(2, 3);
+                        $fault_key3 = 9;
                     }
+                    $fault_key = [$fault_key1,$fault_key2,$fault_key3];
+
                     $flag = 0;
                     if(!empty($fault_key) && in_array($key,$fault_key)){
                         $flag = 1;

+ 4 - 2
application/admin/controller/student/Practice.php

@@ -608,10 +608,12 @@ class Practice extends Backend
 
         $row['fault_score'] = 75-$row['fault_one_score']-$row['fault_two_score']-$row['fault_three_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'])){

+ 3 - 3
application/admin/controller/teacher/Collection.php

@@ -123,13 +123,13 @@ class Collection extends Backend
                     $fault_list = Fault::where(['sim_type' => $params['sim_type'], 'fault_state' => 0,'fault_type'=>3])->select();
                     if($params['question_setting_method']==1){ //系统随机
                         if($params['sim_type']=='0002'){
-                            $fault_key1 = rand(0, 1);
-                            $fault_key2 = 4;
+                            $fault_key1 = 1;
+                            $fault_key2 = 5;
                             $fault_key3 = rand(10,11);
                         }else{
                             $fault_key1 = rand(0, 1);
                             $fault_key2 = rand(2, 3);
-                            $fault_key3 = rand(4, 5);
+                            $fault_key3 = 9;
                         }
                         $fault_key = [$fault_key1,$fault_key2,$fault_key3];
                     }else if($params['question_setting_method']==2){//教师自选

+ 16 - 5
application/admin/controller/teacher/Practice.php

@@ -121,13 +121,13 @@ class Practice extends Backend
                     $fault_list = Fault::where(['sim_type' => $params['sim_type'], 'fault_state' => 0,'fault_type'=>3])->select();
                     if($params['question_setting_method']==1){ //系统随机
                         if($params['sim_type']=='0002'){
-                            $fault_key1 = rand(0, 1);
-                            $fault_key2 = 4;
+                            $fault_key1 = 1;
+                            $fault_key2 = 5;
                             $fault_key3 = rand(10,11);
                         }else{
                             $fault_key1 = rand(0, 1);
                             $fault_key2 = rand(2, 3);
-                            $fault_key3 = rand(4, 5);
+                            $fault_key3 = 9;
                         }
                         $fault_key = [$fault_key1,$fault_key2,$fault_key3];
                     }else if($params['question_setting_method']==2){//教师自选
@@ -410,13 +410,20 @@ class Practice extends Backend
         $list = Db::name('seat')->select();
         foreach ($list as $key => $value) {
             $sim = Db::name('sim')->where('seat_id',$value['seat_id'])->where('sim_type',$sim_type)->find();
+            if($sim_type=='0001'){
+                $sim_type_text = 'FZD04B';
+            }else if($sim_type=='0002'){
+                $sim_type_text = 'FZB006';
+            }else if($sim_type=='0003'){
+                $sim_type_text = '防化兵型';
+            }
             if(!empty($sim['sim_state'])){
                 switch ($sim['sim_state']) {
                     case '1':
-                        $sim_state = '在线';
+                        $sim_state = $sim_type_text.'在线';
                         break;
                     case '2':
-                        $sim_state = '离线';
+                        $sim_state = $sim_type_text.'离线';
                         break;
                     default:
                         $sim_state = '';
@@ -432,6 +439,7 @@ class Practice extends Backend
             $total_score = 0;
             $fault_names = '';
             $exam_id = 0;
+            $simtype = '';
             if(!empty($exam)){
                 $user_username = $exam['user_username']??'';
                 $user_nickname = $exam['user_nickname']??'';
@@ -445,6 +453,7 @@ class Practice extends Backend
                 $total_score = $exam['total_score']??'';
                 $fault_names = $exam['fault_names']??'';
                 $exam_id = $exam['exam_id']??0;
+                $simtype = $exam['sim_type']??'';
             }
             $list[$key]['user_username'] = $user_username;
             $list[$key]['user_nickname'] = $user_nickname;
@@ -453,6 +462,7 @@ class Practice extends Backend
             $list[$key]['fault_names'] = $fault_names;
             $list[$key]['exam_id'] = $exam_id;
             $list[$key]['sim_state'] = $sim_state;
+            $list[$key]['sim_type'] = $simtype;
         }
         $result = ['total' => count($list), 'rows' => $list];
         return json($result);
@@ -481,6 +491,7 @@ class Practice extends Backend
                 $v->seat_id = $exam['seat_id'];
                 $v->user_username = $exam['user_username'];
                 $v->user_nickname = $exam['user_nickname'];
+                $v->sim_type = $exam['sim_type'];
             }
         }
         unset($v);

+ 3 - 3
application/admin/view/student/practice/into.html

@@ -59,11 +59,11 @@
                             </div>
                             <div class="form-group col-sm-6">
                                 <label class="control-label">{:__('模拟器类型')}:</label>
-                                <input type="text" class="form-control" value="{$admin.nickname|htmlentities}" readonly/>
+                                <input type="text" class="form-control" value="{$admin.sim_type_text|htmlentities}" readonly/>
                             </div>
                             <div class="form-group col-sm-6">
                                 <label class="control-label">{:__('模拟器状态')}:</label>
-                                <input type="text" class="form-control"  value="在线" readonly/>
+                                <input type="text" class="form-control"  value="{$info.sim_text|htmlentities}" readonly/>
                             </div>
                             <div class="form-group col-sm-6">
                                 <label class="control-label">{:__('考试学员')}:</label>
@@ -71,7 +71,7 @@
                             </div>
                             <div class="form-group col-sm-6">
                                 <label class="control-label">{:__('学员座号')}:</label>
-                                <input type="text" class="form-control"  value="01" readonly/>
+                                <input type="text" class="form-control"  value="{$info.seat_id|htmlentities}"  readonly/>
                             </div>
                         </div>
                     </div>

+ 3 - 1
public/assets/js/backend/teacher/practice.js

@@ -182,6 +182,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
                 columns: [
                     [
                         // {checkbox: true},
+                        {field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
                         {field: 'fault_name', title: __('更换件')},
                         {field: 'create_by', title: __('学员姓名')},
                         {field: 'request_status', title: __('状态'),
@@ -262,7 +263,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
                     [
                         // {checkbox: true},
                         {field: 'seat_id', title: __('座号')},
-                        {field: 'seat_id', title: __('座号')},
+                        {field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
                         {field: 'sim_state', title: __('模拟器状态'),
                             formatter: function(value, row,index) {
                                 if(value=='在线'){
@@ -337,6 +338,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
                     [
                         // {checkbox: true},
                         {field: 'seat_id', title: __('座号')},
+                        {field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
                         {field: 'user_username', title: __('学员学号')},
                         {field: 'user_nickname', title: __('学员姓名')},
                         {field: 'total', title: __('考试成绩')},