فهرست منبع

20250208 优化调整

贾小兵 7 ماه پیش
والد
کامیت
197032e109

+ 5 - 1
application/admin/controller/student/Exercise.php

@@ -90,7 +90,11 @@ 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,7];//array_rand($fault_list, 3);
+                    // $fault_key = [1,5,7];//array_rand($fault_list, 3);
+                    $fault_key1 = rand(0, 1);
+                    $fault_key2 = rand(2, 3);
+                    $fault_key3 = rand(4, 5);
+                    $fault_key = [$fault_key1,$fault_key2,$fault_key3];
                     $flag = 0;
                     if(!empty($fault_key) && in_array($key,$fault_key)){
                         $flag = 1;

+ 10 - 2
application/admin/controller/teacher/Collection.php

@@ -110,7 +110,11 @@ class Collection extends Backend
                 //匹配的学员自动加入  mx_real_exam_fault 考试故障关联表
                 $fault_list = Fault::where(['sim_type' => $params['sim_type'], 'fault_state' => 0,'fault_type'=>3])->select();
                 if($params['question_setting_method']==1){ //系统随机
-                    $fault_key = $this->rand_fault($fault_list);
+                    // $fault_key = $this->rand_fault($fault_list);
+                    $fault_key1 = rand(0, 1);
+                    $fault_key2 = rand(2, 3);
+                    $fault_key3 = rand(4, 5);
+                    $fault_key = [$fault_key1,$fault_key2,$fault_key3];
                 }else if($params['question_setting_method']==2){//教师自选
                     $question_ids = $params['question_ids'];
                 }else if($params['question_setting_method']==3){ //任务自选
@@ -228,7 +232,11 @@ class Collection extends Backend
                     //匹配的学员自动加入  mx_real_exam_fault 考试故障关联表
                     $fault_list = Fault::where(['sim_type' => $params['sim_type'], 'fault_state' => 0,'fault_type'=>3])->select();
                     if($params['question_setting_method']==1){ //系统随机
-                        $fault_key = $this->rand_fault($fault_list);
+                        // $fault_key = $this->rand_fault($fault_list);
+                        $fault_key1 = rand(0, 1);
+                        $fault_key2 = rand(2, 3);
+                        $fault_key3 = rand(4, 5);
+                        $fault_key = [$fault_key1,$fault_key2,$fault_key3];
                     }else if($params['question_setting_method']==2){//教师自选
                         $question_ids = $params['question_ids'];
                     }else if($params['question_setting_method']==3){ //任务自选

+ 10 - 2
application/admin/controller/teacher/Practice.php

@@ -114,8 +114,12 @@ class Practice extends Backend
                 //匹配的学员自动加入  mx_real_exam_fault 考试故障关联表
                 $fault_list = Fault::where(['sim_type' => $params['sim_type'], 'fault_state' => 0,'fault_type'=>3])->select();
                 if($params['question_setting_method']==1){ //系统随机
+                    $fault_key1 = rand(0, 1);
+                    $fault_key2 = rand(2, 3);
+                    $fault_key3 = rand(4, 5);
+                    $fault_key = [$fault_key1,$fault_key2,$fault_key3];
                     // $fault_key = array_rand($fault_list, 3);
-                    $fault_key = $this->rand_fault($fault_list);
+                    // $fault_key = $this->rand_fault($fault_list);
                 }else if($params['question_setting_method']==2){//教师自选
                     $question_ids = $params['question_ids'];
                 }else if($params['question_setting_method']==3){ //任务自选
@@ -228,8 +232,12 @@ class Practice extends Backend
                     //匹配的学员自动加入  mx_real_exam_fault 考试故障关联表
                     $fault_list = Fault::where(['sim_type' => $params['sim_type'], 'fault_state' => 0,'fault_type'=>3])->select();
                     if($params['question_setting_method']==1){ //系统随机
+                        $fault_key1 = rand(0, 1);
+                        $fault_key2 = rand(2, 3);
+                        $fault_key3 = rand(4, 5);
+                        $fault_key = [$fault_key1,$fault_key2,$fault_key3];
                         // $fault_key = array_rand($fault_list, 3);
-                        $fault_key = $this->rand_fault($fault_list);
+                        // $fault_key = $this->rand_fault($fault_list);
                     }else if($params['question_setting_method']==2){//教师自选
                         $question_ids = $params['question_ids'];
                     }else if($params['question_setting_method']==3){ //任务自选