贾小兵 2 месяцев назад
Родитель
Сommit
61b03bb76a

+ 17 - 7
application/admin/controller/student/Collection.php

@@ -200,6 +200,7 @@ class Collection extends Backend
             $other_content = [];
             $content = [];
 
+
             Db::startTrans();
             try {
                 if(!empty($params['other_report'])){
@@ -253,19 +254,26 @@ class Collection extends Backend
 
                 $info = $this->exam_model->where(['exam_id'=>$ids])->find();
 
+                //特殊判断结果 故障部位
+                // 002型  薄膜开关FPC排线 蜂鸣器出声口 检测剂 干燥管 维护管
+                // 003型  检测剂  干燥管 维护管
+                $question_arr = ['0002GZBW0001','0002GZBW0003','0002GZBW0005','0002GZBW0009','0002GZBW0010','0003GZBW0006','0003GZBW0007','0003GZBW0008'];
                 //更新故障是否正确
                 $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 = 2;
-                        if(!empty($t['sim_fault_question_value']) && !empty($t['sim_fault_answer_value'])){
-                            if($t['sim_fault_question_value']!=$t['sim_fault_answer_value'] ){
-                                //真实故障id 0002GZBW0001 薄膜开关FPC排线
-                                if($t['sim_fault_answer_value']=='00000000' && $t['fault_id'] !='0002GZBW0001'){
-                                    $answer_right=2;
-                                }
+                        //真实故障id 故障部位在  特殊故障部位里面
+                        if(in_array($t['fault_id'],$question_arr)){
+                            if(substr($t['sim_fault_answer_value'], -1,1)==0){
                                 $answer_right=1;
                             }
+                        }else{
+                            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;
+                                }
+                            }
                         }
                         Db::name('real_exam_fault')->where(['ref_id'=>$t['ref_id']])->update(['answer_right'=>$answer_right]);
                     }
@@ -489,7 +497,9 @@ class Collection extends Backend
                 }
 
                 //是否超时
-                $overtime_fen = intval((time()-$info['countdown_time']) / 60);
+                //$info['countdown_time'] 开始时间+考试时长+10分倒计时
+                $countdown_time= strtotime(date('Y-m-d H:i:s', strtotime('-10 minute',$info['countdown_time'])));
+                $overtime_fen = intval((time()-$countdown_time) / 60);
                 if($overtime_fen>=10){
                     $overtime_score = 10;
                 }else if($overtime_fen>0 && $overtime_fen<10){

+ 6 - 0
application/admin/controller/student/Exam.php

@@ -76,6 +76,12 @@ class Exam extends Backend
         $other_jielun = !empty($row['other_jielun']) ? json_decode($row['other_jielun'],true):[];
 
         $this->view->assign('other_jielun', $other_jielun);
+
+
+        $diffInSeconds = $rows['endtime'] - $rows['starttime']; // 两个时间戳之间的差异(秒)
+        $minutes = floor($diffInSeconds / 60); // 计算分钟数
+        $seconds = $diffInSeconds % 60; // 计算剩余的秒数
+        $row['shijian'] = $minutes.'分'.$seconds.'秒';
         $this->view->assign('row', $row);
         return $this->view->fetch();
     }

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

@@ -95,11 +95,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_key1 = rand(0, 1);
-                    // $fault_key2 = rand(2, 3);
-                    // $fault_key3 = rand(4, 5);
-                    $fault_key = [1,3,5];
+                    if($params['sim_type']=='0002'){
+                        $fault_key = [1,4,10];
+                    }else{
+                        $fault_key = [1,3,5];
+                    }
                     $flag = 0;
                     if(!empty($fault_key) && in_array($key,$fault_key)){
                         $flag = 1;
@@ -246,19 +246,26 @@ class Exercise extends Backend
                 $info = $this->exam_model->where(['exam_id'=>$ids])->find();
 
 
+                //特殊判断结果 故障部位
+                // 002型  薄膜开关FPC排线 蜂鸣器出声口 检测剂 干燥管 维护管
+                // 003型  检测剂  干燥管 维护管
+                $question_arr = ['0002GZBW0001','0002GZBW0003','0002GZBW0005','0002GZBW0009','0002GZBW0010','0003GZBW0006','0003GZBW0007','0003GZBW0008'];
                 //更新故障是否正确
                 $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 = 2;
-                        if(!empty($t['sim_fault_question_value']) && !empty($t['sim_fault_answer_value'])){
-                            if($t['sim_fault_question_value']!=$t['sim_fault_answer_value'] ){
-                                //真实故障id 0002GZBW0001 薄膜开关FPC排线
-                                if($t['sim_fault_answer_value']=='00000000' && $t['fault_id'] !='0002GZBW0001'){
-                                    $answer_right=2;
-                                }
+                        //真实故障id 故障部位在  特殊故障部位里面
+                        if(in_array($t['fault_id'],$question_arr)){
+                            if(substr($t['sim_fault_answer_value'], -1,1)==0){
                                 $answer_right=1;
                             }
+                        }else{
+                            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;
+                                }
+                            }
                         }
                         Db::name('real_exam_fault')->where(['ref_id'=>$t['ref_id']])->update(['answer_right'=>$answer_right]);
                     }
