贾小兵 2 тижнів тому
батько
коміт
f16c3121ba

+ 13 - 0
application/admin/controller/student/Collection.php

@@ -370,6 +370,19 @@ class Collection extends Backend
                         ];
                     }
                 }
+                //判断答案是否有重复回答的
+                $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
                 
                 $weixiu_score = $xianxian_score+$yuanyin_socre+$buwei_score+$fangfa_score;

+ 12 - 0
application/admin/controller/student/Exercise.php

@@ -349,6 +349,18 @@ class Exercise extends Backend
                         ];
                     }
                 }
+                $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
                 
                 

+ 12 - 0
application/admin/controller/student/Practice.php

@@ -383,6 +383,18 @@ class Practice extends Backend
                         ];
                     }
                 }
+                $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
 
                 $weixiu_score = $xianxian_score+$yuanyin_socre+$buwei_score+$fangfa_score;

+ 7 - 1
application/admin/controller/teacher/Exams.php

@@ -84,6 +84,8 @@ class Exams extends Backend
                         $one[$k1]['epercent'] = $bili>0 ? $bili.'%' : '';
                     }
                 }
+                $vaccineCount = array_column($one, 'epercent');
+                array_multisort($vaccineCount,SORT_DESC,$one);
                 $one_static = $one;
             }
             $two = Fault::where(['sim_type'=>'0002'])->where($where_falut)->field('fault_id,name')->select();
@@ -97,6 +99,8 @@ class Exams extends Backend
                         $two[$k2]['epercent'] = $bili>0 ? $bili.'%' : '';
                     }
                 }
+                $vaccineCount1 = array_column($two, 'epercent');
+                array_multisort($vaccineCount1,SORT_DESC,$two);
             }
             $two_static = $two;
             $three = Fault::where(['sim_type'=>'0003'])->where($where_falut)->field('fault_id,name')->select();
@@ -110,6 +114,8 @@ class Exams extends Backend
                         $three[$k3]['epercent'] = $bili>0 ? $bili.'%' : '';
                     }
                 }
+                $vaccineCount2 = array_column($three, 'epercent');
+                array_multisort($vaccineCount2,SORT_DESC,$three);
             }
             $three_static = $three;
         }
@@ -306,7 +312,7 @@ class Exams extends Backend
             }else{
                 $sim_state = '';
             }
-            $exam = $this->model->where('exam_collection_id',$ids)->where('seat_id',$value['seat_id'])->find();
+            $exam = $this->model->where('exam_collection_id',$ids)->order('exam_id desc')->where('seat_id',$value['seat_id'])->find();
             $user_username = '';
             $user_nickname = '';
             $exam_status = '未登录';

+ 4 - 4
application/admin/view/teacher/exams/index.html

@@ -40,7 +40,7 @@
         </table>
 
         <div class="tableTitle success" style="font-size: 16px;margin: 10px 0">错误率统计</div>
-        <table style="width: 33%;float: left" class="table table-striped table-bordered table-hover table-nowrap panel-success">
+        <table style="width: 33%;float: left;border: 2px solid #ebd6d6;" class="table table-striped table-bordered table-hover table-nowrap panel-success">
             <thead>
             <tr style="text-align: center">
                 <td colspan="2">FZD04B型侦毒器</td>
@@ -54,7 +54,7 @@
 
             </tbody>
         </table>
-        <table style="width: 33%;float: left;background-color: #e1e1c3" class="table table-striped table-bordered table-hover table-nowrap panel-success">
+        <table style="width: 33%;float: left;border: 2px solid #ebd6d6;" class="table table-striped table-bordered table-hover table-nowrap panel-success">
             <thead>
             <tr style="text-align: center">
                 <td colspan="2">FZB006型毒剂报警器</td>
@@ -64,11 +64,11 @@
                 <td>错误率</td>
             </tr>
             </thead>
-            <tbody class="tbodytwo" style="background-color: #e1e1c3;">
+            <tbody class="tbodytwo">
 
             </tbody>
         </table>
-        <table style="width: 33%;" class="table table-striped table-bordered table-hover table-nowrap panel-success">
+        <table style="width: 33%;border: 2px solid #ebd6d6;" class="table table-striped table-bordered table-hover table-nowrap panel-success">
             <thead>
             <tr style="text-align: center">
                 <td colspan="2">防化兵用毒剂报警器</td>

+ 9 - 1
public/assets/js/backend/teacher/exams.js

@@ -256,7 +256,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
                         {field: 'user_nickname', title: __('学员姓名')},
                         {field: 'exam_status', title: __('考试状态'),
                             formatter: function(value, row,index) {
-                                return '<span class="text-success">'+value+'</span>';
+                                if(value=='未登录'){
+                                    return '<span class="text-danger">'+value+'</span>';
+                                }else if(value=='已登录未开始考试'){
+                                    return '<span class="text-warning">'+value+'</span>';
+                                }else if(value=='已开始考试'){
+                                    return '<span class="text-info">'+value+'</span>';
+                                }else if(value=='已交卷'){
+                                    return '<span class="text-success">'+value+'</span>';
+                                }
                             }
                         },
                         {field: 'total_score', title: __('考试成绩')},