lizhen_gitee před 7 měsíci
rodič
revize
45120315ef

+ 7 - 1
addons/exam/controller/Paper.php

@@ -131,8 +131,14 @@ class Paper extends Base
 
         //记录为已开始,计划任务倒计时之后 自动结束
         $data = [
+            'cate_id'  => $paper['cate_id'],
             'user_id'  => $this->auth->id,
             'paper_id' => $paper_id,
+            'mode'     => $paper['mode'],
+
+            'total_score' => $paper['total_score'],
+            'total_count' => $paper['quantity'],
+
             'start_time' => time(),
             'createtime' => time(),
             'status' => 1,
@@ -182,7 +188,7 @@ class Paper extends Base
 
         $check = Db::name('exam_grade')->where('status',1)->where('user_id',$user_id)->where('paper_id',$paper_id)->find();
         if(!$check){
-            $this->error('提交数据有误');
+            $this->error('交卷有误,或者您已交卷');
         }
         $grade_id = $check['id'];
         $start_time = $check['start_time'];

+ 1 - 1
application/admin/controller/Trainactive.php

@@ -166,7 +166,7 @@ class Trainactive extends Backend
         ];
         $status_color = [
             1 => 'green',
-            2 => 'yellow',
+            2 => 'blue',
         ];
         foreach($user_yingdao as $key => $val){
             $user_yingdao[$key]['sign_time'] = empty($val['sign_time']) ? '' : date('Y-m-d H:i:s',$val['sign_time']);

+ 2 - 2
application/admin/validate/Admin.php

@@ -34,8 +34,8 @@ class Admin extends Validate
      * 验证场景
      */
     protected $scene = [
-        'add'  => ['username', 'email', 'nickname', 'password', 'mobile'],
-        'edit' => ['username', 'email', 'nickname', 'password', 'mobile'],
+        'add'  => ['username', /*'email',*/ 'nickname', 'password', 'mobile'],
+        'edit' => ['username', /*'email',*/ 'nickname', 'password', 'mobile'],
     ];
 
     public function __construct(array $rules = [], $message = [], $field = [])

+ 2 - 2
application/admin/view/auth/admin/add.html

@@ -12,12 +12,12 @@
             <input type="text" class="form-control" id="username" name="row[username]" value="" data-rule="required;username" />
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label for="email" class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input type="email" class="form-control" id="email" name="row[email]" value="" data-rule="required;email" />
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label for="mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
         <div class="col-xs-12 col-sm-8">

+ 2 - 2
application/admin/view/auth/admin/edit.html

@@ -12,12 +12,12 @@
             <input type="text" class="form-control" id="username" name="row[username]" value="{$row.username|htmlentities}" data-rule="required;username" />
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label for="email" class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input type="email" class="form-control" id="email" name="row[email]" value="{$row.email|htmlentities}" data-rule="required;email" />
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label for="mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
         <div class="col-xs-12 col-sm-8">

+ 9 - 7
application/admin/view/exam/paper/add.html

@@ -117,13 +117,7 @@
             </div>
         </div>
 
-        <!--<div class="form-group">
-            <label class="control-label col-xs-12 col-sm-2">每人限制考试次数:</label>
-            <div class="col-xs-12 col-sm-8" style="line-height: 31px;">
-                <input id="c-limit_count" data-rule="required" class="form-control" name="row[limit_count]" type="number"
-                       step="1" min="0" value="1" style="width: 200px" placeholder="考试限时,0不限制">
-            </div>
-        </div>-->
+
 
         <div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
@@ -160,6 +154,14 @@
         </div>-->
 
         <div class="form-group">
+            <label class="control-label col-xs-12 col-sm-2">每人限制考试次数:</label>
+            <div class="col-xs-12 col-sm-8" style="line-height: 31px;">
+                <input id="c-limit_count" data-rule="required" class="form-control" name="row[limit_count]" type="number"
+                       step="1" min="0" value="1" style="width: 200px" placeholder="考试限时,0不限制">
+            </div>
+        </div>
+
+        <div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
             <div class="col-xs-12 col-sm-8">
 

+ 3 - 3
application/admin/view/exam/paper/edit.html

@@ -138,13 +138,13 @@
             </div>
         </div>-->
 
-        <!--<div class="form-group">
+        <div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">每人限制考试次数:</label>
             <div class="col-xs-12 col-sm-8" style="line-height: 31px;">
                 <input id="c-limit_count" data-rule="required" class="form-control" name="row[limit_count]" type="number"
-                       step="1" min="0" value="{$row.limit_count|default=0}" style="width: 200px" placeholder="考试限时,0不限制">
+                       step="1" min="0" value="{$row.limit_count|default=1}" style="width: 200px" placeholder="考试限时,0不限制">
             </div>
-        </div>-->
+        </div>
 
         <div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>

+ 4 - 4
application/admin/view/tongji/tongji.html

@@ -56,19 +56,19 @@
 
     <table id="left_table" class="table table-striped table-bordered table-hover table-nowrap">
         <tr>
-            <td colspan="8">日期:{$defaultdatetime}</td>
+            <td colspan="9">日期:{$defaultdatetime}</td>
         </tr>
         <tr>
             <td rowspan="2" style="vertical-align: middle;">序号</td>
             <td rowspan="2" style="vertical-align: middle;">姓名</td>
             <td rowspan="2" style="vertical-align: middle;">昵称</td>
-            <td colspan="3" >考试统计</td>
+            <td colspan="4" >考试统计</td>
             <td colspan="2" >培训统计</td>
         </tr>
         <tr>
             <td>应参加考试</td>
             <td>不及格次数</td>
-            <!--<td>参加次数</td>-->
+            <td>考试次数</td>
             <td>缺考次数</td>
 
             <td>应参加培训次数</td>
@@ -83,7 +83,7 @@
 
             <td>{$vo.paper_count}</td>
             <td>{$vo.no_pass}</td>
-            <!--<td>{$vo.grade_count}</td>-->
+            <td>{$vo.grade_count}</td>
             <td>{$vo.no_grade}</td>
 
             <td>{$vo.train_count}</td>

+ 1 - 1
public/assets/js/backend/exam/grade.js

@@ -116,7 +116,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
         },
         formatter: {
             formatSecond: function(second) {
-                if (second == 0) return '不限时'
+                if (second == 0) return '0秒'
 
                 let result = parseInt(second)
                 let h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600);

+ 1 - 0
public/assets/js/backend/exam/paper.js

@@ -72,6 +72,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
                         {field: 'quantity', title: __('Quantity'), operate: false},
                         {field: 'total_score', title: __('Total_score'), operate: false},
                         {field: 'pass_score', title: __('Pass_score'), operate: false},
+                        {field: 'limit_count', title: __('Limit_count'), operate: false},
                         {
                             field: 'mode',
                             title: __('Mode'),