@@ -480,7 +487,9 @@ class Exercise extends Backend
                 }
 
                 //是否超时
-                $overtime_fen = intval((time()-$info['countdown_time']) / 60);
+                //$info['countdown_time'] 开始时间+考试时长+10分倒计时
+                $countdown_time= strtotime(date('Y-m-d H:i:s', strtotime('-10 minute',$info['countdown_time'])));
+                $overtime_fen = intval((time()-$countdown_time) / 60);
                 if($overtime_fen>=10){
                     $overtime_score = 10;
                 }else if($overtime_fen>0 && $overtime_fen<10){
@@ -596,6 +605,10 @@ class Exercise extends Backend
 
         $row['weixiu_score'] = 10-$row['overtime_score']??0; 
 
+        $diffInSeconds = $rows['endtime'] - $rows['starttime']; // 两个时间戳之间的差异(秒)
+        $minutes = floor($diffInSeconds / 60); // 计算分钟数
+        $seconds = $diffInSeconds % 60; // 计算剩余的秒数
+        $row['shijian'] = $minutes.'分'.$seconds.'秒';
         
         $other_jielun = !empty($row['other_jielun']) ? json_decode($row['other_jielun'],true):[];
         $this->view->assign('other_jielun', $other_jielun);

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

@@ -129,16 +129,6 @@ class Practice extends Backend
             echo "<script>location.href='/admin/student/practice/examing/ids/".$info['exam_id']."'</script>";
             die();
         }
-//        if ($this->request->isPost()) {
-//            $exam_collection_id = $this->request->post('exam_collection_id');
-//            if(empty($info->starttime)){
-//                $info->start_time = date('Y-m-d H:i:s');
-//                $info->starttime = time();
-//            }
-//            $info->exam_status = 4;
-//            $info->save();
-//            $this->success('开始成功','/admin/student/practice/examing/ids/'.$info['exam_id']);
-//        }
         $this->assignConfig('exam_id', $info['exam_id']);
         $this->assignConfig('url_type', config('site.url_type'));
         $this->assignConfig('is_fault', Env::get('app.is_fault'));
@@ -249,19 +239,26 @@ class Practice extends Backend
 
                 $info = $this->exam_model->where(['exam_id'=>$ids])->find();
 
+                //特殊判断结果 故障部位
+                // 002型  薄膜开关FPC排线 蜂鸣器出声口 检测剂 干燥管 维护管
+                // 003型  检测剂  干燥管 维护管
+                $question_arr = ['0002GZBW0001','0002GZBW0003','0002GZBW0005','0002GZBW0009','0002GZBW0010','0003GZBW0006','0003GZBW0007','0003GZBW0008'];
                 //更新故障是否正确
                 $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 = 2;
-                        if(!empty($t['sim_fault_question_value']) && !empty($t['sim_fault_answer_value'])){
-                            if($t['sim_fault_question_value']!=$t['sim_fault_answer_value'] ){
-                                //真实故障id 0002GZBW0001 薄膜开关FPC排线
-                                if($t['sim_fault_answer_value']=='00000000' && $t['fault_id'] !='0002GZBW0001'){
-                                    $answer_right=2;
-                                }
+                        //真实故障id 故障部位在  特殊故障部位里面
+                        if(in_array($t['fault_id'],$question_arr)){
+                            if(substr($t['sim_fault_answer_value'], -1,1)==0){
                                 $answer_right=1;
                             }
+                        }else{
+                            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;
+                                }
+                            }
                         }
                         Db::name('real_exam_fault')->where(['ref_id'=>$t['ref_id']])->update(['answer_right'=>$answer_right]);
                     }
