贾小兵 3 mesi fa
parent
commit
e549fdc133

+ 20 - 0
application/admin/common.php

@@ -195,3 +195,23 @@ if (!function_exists('build_heading')) {
         return $result;
     }
 }
+if (!function_exists('send_post')) {
+
+    function send_post($url = null){
+        $curl = curl_init();
+        curl_setopt_array($curl, array(
+            CURLOPT_URL => $url,
+            CURLOPT_RETURNTRANSFER => true,
+            CURLOPT_ENCODING => '',
+            CURLOPT_MAXREDIRS => 10,
+            CURLOPT_TIMEOUT => 0,
+            CURLOPT_FOLLOWLOCATION => true,
+            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
+            CURLOPT_CUSTOMREQUEST => 'PUT',
+        ));
+
+        $response = curl_exec($curl);
+        return $response;
+        curl_close($curl);
+    }
+}

+ 152 - 10
application/admin/controller/student/Collection.php

@@ -66,9 +66,8 @@ class Collection extends Backend
     {
         $isset = $this->model->alias('z')
         ->join('real_exam r','z.exam_collection_id=r.exam_collection_id','left')
-        ->where('z.exam_collection_type=3 and z.exam_collection_state=2 and r.endtime=0 and r.user_id='.$this->auth->id)->find();
+        ->where('z.exam_collection_type=3 and z.exam_collection_state=2  and r.endtime=0 and r.user_id='.$this->auth->id)->find();
 
-//        halt($this->model->getLastSql());
         if(empty($isset)){
             //提示页面,没有开始的考试
             return $this->view->fetch('tishi');
@@ -115,6 +114,12 @@ class Collection extends Backend
         if(!$row){
             $this->error('未找到记录');
         }
+        //如果考试时间结束,也不可进入考试,超时未进入考试的学员
+//        $duration =  10+$row->limit_duration;
+//        $futureTimestamp = strtotime("+$duration minutes", $row->starttime);
+//        if(time()>$futureTimestamp){
+//            return $this->view->fetch('tishi');
+//        }
         $info = $this->exam_model->where(['user_id'=>$this->auth->id,'exam_collection_id'=>$ids,'exam_collection_type'=>3,'endtime'=>0])->find();
         if(!empty($info)){
             $this->exam_model->where('exam_id',$info['exam_id'])->update(['seat_id'=>$this->auth->seat_id,'sim_id'=>$this->auth->sim_id]);
@@ -172,13 +177,22 @@ class Collection extends Backend
             $fault_one_score = 25;
             $fault_two_score = 25;
             $fault_three_score = 25;
+
             $xianxian_score = 0;
             $yuanyin_socre= 0;
             $buwei_score= 0;
             $fangfa_score= 0;
+
+            $xianxian_arr = [];
+            $yuanyin_arr = [];
+            $buwei_arr = [];
+            $fangfa_arr = [];
             $jielun_score = 0;
+
+
             Db::startTrans();
             try {
+
                 //更新考试结束时间
                 $row->end_time = date('Y-m-d H:i:s');
                 $row->endtime = time();
@@ -188,6 +202,24 @@ class Collection extends Backend
 
                 $info = $this->exam_model->where(['exam_id'=>$ids])->find();
 
+
+                //更新故障是否正确
+//                $fault_list = Db::name('real_exam_fault')->where(['exam_id'=>$ids,'flag'=>1])->select();
+//                if(!empty($fault_list)){
+//                    foreach ($fault_list as $k =>$t){
+//                        $answer_right = 0;
+//                        if(!empty($t['sim_fault_question_value']) && !empty($t['sim_fault_answer_value'])){
+//                            if($t['sim_fault_question_value']==$t['sim_fault_answer_value']){
+//                                $answer_right=1;
+//                            }else{
+//                                $answer_right=2;
+//                            }
+//                        }
+//                        Db::name('real_exam_fault')->where(['ref_id'=>$t['ref_id']])->update(['answer_right'=>$answer_right]);
+//                    }
+//                }
+
+
                 //计算得分,故障是否有扣分  扣分制
                 $fault_right_list = Db::name('real_exam_fault')->where(['exam_id'=>$ids,'flag'=>1,'answer_right'=>['>',0]])->select();
                 if(!empty($fault_right_list)){
@@ -200,12 +232,114 @@ class Collection extends Backend
                     if($fault_right_list[2]['answer_right']==1){
                         $fault_three_score = 0;
                     }
-                }
-                $xianxian_score = rand(1,3);
-                $yuanyin_socre= rand(1,3);
-                $buwei_score= rand(1,3);
-                $fangfa_score= rand(1,3);
 
+                    //根据故障部位,查找故障现象
+                    $fault_arr = [$fault_right_list[0]['fault_id'],$fault_right_list[1]['fault_id'],$fault_right_list[2]['fault_id']];
+                    $partent_fault_id = Fault::where(['fault_id'=>['in',$fault_arr]])->column('parent_fault_id');
+
+                    //故障保存的是部位,需要查找故障现象
+                    $report = json_decode($params['other_report'],true);
+                    if(count($report)<3){
+                        $xianxian_score = 5;
+                    }else{
+                        foreach ($report as $key => $em){
+//                            //故障现象
+                            if(!in_array($em['xx_id'],$partent_fault_id)){
+                                $xianxian_score = 5+$xianxian_score;
+                                $xianxian_arr[] = $em['xx_id'];
+                            }
+//                            echo $em['yy_id']."<br>";
+
+                            //故障部位
+                            if(!empty($em['bw_id'])){
+                                $report = Report::where('bw_id',$em['bw_id'])->find();
+                                if(empty($report) || $report['bw_type']==30){
+                                    $buwei_score = 1+$buwei_score;
+//                                    array_push($buwei_arr,$em['bw_id']);
+                                    $buwei_arr[] = $em['bw_id'];
+//                                    echo "这里是假的部位扣了+1分<br/>";
+                                }
+//                                if(!empty($em['yy_id']) && !empty($report)){
+//                                    if($report['bw_type']!=3 || $report['yy_id']!=$em['yy_id'] ){
+//                                        $buwei_score = 1+$buwei_score;
+//                                        echo "这里错误扣了+1分<br/>";
+//                                    }
+//                                }
+
+                            }else{
+                                //部位为空 +1
+                                $buwei_score = 1+ $buwei_score;
+//                                $buwei_arr[] = '';
+//                                array_push($buwei_arr,'');
+//                                echo "这里为空扣了+1分<br/>";
+                            }
+
+
+                            //可能原因
+                            if(!empty($em['yy_id'])){
+                                $report = Report::where('yy_id',$em['yy_id'])->find();
+                                if(empty($report) || $report['bw_type']==30){
+                                    $yuanyin_socre = 1+ $yuanyin_socre;
+//                                    echo "这里是假的部位扣了+1分<br/>";
+//                                    array_push($yuanyin_arr,$em['yy_id']);
+                                    $yuanyin_arr[] = $em['yy_id'];
+                                }
+                                if(!empty($em['yy_id']) && !empty($report)){
+                                    if($report['bw_id']!=$em['bw_id'] ){
+                                        $yuanyin_socre = 1+$yuanyin_socre;
+//                                        echo "这里错误扣了+1分<br/>";
+//                                        array_push($yuanyin_arr,$em['yy_id']);
+                                        $yuanyin_arr[] = $em['yy_id'];
+                                    }
+                                }
+                            }else{
+                                //部位为空 +1
+                                $yuanyin_socre = 1+$yuanyin_socre;
+//                                array_push($yuanyin_arr,'');
+//                                echo "这里为空扣了+1分<br/>";
+//                                $yuanyin_arr[] = '';
+                            }
+                            //排除方法
+                            if(!empty($em['pc_id'])){
+                                $report = Report::where('pc_id',$em['pc_id'])->find();
+                                if(empty($report) || $report['bw_type']==30){
+                                    $fangfa_score = 1+ $fangfa_score;
+
+                                    $fangfa_arr[] = $em['pc_id'];
+//                                    array_push($fangfa_arr,$em['pc_id']);
+//                                    echo "这里是假的方法扣了+1分<br/>";
+                                }
+                                if(!empty($em['pc_id']) && !empty($report)){
+                                    if($report['bw_id']!=$em['bw_id'] ){
+                                        $fangfa_score = 1+$fangfa_score;
+                                        $fangfa_arr[] = $em['pc_id'];
+//                                        array_push($fangfa_arr,$em['pc_id']);
+//                                        echo "这里错误扣了+1分<br/>";
+                                    }
+                                }
+                            }else{
+                                $fangfa_score = 1+$fangfa_score;
+//                                array_push($yuanyin_arr,'');
+//                                $fangfa_arr[] = '';
+//                                echo "这里为空扣了+1分<br/>";
+                            }
+                        }
+//                        echo '部位:'.$buwei_score.'<br/>';
+//                        echo '原因:'.$yuanyin_socre.'<br/>';
+//                        echo '方法:'.$fangfa_score.'<br/>';
+                    }
+                }
+//                halt($yuanyin_arr);
+//                echo '现象:'.$xianxian_score;
+//                die();
+                 $weixiu_score = $xianxian_score+$yuanyin_socre+$buwei_score+$fangfa_score;
+                 if($weixiu_score>15){
+                     $weixiu_score = 15;
+                 }
+//                $xianxian_score = rand(1,3);
+//                $yuanyin_socre= rand(1,3);
+//                $buwei_score= rand(1,3);
+//                $fangfa_score= rand(1,3);
 //                if(empty($params['other_jielun'])){
 //                    $jielun_score = rand(1,3);
 //                }
@@ -218,7 +352,7 @@ class Collection extends Backend
                 }else{
                     $overtime_score =0;
                 }
-                $fault_score = $score-$fault_one_score-$fault_two_score-$fault_three_score-$xianxian_score-$yuanyin_socre-$buwei_score-$fangfa_score-$overtime_score;
+                $fault_score = $score-$fault_one_score-$fault_two_score-$fault_three_score-$weixiu_score-$overtime_score;
 
                 //更新考试结果表
                 $params['exam_id'] = $ids;
@@ -228,9 +362,13 @@ class Collection extends Backend
                 $params['fault_three_score'] = $fault_three_score;//得分;
 
                 $params['xianxian_score'] = $xianxian_score;//得分;
+                $params['xianxian_content'] = !empty($xianxian_arr) ? json_encode($xianxian_arr):'';//错题;
                 $params['yuanyin_socre'] = $yuanyin_socre;//得分;
+                $params['yuanyin_content'] = !empty($yuanyin_arr) ? json_encode($yuanyin_arr) : '';//错题;
                 $params['buwei_score'] = $buwei_score;//得分;
+                $params['buwei_content'] = !empty($buwei_arr) ? json_encode($buwei_arr) :'';//错题;
                 $params['fangfa_score'] = $fangfa_score;//得分;
+                $params['fangfa_content'] = !empty($fangfa_arr) ? json_encode($fangfa_arr):'';//错题;
 //                $params['jielun_score'] = $jielun_score;//得分;
                 $params['overtime_score'] = $overtime_score;//得分;
                 Db::name('real_exam_score')->insert($params);
@@ -254,7 +392,9 @@ class Collection extends Backend
             $row->exam_status = 4;
             $row->save();
         }
+        $isloading =1;
         if(empty($row->other_replace)){
+            $isloading = 0;
             $row->other_replace = '[{"fault_id":"","request_status":"0"}]';
         }
         if(empty($row->other_report)){
@@ -266,13 +406,13 @@ class Collection extends Backend
         if(empty($row->starttime)){
             $timer = 60*$row->limit_duration;
         }else{
-            $fen =  $row->limit_duration - intval((time()-$row->starttime) / 60);
-            $timer = 60*$fen;
+            $timer = $row->limit_duration*60 - abs(time() - $row->starttime);
         }
 
         $row->replace_list =Db::name('real_exam_comp_request')->where(['exam_id'=>$ids])->select();
         $this->assignConfig('ids',$ids);
         $this->assignConfig('timer',$timer);
+        $this->assignConfig('isloading',$isloading);
         $this->view->assign('row', $row);
 
         $departmentdata = [];
@@ -302,6 +442,7 @@ class Collection extends Backend
     {
         if ($this->request->isPost()) {
             $params = $this->request->post('other_replace','');
+            $other_report = $this->request->post('other_report','');
             $param = json_decode($params,true);
             if(!empty($param)){
                 foreach ($param as $key=>$item){
@@ -332,6 +473,7 @@ class Collection extends Backend
                 unset($item);
                 $row = $this->exam_model->get($ids);
                 $row-> other_replace = json_encode($faultid_arr);
+                $row-> other_report = $other_report;
                 $result = $row->save();
             }
             $this->success('申请成功,待老师审批');

+ 23 - 5
application/admin/controller/teacher/Collection.php

@@ -295,17 +295,35 @@ class Collection extends Backend
         if (is_array($adminIds)) {
             $this->model->where($this->dataLimitField, 'in', $adminIds);
         }
+        $count = 0;
         if(!empty($values['exam_collection_state'])){
+            //开始考试集合
             if($values['exam_collection_state']==2){
+//                $state_count = $this->model->where(['exam_collection_state'=>$values['exam_collection_state'],'exam_collection_type'=>3])->count();
+//                if($state_count>0){
+//                    $this->error('已有启用的考试,请先关闭原来的考试');
+//                }
                 //触发Java端后台的接口数据,
-                // /dev-api/sim/real-exam-collection/teacher/exam/open/{examcollectionId}  $ids  put
-                $state_count = $this->model->where(['exam_collection_state'=>$values['exam_collection_state'],'exam_collection_type'=>3])->count();
-                if($state_count>0){
-                    $this->error('已有启用的考试,请先关闭原来的考试');
+                //dev-api/sim/real-exam-collection/teacher/exam/open/{examcollectionId}  $ids  put
+                $url = config('site.url_type').'/sim/real-exam-collection/teacher/exam/open/'.$ids;
+                $ret = json_decode(send_post($url),true);
+                if($ret['code']!=200){
+                    $this->error($ret['msg']);
                 }
+                $count = 1;
+            }
+            //关闭
+            if($values['exam_collection_state']==3){
+                //触发Java端后台的接口数据,
+                //dev-api/sim/real-exam-collection/teacher/exam/open/{examcollectionId}  $ids  put
+                $url = config('site.url_type').'/sim/real-exam-collection/teacher/exam/close/'.$ids;
+                $ret = json_decode(send_post($url),true);
+                if($ret['code']!=200){
+                    $this->error($ret['msg']);
+                }
+                $count = 1;
             }
         }
-        $count = 0;
         Db::startTrans();
         try {
             $list = $this->model->where($this->model->getPk(), 'in', $ids)->select();

+ 63 - 0
application/admin/controller/teacher/Exams.php

@@ -9,6 +9,7 @@ use think\exception\PDOException;
 use think\exception\ValidateException;
 use app\admin\model\teacher\ExamsScore;
 use app\admin\model\Fault;
+use app\admin\model\Report;
 /**
  * sim-考试表/成绩总分
  *
@@ -142,6 +143,36 @@ class Exams extends Backend
         $row['fault_name_two'] = Fault::where('fault_id',$fault_list[1]['fault_id'])->value('name');
         $row['fault_name_three'] = Fault::where('fault_id',$fault_list[2]['fault_id'])->value('name');
 
+        if($row['xianxian_score']>0 && empty($row['xianxian_content']))
+        {
+            $row['xianxian_content_name'] = '未选择';
+        }else{
+            $xianxian = Report::where(['xx_id'=>['in',json_decode($row['xianxian_content'],true)]])->column('xx_name');
+            $row['xianxian_content_name'] = !empty($xianxian) ? implode(',',$xianxian) :'不存在或未选择';
+        }
+        if($row['yuanyin_socre']>0 && empty($row['yuanyin_content']))
+        {
+            $row['yuanyin_content_name'] = '未选择';
+        }else{
+            $yuanyin = Report::where(['yy_id'=>['in',json_decode($row['yuanyin_content'],true)]])->column('yy_name');
+            $row['yuanyin_content_name'] = !empty($yuanyin) ? implode(',',$yuanyin) :'不存在或未选择';
+        }
+
+        if($row['buwei_score']>0 &&empty($row['buwei_content']))
+        {
+            $row['buwei_content_name'] = '未选择';
+        }else{
+            $buwei = Report::where(['bw_id'=>['in',json_decode($row['buwei_content'],true)]])->column('bw_name');
+            $row['buwei_content_name'] = !empty($buwei) ? implode(',',$buwei) :'不存在或未选择';
+        }
+        if($row['fangfa_score']>0 && empty($row['fangfa_content']))
+        {
+            $row['fangfa_content_name'] = '未选择';
+        }else{
+            $fangfa = Report::where(['pc_id'=>['in',json_decode($row['fangfa_content'],true)]])->column('pc_name');
+            $row['fangfa_content_name'] = !empty($fangfa) ? implode(',',$fangfa) :'不存在或未选择';
+        }
+
         if (false === $this->request->isPost()) {
             $this->view->assign('row', $row);
             return $this->view->fetch();
@@ -187,11 +218,43 @@ class Exams extends Backend
         $row['start_time'] = $rows->start_time;
         $row['end_time'] = $rows->end_time;
 
+
         $fault_list = Db::name('real_exam_fault')->where(['exam_id'=>$ids,'flag'=>1])->select();
         $row['fault_name_one'] = Fault::where('fault_id',$fault_list[0]['fault_id'])->value('name');
         $row['fault_name_two'] = Fault::where('fault_id',$fault_list[1]['fault_id'])->value('name');
         $row['fault_name_three'] = Fault::where('fault_id',$fault_list[2]['fault_id'])->value('name');
 
+        if($row['xianxian_score']>0 && empty($row['xianxian_content']))
+        {
+            $row['xianxian_content_name'] = '未选择';
+        }else{
+            $xianxian = Report::where(['xx_id'=>['in',json_decode($row['xianxian_content'],true)]])->column('xx_name');
+            $row['xianxian_content_name'] = !empty($xianxian) ? implode(',',$xianxian) :'不存在或未选择';
+        }
+        if($row['yuanyin_socre']>0 && empty($row['yuanyin_content']))
+        {
+            $row['yuanyin_content_name'] = '未选择';
+        }else{
+            $yuanyin = Report::where(['yy_id'=>['in',json_decode($row['yuanyin_content'],true)]])->column('yy_name');
+            $row['yuanyin_content_name'] = !empty($yuanyin) ? implode(',',$yuanyin) :'不存在或未选择';
+        }
+
+        if($row['buwei_score']>0 &&empty($row['buwei_content']))
+        {
+            $row['buwei_content_name'] = '未选择';
+        }else{
+            $buwei = Report::where(['bw_id'=>['in',json_decode($row['buwei_content'],true)]])->column('bw_name');
+            $row['buwei_content_name'] = !empty($buwei) ? implode(',',$buwei) :'不存在或未选择';
+        }
+        if($row['fangfa_score']>0 && empty($row['fangfa_content']))
+        {
+            $row['fangfa_content_name'] = '未选择';
+        }else{
+            $fangfa = Report::where(['pc_id'=>['in',json_decode($row['fangfa_content'],true)]])->column('pc_name');
+            $row['fangfa_content_name'] = !empty($fangfa) ? implode(',',$fangfa) :'不存在或未选择';
+        }
+
+
         $this->view->assign('row', $row);
         return $this->view->fetch();
     }

+ 1 - 1
application/admin/library/Auth.php

@@ -66,7 +66,7 @@ class Auth extends \fast\Auth
         //学员,追加 对应的IP和 座号
         if(!empty($admin->depart_id)){
             // 获取服务器自己的IP地址
-            $server_ip = gethostbyname('localhost');
+            $server_ip = '192.168.1.101';//gethostbyname('localhost');
             $admin->server_ip = $server_ip;
             $seat_id = Db::name('seat')->where('seat_bind_ip',$server_ip)->value('seat_id');
             if(!empty($seat_id)){

+ 2 - 2
application/admin/view/common/header.html

@@ -37,8 +37,8 @@
                         <li><a href="javascript:;" data-type="all"><i class="fa fa-trash fa-fw"></i> {:__('Wipe all cache')}</a></li>
                         <li class="divider"></li>
                         <li><a href="javascript:;" data-type="content"><i class="fa fa-file-text fa-fw"></i> {:__('Wipe content cache')}</a></li>
-                        <li><a href="javascript:;" data-type="template"><i class="fa fa-file-image-o fa-fw"></i> {:__('Wipe template cache')}</a></li>
-                        <li><a href="javascript:;" data-type="addons"><i class="fa fa-rocket fa-fw"></i> {:__('Wipe addons cache')}</a></li>
+<!--                        <li><a href="javascript:;" data-type="template"><i class="fa fa-file-image-o fa-fw"></i> {:__('Wipe template cache')}</a></li>-->
+<!--                        <li><a href="javascript:;" data-type="addons"><i class="fa fa-rocket fa-fw"></i> {:__('Wipe addons cache')}</a></li>-->
                         <li><a href="javascript:;" data-type="browser"><i class="fa fa-chrome fa-fw"></i> {:__('Wipe browser cache')}
                             <span data-toggle="tooltip" data-title="{:__('Wipe browser cache tips')}"><i class="fa fa-info-circle"></i></span>
                         </a></li>

+ 4 - 2
application/admin/view/student/collection/examing.html

@@ -123,14 +123,15 @@
                                         <dd style="margin-right: 87%">
                                             <a href="javascript:;" class="btn btn-sm btn-info btn-append"><i class="fa fa-plus"></i> 追加</a>
                                         </dd>
+                                        <!--hide-->
                                         <textarea name="row[other_replace]" class="form-control hide other_replace" cols="30" rows="5">{$row.other_replace}</textarea>
                                     </dl>
                                     <!--定义模板,模板语法使用Art-Template模板语法-->
                                     <script type="text/html" id="other_suppliertpl">
                                         <dd class="form-inline">
                                             <select class="form-control" name="unwin[<%=index%>][fault_id]" style="width: 550px;">
-                                                {foreach name="departmentdata" item="vo"}
                                                 <option value="" >请选择</option>
+                                                {foreach name="departmentdata" item="vo"}
                                                 <option value="{$vo.fault_id}" <%if(row.fault_id =='{$vo.fault_id}'){%> selected <% }%> >{$vo.replace_name}</option>
                                                 {/foreach}
                                             </select>
@@ -156,7 +157,8 @@
                                         <dd style="margin-right: 87%">
                                             <a href="javascript:;" class="btn btn-sm btn-info btn-append"><i class="fa fa-plus"></i> 追加</a>
                                         </dd>
-                                        <textarea name="row[other_report]" class="form-control hide" cols="30" rows="5">{$row.other_report}</textarea>
+                                        <!--hide-->
+                                        <textarea name="row[other_report]" class="form-control hide other_report" cols="30" rows="5">{$row.other_report}</textarea>
                                     </dl>
                                     <!--定义模板,模板语法使用Art-Template模板语法-->
                                     <script type="text/html" id="other_suppliertpl1">

+ 6 - 6
application/admin/view/teacher/exams/edit.html

@@ -62,8 +62,8 @@
                     <thead>
                     <tr style="height: 3.5rem">
                         <td style="width: 40%">评分标准</td>
-                        <td style="width: 20%">扣分</td>
-                        <td style="width: 40%">题目</td>
+                        <td style="width: 10%">扣分</td>
+                        <td style="width: 50%">题目</td>
                     </tr>
                     </thead>
                     <tbody class="task_list">
@@ -91,22 +91,22 @@
                     <tr>
                         <td>故障现象少写或错写1条扣1分</td>
                         <td><input type="text" name="row[xianxian_score]" value="{$row.xianxian_score|htmlentities}"></td>
-                        <td></td>
+                        <td>{$row.xianxian_content_name|htmlentities}</td>
                     </tr>
                     <tr>
                         <td>可能原因少写或错写1条扣1分</td>
                         <td><input type="text" name="row[yuanyin_socre]" value="{$row.yuanyin_socre|htmlentities}"></td>
-                        <td></td>
+                        <td>{$row.yuanyin_content_name|htmlentities}</td>
                     </tr>
                     <tr>
                         <td>故障部位少写或错写1条扣1分</td>
                         <td><input type="text" name="row[buwei_score]" value="{$row.buwei_score|htmlentities}"></td>
-                        <td></td>
+                        <td>{$row.buwei_content_name|htmlentities}</td>
                     </tr>
                     <tr>
                         <td>排除方法少写或错写1条扣1分</td>
                         <td><input type="text" name="row[fangfa_score]" value="{$row.fangfa_score|htmlentities}"></td>
-                        <td></td>
+                        <td>{$row.fangfa_content_name|htmlentities}</td>
                     </tr>
 <!--                    <tr>-->
 <!--                        <td>修复结论错扣2分</td><td><input type="text" name="row[jielun_score]" value="{$row.jielun_score|htmlentities}"></td>-->

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

@@ -30,11 +30,11 @@
             <tbody>
             <tr class="">
                 <td style="width: 10%">平均成绩</td>
-                <td class="pingfen_total"></td>
+                <td class="pingfen_total text-success"></td>
                 <td style="width: 10%">最高成绩</td>
-                <td class="max_total"></td>
+                <td class="max_total text-danger"></td>
                 <td style="width: 10%">最低成绩</td>
-                <td class="min_total"></td>
+                <td class="min_total text-warning"></td>
             </tr>
             </tbody>
         </table>
@@ -43,7 +43,7 @@
         <table style="width: 33%;float: left" class="table table-striped table-bordered table-hover table-nowrap panel-success">
             <thead>
             <tr style="text-align: center">
-                <td colspan="2">模拟器A</td>
+                <td colspan="2">FZD04B型侦毒器</td>
             </tr>
             <tr style="text-align: center">
                 <td>故障名称</td>
@@ -54,24 +54,24 @@
 
             </tbody>
         </table>
-        <table style="width: 33%;float: left" class="table table-striped table-bordered table-hover table-nowrap panel-success">
+        <table style="width: 33%;float: left;background-color: #e1e1c3" class="table table-striped table-bordered table-hover table-nowrap panel-success">
             <thead>
             <tr style="text-align: center">
-                <td colspan="2">模拟器B</td>
+                <td colspan="2">FZB006型毒剂报警器</td>
             </tr>
             <tr style="text-align: center">
                 <td>故障名称</td>
                 <td>错误率</td>
             </tr>
             </thead>
-            <tbody class="tbodytwo">
+            <tbody class="tbodytwo" style="background-color: #e1e1c3;">
 
             </tbody>
         </table>
-        <table style="width: 33%" class="table table-striped table-bordered table-hover table-nowrap panel-success">
+        <table style="width: 33%;" class="table table-striped table-bordered table-hover table-nowrap panel-success">
             <thead>
             <tr style="text-align: center">
-                <td colspan="2">模拟器C</td>
+                <td colspan="2">防化兵用毒剂报警器</td>
             </tr>
             <tr style="text-align: center">
                 <td>故障名称</td>

+ 11 - 11
application/admin/view/teacher/exams/view.html

@@ -59,9 +59,9 @@
                     <tr>
                         <td style="width:5%">序号</td>
                         <td style="width:25%">评分标准</td>
-                        <td style="width:20%">扣分</td>
-                        <td style="width:20%">维修情况</td>
-                        <td style="width:25%">题目</td>
+                        <td style="width:10%">扣分</td>
+                        <td style="width:10%">维修情况</td>
+                        <td style="width:45%">题目</td>
                     </tr>
                     <tr>
                         <td colspan="5" style="text-align: left;padding-left: 1%">一.故障排除(75分)</td>
@@ -90,9 +90,9 @@
                     <tr>
                         <td style="width:5%">序号</td>
                         <td style="width:25%">评分标准</td>
-                        <td style="width:20%">扣分</td>
-                        <td style="width:20%">报告情况</td>
-                        <td style="width:25%">扣分原因</td>
+                        <td style="width:10%">扣分</td>
+                        <td style="width:10%">报告情况</td>
+                        <td style="width:45%">扣分原因</td>
                     </tr>
                     <tr>
                         <td colspan="5" style="text-align: left;padding-left: 1%">二.修理报告表(15分)</td>
@@ -102,28 +102,28 @@
                         <td>故障现象少写或错写1条扣1分</td>
                         <td>{$row.xianxian_score|htmlentities}</td>
                         <td>{if $row.xianxian_score eq 0 }<span class="text-success">已排除</span> {else} <span class="text-danger">未排除</span>{/if}</td>
-                        <td></td>
+                        <td>{$row.xianxian_content_name|htmlentities}</td>
                     </tr>
                     <tr>
                         <td>2</td>
                         <td>可能原因少写或错写1条扣1分</td>
                         <td>{$row.yuanyin_socre|htmlentities}</td>
                         <td>{if $row.yuanyin_socre eq 0 }<span class="text-success">已排除</span> {else} <span class="text-danger">未排除</span>{/if}</td>
-                        <td></td>
+                        <td>{$row.yuanyin_content_name|htmlentities}</td>
                     </tr>
                     <tr>
                         <td>3</td>
                         <td>故障部位少写或错写1条扣1分</td>
                         <td>{$row.buwei_score|htmlentities}</td>
                         <td>{if $row.buwei_score eq 0 }<span class="text-success">已排除</span> {else} <span class="text-danger">未排除</span>{/if}</td>
-                        <td></td>
+                        <td>{$row.buwei_content_name|htmlentities}</td>
                     </tr>
                     <tr>
                         <td>4</td>
                         <td>排除方法少写或错写1条扣1分</td>
                         <td>{$row.fangfa_score|htmlentities}</td>
                         <td>{if $row.fangfa_score eq 0 }<span class="text-success">已排除</span> {else} <span class="text-danger">未排除</span>{/if}</td>
-                        <td></td>
+                        <td>{$row.fangfa_content_name|htmlentities}</td>
                     </tr>
 <!--                    <tr>-->
 <!--                        <td>5</td>-->
@@ -144,7 +144,7 @@
 <!--                    </tr>-->
                     <tr>
                         <td colspan="2">五.成绩</td>
-                        <td colspan="2">{$row.total|htmlentities}</td>
+                        <td colspan="3">{$row.total|htmlentities}</td>
                     </tr>
                 </table>
             </div>

+ 1 - 1
application/config.php

@@ -215,7 +215,7 @@ return [
         // cookie 名称前缀
         'prefix'    => '',
         // cookie 保存时间
-        'expire'    => 0,
+        'expire'    => 30*24*3600,
         // cookie 保存路径
         'path'      => '/',
         // cookie 有效域名

+ 1 - 0
application/extra/site.php

@@ -46,4 +46,5 @@ return array (
   'sim_sim_state' => '',
   'sim_repair' => '',
   'sim_exam_status' => '',
+  'url_type' => 'http://qdhome.iot321.top:33102',
 );

+ 24 - 3
public/assets/js/backend/student/collection.js

@@ -92,7 +92,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             $(document).ready(function() {
                 var countdownTime = Config.timer; // 倒计时时间,单位为秒
                 var display = $('#timer');
-
+                var fenzhong = 0;
                 var timer = setInterval(function() {
                     var minutes = parseInt(countdownTime / 60, 10);
                     var seconds = parseInt(countdownTime % 60, 10);
@@ -102,11 +102,31 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
                     display.text(minutes + "分" + seconds+'秒');
 
+                    // console.log(minutes.replace("0-",''));
+                    // console.log(parseInt(minutes.replace("0-",'')));
                     if (--countdownTime < 0) {
-                        clearInterval(timer);
-                        display.text("时间到!");
+                        // clearInterval(timer);
+                        $(".djs").html('已到考试结束时间,10分钟内系统自动交卷。')
+                        // display.text("时间到!");
+                    }
+                    if(minutes<1){
+                        fenzhong = parseInt(minutes.replace("0-",''));
+                        console.log(fenzhong);
+                        if(fenzhong==7){
+                            $('#update-form').submit();
+                            clearInterval(timer);
+                        }
                     }
+
                 }, 1000);
+
+                //五秒刷新,同步更换件列表数据
+                // if(Config.isloading==1 && countdownTime>0){
+                //     setInterval(function() {
+                //         window.location.reload();
+                //     }, 30000);
+                // }
+
             });
 
             $(document).on('click', '.btn-replace', function () {
@@ -116,6 +136,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     type: 'post',
                     data: {
                         other_replace: $(".other_replace").val(),
+                        other_report: $(".other_report").val(),
                     },
                     success: function (data) {
                         if(data.code==1){