@@ -486,7 +483,9 @@ class Practice extends Backend
                 }
 
                 //是否超时
-                $overtime_fen = intval((time()-$info['countdown_time']) / 60);
+                //$info['countdown_time'] 开始时间+考试时长+10分倒计时
+                $countdown_time= strtotime(date('Y-m-d H:i:s', strtotime('-10 minute',$info['countdown_time'])));
+                $overtime_fen = intval((time()-$countdown_time) / 60);
                 if($overtime_fen>=10){
                     $overtime_score = 10;
                 }else if($overtime_fen>0 && $overtime_fen<10){
@@ -615,6 +614,11 @@ class Practice extends Backend
         $other_jielun = !empty($row['other_jielun']) ? json_decode($row['other_jielun'],true):[];
         $this->view->assign('other_jielun', $other_jielun);
 
+        $diffInSeconds = $rows['endtime'] - $rows['starttime']; // 两个时间戳之间的差异(秒)
+        $minutes = floor($diffInSeconds / 60); // 计算分钟数
+        $seconds = $diffInSeconds % 60; // 计算剩余的秒数
+        $row['shijian'] = $minutes.'分'.$seconds.'秒';
+        
         $this->view->assign('row', $row);
         return $this->view->fetch();
     }

+ 18 - 6
application/admin/controller/teacher/Collection.php

@@ -110,9 +110,15 @@ 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){ //系统随机
                     // $fault_key = $this->rand_fault($fault_list);
-                    $fault_key1 = rand(0, 1);
-                    $fault_key2 = rand(2, 3);
-                    $fault_key3 = rand(4, 5);
+                    if($params['sim_type']=='0002'){
+                        $fault_key1 = 1;
+                        $fault_key2 = 4;
+                        $fault_key3 = rand(6,9,10,11);
+                    }else{
+                        $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'];
@@ -231,9 +237,15 @@ 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){ //系统随机
                         // $fault_key = $this->rand_fault($fault_list);
-                        $fault_key1 = rand(0, 1);
-                        $fault_key2 = rand(2, 3);
-                        $fault_key3 = rand(4, 5);
+                        if($params['sim_type']=='0002'){
+                            $fault_key1 = 1;
+                            $fault_key2 = 4;
+                            $fault_key3 = rand(6,9,10,11);
+                        }else{
+                            $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'];

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

@@ -151,6 +151,11 @@ class Exams extends Backend
 
         $other_jielun = !empty($row['other_jielun']) ? json_decode($row['other_jielun'],true):[];
 
+        $diffInSeconds = $rows['endtime'] - $rows['starttime']; // 两个时间戳之间的差异(秒)
+        $minutes = floor($diffInSeconds / 60); // 计算分钟数
+        $seconds = $diffInSeconds % 60; // 计算剩余的秒数
+        $row['shijian'] = $minutes.'分'.$seconds.'秒';
+        
         if (false === $this->request->isPost()) {
             $this->view->assign('other_jielun', $other_jielun);
             $this->view->assign('row', $row);
@@ -212,6 +217,11 @@ class Exams extends Backend
         $other_jielun = !empty($row['other_jielun']) ? json_decode($row['other_jielun'],true):[];
         $this->view->assign('other_jielun', $other_jielun);
         
+        $diffInSeconds = $rows['endtime'] - $rows['starttime']; // 两个时间戳之间的差异(秒)
+        $minutes = floor($diffInSeconds / 60); // 计算分钟数
+        $seconds = $diffInSeconds % 60; // 计算剩余的秒数
+        $row['shijian'] = $minutes.'分'.$seconds.'秒';
+
         $this->view->assign('row', $row);
         return $this->view->fetch();
     }

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

@@ -115,12 +115,16 @@ 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);
+                    if($params['sim_type']=='0002'){
+                        $fault_key1 = 1;
+                        $fault_key2 = 4;
+                        $fault_key3 = rand(6,9,10,11);
+                    }else{
+                        $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);
                 }else if($params['question_setting_method']==2){//教师自选
                     $question_ids = $params['question_ids'];
                 }else if($params['question_setting_method']==3){ //任务自选
@@ -233,12 +237,16 @@ 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);
+                        if($params['sim_type']=='0002'){
+                            $fault_key1 = 1;
+                            $fault_key2 = 4;
+                            $fault_key3 = rand(6,9,10,11);
+                        }else{
+                            $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);
                     }else if($params['question_setting_method']==2){//教师自选
                         $question_ids = $params['question_ids'];
                     }else if($params['question_setting_method']==3){ //任务自选

+ 2 - 1
application/admin/view/student/exam/view.html

@@ -166,7 +166,8 @@
                     </tr>
                     <tr>
                         <td colspan="2">按没超过1分钟扣1分的比例扣分</td>
-                        <td colspan="3">{$row.overtime_score|htmlentities}</td>
+                        <td colspan="2"><span class="text-danger">考试时长:{$row.shijian|htmlentities}</span></td>
+                        <td colspan="1">扣分:{$row.overtime_score|htmlentities}</td>
                     </tr>
                     <tr>
                         <td colspan="2">五.成绩</td>

+ 4 - 1
application/admin/view/student/exercise/analysis.html

@@ -130,7 +130,9 @@
                             <td>
                                 {if !empty($vo2.cx_name)}
                                 {volist name="vo2.cx_name" id="vo22"}
+                                    {if $vo2.gzxz_id eq $vo22.gzxz_id}
                                     <span class="text-danger">{$vo22.cx_type}:{$vo22.cx_name}</span><br/>
+                                    {/if}
                                 {/volist}
                                 <span class="text-danger">{$vo2.cx_type}</span><br/>
                                 {else}
@@ -152,7 +154,8 @@
                         </tr>
                         <tr>
                             <td colspan="2">按没超过1分钟扣1分的比例扣分</td>
-                            <td colspan="3">{$row.overtime_score|htmlentities}</td>
+                            <td colspan="2"><span class="text-danger">考试时长:{$row.shijian|htmlentities}</span></td>
+                            <td colspan="1">扣分:{$row.overtime_score|htmlentities}</td>
                         </tr>
                         <tr>
                             <td colspan="2">五.成绩</td>

+ 3 - 3
application/admin/view/student/exercise/examing.html

@@ -94,7 +94,7 @@
                 <form id="update-form" role="form" data-toggle="validator" method="POST" action="">
                     {:token()}
                     <div class="panel-heading">
-                        <div class="readme">正在练习中,考试时间 50 分钟</div>
+                        <div class="readme">正在练习中,考试时间 {$row.limit_duration|htmlentities} 分钟</div>
                         <div class="djs">距离练习结束还有 <span id="timer"></span> </div>
                     </div>
                     <div class="box-body box-profile">
@@ -115,10 +115,10 @@
                                     <!--定义模板,模板语法使用Art-Template模板语法-->
                                     <script type="text/html" id="other_suppliertpl">
                                         <dd class="form-inline">
-                                            <select class="form-control" name="unwin[<%=index%>][name]" style="width: 600px;">
+                                            <select class="form-control" name="unwin[<%=index%>][fault_id]" style="width: 600px;">
                                                 <option value="" >请选择</option>
                                                 {foreach name="departmentdata" item="vo"}
-                                                <option value="{$vo.fault_id}" >{$vo.name}</option>
+                                                <option value="{$vo.fault_id}" <%if(row.fault_id =='{$vo.fault_id}'){%> selected <% }%> >{$vo.replace_name}</option>
                                                 {/foreach}
                                             </select>
                                             <input type="text" class="form-control" readonly name="unwin[<%=index%>][request_status]" value="<%if(row["request_status"]==1){%>已申请<%}else if(row["request_status"]==2){ %>已送达<%}else if(row["request_status"]==3){%>驳回<%}else{%>未申请<%}%>" style="width: 430px;">

+ 4 - 1
application/admin/view/student/practice/analysis.html

@@ -130,7 +130,9 @@
                             <td>
                                 {if !empty($vo2.cx_name)}
                                 {volist name="vo2.cx_name" id="vo22"}
+                                    {if $vo2.gzxz_id eq $vo22.gzxz_id}
                                     <span class="text-danger">{$vo22.cx_type}:{$vo22.cx_name}</span><br/>
+                                    {/if}
                                 {/volist}
                                 <span class="text-danger">{$vo2.cx_type}</span><br/>
                                 {else}
@@ -152,7 +154,8 @@
                         </tr>
                         <tr>
                             <td colspan="2">按没超过1分钟扣1分的比例扣分</td>
-                            <td colspan="3">{$row.overtime_score|htmlentities}</td>
+                            <td colspan="2"><span class="text-danger">考试时长:{$row.shijian|htmlentities}</span></td>
+                            <td colspan="1">扣分:{$row.overtime_score|htmlentities}</td>
                         </tr>
                         <tr>
                             <td colspan="2">五.成绩</td>

+ 1 - 1
application/admin/view/student/practice/examing.html

@@ -91,7 +91,7 @@
         <div class="box box-primary">
             <div class="panel-body">
                 <div class="panel-heading">
-                    <div class="readme">正在练习中,考试时间 {$row.limit_duration} 分钟</div>
+                    <div class="readme">正在练习中,练习时间 {$row.limit_duration} 分钟</div>
                     <div class="djs">距离练习结束还有 <span id="timer"></span> </div>
                 </div>
                 <div class="box-body box-profile">

+ 3 - 2
application/admin/view/teacher/exams/edit.html

@@ -159,8 +159,9 @@
                         <td colspan="3">三.维修时间(10分)</td>
                     </tr>
                     <tr>
-                        <td>按每超过1分钟扣1分的比例扣分</td>
-                        <td colspan="2"><input type="text" name="row[overtime_score]" value="{$row.overtime_score|htmlentities}"></td>
+                        <td colspan="1">按没超过1分钟扣1分的比例扣分</td>
+                        <td colspan="1"><span class="text-danger">考试时长:{$row.shijian|htmlentities}</span></td>
+                        <td colspan="1">扣分:<input type="text" name="row[overtime_score]" value="{$row.overtime_score|htmlentities}"></td>
                     </tr>
                     <tr>
                         <td colspan="3" style="height: 3.5rem">总得分:{$row.total|htmlentities}</td>

+ 2 - 1
application/admin/view/teacher/exams/view.html

@@ -165,7 +165,8 @@
                     </tr>
                     <tr>
                         <td colspan="2">按没超过1分钟扣1分的比例扣分</td>
-                        <td colspan="3">{$row.overtime_score|htmlentities}</td>
+                        <td colspan="2"><span class="text-danger">考试时长:{$row.shijian|htmlentities}</span></td>
+                        <td colspan="1">扣分:{$row.overtime_score|htmlentities}</td>
                     </tr>
                     <tr>
                         <td colspan="2">五.成绩</td>

+ 22 - 31
public/assets/js/backend/student/collection.js

@@ -100,6 +100,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             });
         },
         examing: function () {
+            var dingshi = '';
             $(document).ready(function() {
                 var countdownTime = Config.timer; // 倒计时时间,单位为秒
                 var countdownTime1 = 600; // 10分钟倒计时时间,单位为秒
@@ -133,39 +134,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                 }
                             }
                         });
-                        // setTimeout(function() {
-                        //     var minutes1 = parseInt(countdownTime1 / 60, 10);
-                        //     var seconds1 = parseInt(countdownTime1 % 60, 10);
-                        //     $(".djs").html('已经超时,'+minutes1 + "分" + seconds1 +'秒后系统自动交卷。');
-                        //     if (--countdownTime1>0) {
-                        //         var minutes2 = parseInt(countdownTime1 / 60, 10);
-                        //         var seconds2 = parseInt(countdownTime1 % 60, 10);
-                        //         $(".djs").html('已经超时,'+minutes2 + "分" + seconds2 +'秒后系统自动交卷。');
-                        //         console.log(minutes2+'@@@@'+seconds2);
-                        //         if(minutes2==0 && seconds2==1){
-                        //             $('#update-form').submit();
-                        //             clearInterval(timer);
-                        //         }
-                        //     }
-                        // }, 1000); // 第二个定时器2秒后执行
                     }
-                    // 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() {
+                if(Config.isloading==1 && countdownTime>0){
+                    dingshi = setInterval(function() {
                         window.location.reload();
-                     }, 30000);
-                 }
-
+                    }, 30000);//30000
+                }
             });
 
             $(document).on('click', '.btn-replace', function () {
@@ -200,19 +177,31 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
             //追加记录
             $(document).on('click', '.btn-addlog', function () {
+                clearTimeout(dingshi);
                 var ids = Config.ids;
                 var other_report_count = Config.other_report_count;
                 if(other_report_count==3){
                     Layer.alert('维修报告最多允许增加三条');
                     return false;
                 }
-                Fast.api.open('student/collection/addreport/ids/'+ids, __("维修报告"), {area: ["95%", "85%"], maxmin: true, moveOut: false});
+                Fast.api.open('student/collection/addreport/ids/'+ids, __("维修报告"), {
+                    area: ["95%", "85%"],
+                    callback:function(value){
+                        console.log(value+'@@@@');
+                    }
+                });
             });
             //编辑记录
             $(document).on('click', '.btnedit', function () {
+                clearTimeout(dingshi);
                 var ids = Config.ids;
                 var xh_id = $(this).attr('xh_id');
-                Fast.api.open('student/collection/editreport/ids/'+ids+'/xh_id/'+xh_id, __("维修报告"), {area: ["95%", "85%"], maxmin: true, moveOut: false});
+                Fast.api.open('student/collection/editreport/ids/'+ids+'/xh_id/'+xh_id, __("维修报告"), {
+                    area: ["95%", "85%"],
+                    callback:function(value){
+                        console.log(value+'@@@@');
+                    } 
+                });
             });
             //移除记录
             $(document).on('click', '.btnmove', function () {
@@ -239,7 +228,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 );
 
             });
-
+            $(document).on('click', '.layui-layer-close1', function () {
+                window.location.reload();
+            });
 
             $(document).on("fa.event.appendfieldlist", "#second-fieldlist .btn-append", function (e, obj) {
                 //绑定动态下拉组件

+ 21 - 22
public/assets/js/backend/student/exercise.js

@@ -9,6 +9,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             });
         },
         examing: function () {
+            var dingshi = '';
             $(document).ready(function() {
                 var countdownTime = Config.timer; // 倒计时时间,单位为秒
                 var display = $('#timer');
@@ -41,30 +42,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                 }
                             }
                         });
-                        // $(".djs").html('已经超时,10分钟00秒后系统自动交卷。');
-                        // setTimeout(function() {
-                        //     var minutes1 = parseInt(countdownTime1 / 60, 10);
-                        //     var seconds1 = parseInt(countdownTime1 % 60, 10);
-                        //     $(".djs").html('已经超时,'+minutes1 + "分" + seconds1 +'秒后系统自动交卷。');
-                        //     if (--countdownTime1>0) {
-                        //         var minutes2 = parseInt(countdownTime1 / 60, 10);
-                        //         var seconds2 = parseInt(countdownTime1 % 60, 10);
-                        //         $(".djs").html('已经超时,'+minutes2 + "分" + seconds2 +'秒后系统自动交卷。');
-                        //         console.log(minutes2+'@@@@'+seconds2);
-                        //         if(minutes2==0 && seconds2==1){
-                        //             $('#update-form').submit();
-                        //             clearInterval(timer);
-                        //         }
-                        //     }
-                        // }, 1000); // 第二个定时器2秒后执行
                     }
                 }, 1000);
 
                 //五秒刷新,同步更换件列表数据
                 if(Config.isloading==1 && countdownTime>0){
-                    setInterval(function() {
+                    dingshi = setInterval(function() {
                         window.location.reload();
-                    }, 30000);
+                    }, 2000);
                 }
             });
 
@@ -94,19 +79,30 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
             //追加记录
             $(document).on('click', '.btn-addlog', function () {
+                clearTimeout(dingshi);
                 var ids = Config.ids;
                 var other_report_count = Config.other_report_count;
                 if(other_report_count==3){
                     Layer.alert('维修报告最多允许增加三条');
                     return false;
                 }
-                Fast.api.open('student/collection/addreport/ids/'+ids, __("维修报告"), {area: ["95%", "85%"], maxmin: true, moveOut: false});
+                Fast.api.open('student/collection/addreport/ids/'+ids, __("维修报告"), {
+                    area: ["95%", "85%"], 
+                    callback:function(value){
+                        console.log(value+'@@@@');
+                    }
+                });
             });
             //编辑记录
             $(document).on('click', '.btnedit', function () {
+                clearTimeout(dingshi);
                 var ids = Config.ids;
                 var xh_id = $(this).attr('xh_id');
-                Fast.api.open('student/collection/editreport/ids/'+ids+'/xh_id/'+xh_id, __("维修报告"), {area: ["95%", "85%"], maxmin: true, moveOut: false});
+                Fast.api.open('student/collection/editreport/ids/'+ids+'/xh_id/'+xh_id, __("维修报告"), {area: ["95%", "85%"], 
+                    callback:function(value){
+                        console.log(value+'@@@@');
+                    }
+                });
             });
             //移除记录
             $(document).on('click', '.btnmove', function () {
@@ -133,13 +129,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 );
 
             });
-            
+            $(document).on('click', '.layui-layer-close1', function () {
+                window.location.reload();
+            });
+
             $(document).on("fa.event.appendfieldlist", "#second-fieldlist .btn-append", function (e, obj) {
                 //绑定动态下拉组件
                 Form.events.selectpage(obj);
 
             });
-
+            
             Form.api.bindevent($("form[role=form]"), function(data, ret) {
                 if(ret.code==1){
                     Backend.api.addtabs( ret.url,'得分分析');

+ 18 - 30
public/assets/js/backend/student/practice.js

@@ -117,6 +117,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             });
         },
         examing: function () {
+            var dingshi = '';
             $(document).ready(function() {
                 var countdownTime = Config.timer; // 倒计时时间,单位为秒
                 var countdownTime1 = 600; // 10分钟倒计时时间,单位为秒
@@ -152,42 +153,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                 }
                             }
                         });
-                        // clearInterval(timer);
-                        // $(".djs").html('已经超时,10分钟00秒后系统自动交卷。');
-                        // setTimeout(function() {
-                        //     var minutes1 = parseInt(countdownTime1 / 60, 10);
-                        //     var seconds1 = parseInt(countdownTime1 % 60, 10);
-                        //     $(".djs").html('已经超时,'+minutes1 + "分" + seconds1 +'秒后系统自动交卷。');
-                        //     if (--countdownTime1>0) {
-                        //         var minutes2 = parseInt(countdownTime1 / 60, 10);
-                        //         var seconds2 = parseInt(countdownTime1 % 60, 10);
-                        //         $(".djs").html('已经超时,'+minutes2 + "分" + seconds2 +'秒后系统自动交卷。');
-                        //         console.log(minutes2+'@@@@'+seconds2);
-                        //         if(minutes2==0 && seconds2==1){
-                        //             $('#update-form').submit();
-                        //             clearInterval(timer);
-                        //         }
-                        //     }
-                        // }, 1000); // 第二个定时器2秒后执行
                     }
-                    // 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() {
+                    dingshi = setInterval(function() {
                         window.location.reload();
                     }, 30000);
                 }
-
             });
 
             $(document).on('click', '.btn-replace', function () {
@@ -216,19 +190,30 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
             //追加记录
             $(document).on('click', '.btn-addlog', function () {
+                clearTimeout(dingshi);
+                console.log(dingshi+'@@@@');
                 var ids = Config.ids;
                 var other_report_count = Config.other_report_count;
                 if(other_report_count==3){
                     Layer.alert('维修报告最多允许增加三条');
                     return false;
                 }
-                Fast.api.open('student/collection/addreport/ids/'+ids, __("维修报告"), {area: ["95%", "85%"], maxmin: true, moveOut: false});
+                Fast.api.open('student/collection/addreport/ids/'+ids, __("维修报告"), {area: ["95%", "85%"], 
+                    callback:function(value){
+                        console.log(value+'@@@@');
+                    }
+                });
             });
             //编辑记录
             $(document).on('click', '.btnedit', function () {
+                clearTimeout(dingshi);
                 var ids = Config.ids;
                 var xh_id = $(this).attr('xh_id');
-                Fast.api.open('student/collection/editreport/ids/'+ids+'/xh_id/'+xh_id, __("维修报告"), {area: ["95%", "85%"], maxmin: true, moveOut: false});
+                Fast.api.open('student/collection/editreport/ids/'+ids+'/xh_id/'+xh_id, __("维修报告"), {area: ["95%", "85%"], 
+                    callback:function(value){
+                        console.log(value+'@@@@');
+                    }
+                });
             });
             //移除记录
             $(document).on('click', '.btnmove', function () {
@@ -255,6 +240,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 );
 
             });
+            $(document).on('click', '.layui-layer-close1', function () {
+                window.location.reload();
+            });
 
             $(document).on("fa.event.appendfieldlist", "#second-fieldlist .btn-append", function (e, obj) {
                 //绑定动态下拉组件

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

@@ -118,7 +118,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
                                     icon: 'fa fa-pencil',
                                     title: '编辑',
                                     classname: 'btn btn-success btn-xs btn-magic btn-dialog',
-                                    extend: 'data-area=\'["55%","95%"]\'',
+                                    extend: 'data-area=\'["70%","95%"]\'',
                                     url: 'teacher/exams/edit',
                                 }
                             ],