Jelajahi Sumber

20241231 学员端

贾小兵 3 bulan lalu
induk
melakukan
14d54d83ca

+ 56 - 6
application/admin/controller/student/Collection.php

@@ -5,6 +5,8 @@ namespace app\admin\controller\student;
 use app\common\controller\Backend;
 use app\common\model\Config as ConfigModel;
 use app\admin\model\Report;
+use think\exception\DbException;
+use think\response\Json;
 
 /**
  * sim-考试集合管理
@@ -32,6 +34,7 @@ class Collection extends Backend
         $this->assignConfig('sim_question_setting_method', ConfigModel::getSimQuestionList());
         $this->whereExtend['exam_collection_type'] = 3;
         $this->whereExtend['exam_collection_state'] = 2;
+        $this->assignConfig('sim_sim_type', ConfigModel::getSimTypeList());
     }
 
 
@@ -41,6 +44,43 @@ class Collection extends Backend
      * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
      * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
      */
+
+    /**
+     * 查看
+     *
+     * @return string|Json
+     * @throws \think\Exception
+     * @throws DbException
+     */
+    public function index()
+    {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if (false === $this->request->isAjax()) {
+            return $this->view->fetch();
+        }
+        //如果发送的来源是 Selectpage,则转发到 Selectpage
+        if ($this->request->request('keyField')) {
+            return $this->selectpage();
+        }
+        [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+        $list = $this->model
+            ->where($where)->where($this->whereExtend)
+            ->order($sort, $order)
+            ->paginate($limit);
+        foreach ($list as $k => $v){
+            $exam_isset =  $this->exam_model->where(['user_id'=>$this->auth->id,'exam_collection_id'=>$v['exam_collection_id'],'exam_collection_type'=>3])->find();
+            if(isset($exam_isset)){
+                $v->is_user_examed = 1;
+            }else{
+                $v->is_user_examed = 0;
+            }
+        }
+        unset($v);
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
+    }
+
     //进入考试
     public function  into($ids = null)
     {
@@ -53,6 +93,12 @@ class Collection extends Backend
             $arr = [
                 'exam_collection_id' => $ids,
                 'user_id' => $this->auth->id,
+                'user_username' => $this->auth->username,
+                'user_nickname' => $this->auth->nickname,
+                'user_depart_id' => $this->auth->depart_id,
+                'exam_collection_name' => $row->exam_collection_name,
+                'exam_collection_type' => 3,
+                'sim_type' => $row->sim_type,
                 'seat_id' => 1,
                 'sim_id' => 12,
             ];
@@ -60,7 +106,11 @@ class Collection extends Backend
         }
         if ($this->request->isPost()) {
             $exam_collection_id = $this->request->post('exam_collection_id');
-            $info->start_time = date('Y-m-d H:i:s');
+            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('开始成功','/ZQOtIMLKud.php/student/collection/examing/ids/'.$info['exam_id']);
         }
@@ -79,16 +129,15 @@ class Collection extends Backend
 
         $departmentdata = [];
         $departmentdata = Report::where(['level'=>4,'is_replace'=>1])->select();
-//        foreach ($result as $k => $v) {
-//            $departmentdata[$v['report_id']] = $v['name'];
-//        }
-//        halt($departmentdata);
         if ($this->request->isPost()) {
             $params = $this->request->post('row/a');
+            $row->end_time = date('Y-m-d H:i:s');
+            $row->endtime = time();
+            $row->exam_status = 5;
+            $row->save();
             $this->success('交卷成功','/ZQOtIMLKud.php/student/collection/analysis/ids/'.$row['exam_id']);
         }
         $this->view->assign('departmentdata', $departmentdata);
-
         return $this->view->fetch();
     }
 
@@ -101,6 +150,7 @@ class Collection extends Backend
         }
         if ($this->request->isPost()) {
             $params = $this->request->post('row/a');
+            //计算总分到学员考试表
             $this->success('操作成功','/ZQOtIMLKud.php/student/collection/index');
         }
         return $this->view->fetch();

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

@@ -3,6 +3,7 @@
 namespace app\admin\controller\student;
 
 use app\common\controller\Backend;
+use app\common\model\Config as ConfigModel;
 
 /**
  * sim-考试表/成绩总分
@@ -29,6 +30,7 @@ class Exam extends Backend
             $this->whereExtend['user_id'] = $this->auth->id;
         }
         $this->assignconfig("groupIds", $groupIds[0]);
+//        $this->assignConfig('sim_exam_status', ConfigModel::getSimExamStatus());
     }
 
 

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

@@ -0,0 +1,134 @@
+<?php
+
+namespace app\admin\controller\student;
+
+use app\admin\model\Report;
+use app\common\controller\Backend;
+use app\common\model\Config as ConfigModel;
+use think\Db;
+use think\exception\PDOException;
+
+/**
+ * sim-自主练习集合管理
+ *
+ * @icon fa fa-circle-o
+ */
+class Exercise extends Backend
+{
+
+    /**
+     * Collection模型对象
+     * @var \app\admin\model\teacher\Collection
+     */
+    protected $model = null;
+    protected $exam_model = null;
+
+    protected $whereExtend = null;
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\teacher\Collection;
+        $this->exam_model = new \app\admin\model\teacher\Exams;
+        $this->assign('sim_sim_type', ConfigModel::getSimTypeList());
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+    public function index()
+    {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if (false === $this->request->isAjax()) {
+            return $this->view->fetch();
+        }
+        if ($this->request->isPost()) {
+            $params = $this->request->post('row/a');
+            $count = 0;
+            Db::startTrans();
+            try {
+                $params['exam_collection_type'] = 2;
+                $params['exam_collection_state'] = 2;
+                $params['question_setting_method'] = 1;
+                $params['exam_collection_name'] = $this->auth->nickname.'自主练习';
+                $params['limit_duration'] = 30;
+                $params['start_time'] = date('Y-m-d');
+                $params['end_time'] = date('Y-m-d');
+                $exam_id = $this->model->insertGetId($params);
+
+                $data = [
+                    'exam_collection_id' => $exam_id,
+                    'user_id' => $this->auth->id,
+                    'user_username' => $this->auth->username,
+                    'user_nickname' => $this->auth->nickname,
+                    'user_depart_id' => $this->auth->depart_id,
+                    'exam_collection_name' => $params['exam_collection_name'],
+                    'exam_collection_type' =>$params['exam_collection_type'],
+                    'sim_type' => $params['sim_type'],
+                    'seat_id' =>1,
+                    'seat_id' =>12,
+                    'exam_status'=>4,
+                    'start_time'=>date('Y-m-d H:i:s'),
+                    'starttime'=>time(),
+                    'create_time'=>date('Y-m-d H:i:s'),
+                    'createtime'=>time(),
+                    'update_time'=>date('Y-m-d H:i:s'),
+                    'updatetime'=>time(),
+                ];
+                $examid = $this->exam_model->insertGetId($data);
+                $count = $examid;
+                Db::commit();
+            } catch (PDOException|Exception $e) {
+                Db::rollback();
+                $this->error($e->getMessage());
+            }
+            if ($count) {
+                $this->success('开始成功','/ZQOtIMLKud.php/student/exercise/examing/ids/'.$count);
+            }
+            $this->error(__('No rows were updated'));
+        }
+    }
+
+    public  function  examing($ids = null)
+    {
+        $row = $this->exam_model->get($ids);
+        if(!$row){
+            $this->error('未找到记录');
+        }
+        $this->assignConfig('timer', 60*$this->model->where(['exam_collection_id'=>$row['exam_collection_id']])->value('limit_duration'));
+        $this->view->assign('row', $row);
+
+        $departmentdata = [];
+        $departmentdata = Report::where(['level'=>4,'is_replace'=>1])->select();
+        if ($this->request->isPost()) {
+            $params = $this->request->post('row/a');
+            $row->end_time = date('Y-m-d H:i:s');
+            $row->endtime = time();
+            $row->exam_status = 5;
+            $row->save();
+            $this->success('交卷成功','/ZQOtIMLKud.php/student/exercise/analysis/ids/'.$row['exam_id']);
+        }
+        $this->view->assign('departmentdata', $departmentdata);
+        return $this->view->fetch();
+    }
+
+    public function analysis($ids = null)
+    {
+        $row = $this->exam_model->get($ids);
+        if(!$row){
+            $this->error('未找到记录');
+        }
+        if ($this->request->isPost()) {
+            $params = $this->request->post('row/a');
+            //计算总分到学员考试表
+            $this->success('操作成功','/ZQOtIMLKud.php/student/exercise/index');
+        }
+        return $this->view->fetch();
+    }
+
+}

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

@@ -2,6 +2,7 @@
 
 namespace app\admin\controller\student;
 
+use app\admin\model\Report;
 use app\common\controller\Backend;
 use app\common\model\Config as ConfigModel;
 
@@ -18,13 +19,19 @@ class Practice extends Backend
      * @var \app\admin\model\teacher\Collection
      */
     protected $model = null;
+    protected $exam_model = null;
 
+    protected $whereExtend = null;
     public function _initialize()
     {
         parent::_initialize();
         $this->model = new \app\admin\model\teacher\Collection;
+        $this->exam_model = new \app\admin\model\teacher\Exams;
         $this->assignConfig('sim_sim_type', ConfigModel::getSimTypeList());
         $this->assignConfig('sim_question_setting_method', ConfigModel::getSimQuestionList());
+
+        $this->whereExtend['exam_collection_type'] = 1;//练习
+        $this->whereExtend['exam_collection_state'] = 2;
     }
 
 
@@ -35,5 +42,108 @@ class Practice extends Backend
      * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
      */
 
+    public function index()
+    {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if (false === $this->request->isAjax()) {
+            return $this->view->fetch();
+        }
+        //如果发送的来源是 Selectpage,则转发到 Selectpage
+        if ($this->request->request('keyField')) {
+            return $this->selectpage();
+        }
+        [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+        $list = $this->model
+            ->where($where)->where($this->whereExtend)
+            ->order($sort, $order)
+            ->paginate($limit);
+        foreach ($list as $k => $v){
+            $exam_isset =  $this->exam_model->where(['user_id'=>$this->auth->id,'exam_collection_id'=>$v['exam_collection_id'],'exam_collection_type'=>1])->find();
+            if(isset($exam_isset)){
+                $v->is_user_examed = 1;
+            }else{
+                $v->is_user_examed = 0;
+            }
+        }
+        unset($v);
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
+    }
+
+    //进入考试
+    public function  into($ids = null)
+    {
+        $row = $this->model->get($ids);
+        if(!$row){
+            $this->error('未找到记录');
+        }
+        $info = $this->exam_model->where(['user_id'=>$this->auth->id,'exam_collection_id'=>$ids])->find();
+        if(empty($info)){
+            $arr = [
+                'exam_collection_id' => $ids,
+                'user_id' => $this->auth->id,
+                'user_username' => $this->auth->username,
+                'user_nickname' => $this->auth->nickname,
+                'user_depart_id' => $this->auth->depart_id,
+                'exam_collection_name' => $row->exam_collection_name,
+                'exam_collection_type' =>1,
+                'sim_type' => $row->sim_type,
+                'seat_id' => 1,
+                'sim_id' => 12,
+            ];
+            $this->exam_model->save($arr);
+        }
+        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('开始成功','/ZQOtIMLKud.php/student/practice/examing/ids/'.$info['exam_id']);
+        }
+        $this->view->assign('row', $row);
+        return $this->view->fetch();
+    }
+
+    public  function  examing($ids = null)
+    {
+        $row = $this->exam_model->get($ids);
+        if(!$row){
+            $this->error('未找到记录');
+        }
+        $this->assignConfig('timer', 60*$this->model->where(['exam_collection_id'=>$row['exam_collection_id']])->value('limit_duration'));
+        $this->view->assign('row', $row);
+
+        $departmentdata = [];
+        $departmentdata = Report::where(['level'=>4,'is_replace'=>1])->select();
+        if ($this->request->isPost()) {
+            $params = $this->request->post('row/a');
+            $row->end_time = date('Y-m-d H:i:s');
+            $row->endtime = time();
+            $row->exam_status = 5;
+            $row->save();
+            $this->success('交卷成功','/ZQOtIMLKud.php/student/practice/analysis/ids/'.$row['exam_id']);
+        }
+        $this->view->assign('departmentdata', $departmentdata);
+        return $this->view->fetch();
+    }
+
+
+    public function analysis($ids = null)
+    {
+        $row = $this->exam_model->get($ids);
+        if(!$row){
+            $this->error('未找到记录');
+        }
+        if ($this->request->isPost()) {
+            $params = $this->request->post('row/a');
+            //计算总分到学员考试表
+            $this->success('操作成功','/ZQOtIMLKud.php/student/practice/index');
+        }
+        return $this->view->fetch();
+    }
 
 }

+ 48 - 0
application/admin/controller/teacher/Collection.php

@@ -4,6 +4,8 @@ namespace app\admin\controller\teacher;
 
 use app\common\controller\Backend;
 use app\common\model\Config as ConfigModel;
+use think\Db;
+use think\exception\PDOException;
 
 /**
  * sim-考试集合管理
@@ -37,5 +39,51 @@ class Collection extends Backend
      * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
      * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
      */
+    public function multi($ids = null)
+    {
+        if (false === $this->request->isPost()) {
+            $this->error(__('Invalid parameters'));
+        }
+        $ids = $ids ?: $this->request->post('ids');
+        if (empty($ids)) {
+            $this->error(__('Parameter %s can not be empty', 'ids'));
+        }
 
+        if (false === $this->request->has('params')) {
+            $this->error(__('No rows were updated'));
+        }
+        parse_str($this->request->post('params'), $values);
+        $values = $this->auth->isSuperAdmin() ? $values : array_intersect_key($values, array_flip(is_array($this->multiFields) ? $this->multiFields : explode(',', $this->multiFields)));
+        if (empty($values)) {
+            $this->error(__('You have no permission'));
+        }
+        $adminIds = $this->getDataLimitAdminIds();
+        if (is_array($adminIds)) {
+            $this->model->where($this->dataLimitField, 'in', $adminIds);
+        }
+//        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_id'=>$ids])->count();
+//                if($state_count>0){
+//                    $this->error('已有启用的考试,请先关闭');
+//                }
+//            }
+//        }
+        $count = 0;
+        Db::startTrans();
+        try {
+            $list = $this->model->where($this->model->getPk(), 'in', $ids)->select();
+            foreach ($list as $item) {
+                $count += $item->allowField(true)->isUpdate(true)->save($values);
+            }
+            Db::commit();
+        } catch (PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if ($count) {
+            $this->success();
+        }
+        $this->error(__('No rows were updated'));
+    }
 }

+ 1 - 0
application/admin/lang/zh-cn/student/exam.php

@@ -4,6 +4,7 @@ return [
     'Exam_id'               => '编号',
     'Exam_collection_id'    => '考试集合ID',
     'User_id'               => '学员ID/用户ID',
+    'Sim_type'              => '模拟器类型',
     'Seat_id'               => '座ID',
     'Sim_id'                => '模拟器ID',
     //状态:[0]-未登录,[1]-已登录,[2]-模拟器检查并下发故障中,[3]:模拟器检查OK可开考,[4]-答题中,[5]-已交卷,[6]-计算成绩中,[7]-获取到成绩报告,[80]-教师标记缺考,[81]-登录未开始答题,[90]-模拟器异常结束

+ 1 - 1
application/admin/lang/zh-cn/student/practice.php

@@ -8,7 +8,7 @@ return [
     'Exam_collection_state'   => '状态',//:[0]-初始化,[2]-打开,[3]-关闭
     'Exam_collection_name'    => '练习名称',
     'Task_id'                 => '任务ID',
-    'Limit_duration'          => '限制时长(分钟)',
+    'Limit_duration'          => '练习时长',
     'Start_time'              => '练习开始时间',
     'End_time'                => '练习结束时间',
     'Create_user_id'          => '创建教师ID/用户ID',

+ 160 - 0
application/admin/view/student/exercise/analysis.html

@@ -0,0 +1,160 @@
+<link href="/assets/libs/font-awesome/css/font-awesome.min.css?v=Math.random()" rel="stylesheet">
+<link href="/assets/css/bootstrap.css?v=Math.random()" rel="stylesheet">
+<style type="text/css">
+    .new_table {
+        border-collapse: collapse;
+        margin: 0 auto;
+        text-align: left;
+        width: 100%;
+        font-size: 12px;
+    }
+
+    .new_table td,
+    table th {
+        border: 1px solid #cad9ea;
+        color: #666;
+        height: 3.5em;
+        padding-left: 1%;
+    }
+
+    .new_table thead th {
+        background-color: #CCE8EB;
+        width: 100px;
+    }
+
+
+
+    .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
+        background-color: #17223f;
+        color: #ffffff;
+        border-color: #17223f;
+        outline: none
+    }
+    .nav-tabs {
+        border-bottom: 1.5px solid #17223f;
+        margin-bottom: 10px;
+    }
+     .djs{
+         margin-right: 5%;
+         text-align: right;
+         line-height:8px;
+         font-size:20px;
+         margin-top: 50px;
+     }
+    .df {
+        color:red;
+    }
+</style>
+
+<div class="row">
+    <div class="djs">得分成绩/满分成绩: <span class="df">55</span>/100</div>
+    <div class="col-lg-12" style="margin: 10px 10px 0 10px">
+        <form id="update-form" role="form" data-toggle="validator" method="POST" action="">
+        <div class="tab-content" style="margin-top:5px;margin-right: 20px">
+            <div class="tab-pane tab_log1" style="display: block">
+                <table class="new_table">
+                    <tr>
+                        <td style="width:15%">序号</td>
+                        <td style="width:20%">评分标准</td>
+                        <td style="width:15%">扣分</td>
+                        <td style="width:15%">维修情况</td>
+                        <td>题目</td>
+                    </tr>
+                    <tr>
+                        <td colspan="5" style="text-align: left;padding-left: 1%">一.故障排除(75分)</td>
+                    </tr>
+                    <tr>
+                        <td>1</td>
+                        <td>故障一未排除扣25分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td>2</td>
+                        <td>故障二未排除扣25分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td>2</td>
+                        <td>故障三未排除扣25分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td style="width:15%">序号</td>
+                        <td style="width:20%">评分标准</td>
+                        <td style="width:15%">扣分</td>
+                        <td style="width:15%">报告情况</td>
+                        <td>题目</td>
+                    </tr>
+                    <tr>
+                        <td colspan="5" style="text-align: left;padding-left: 1%">二.修理报告表(15分)</td>
+                    </tr>
+                    <tr>
+                        <td>1</td>
+                        <td>故障现象少写或错写1条扣1分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td>2</td>
+                        <td>可能原因少写或错写1条扣1分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td>3</td>
+                        <td>故障部位少写或错写1条扣1分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td>4</td>
+                        <td>排除方法少写或错写1条扣1分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td>5</td>
+                        <td>修复结论错扣2分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td colspan="5" style="text-align: left;padding-left: 1%">三.维修时间(10分)</td>
+                    </tr>
+                    <tr>
+                        <td colspan="2">按没超过1分钟扣1分的比例扣分</td>
+                        <td colspan="3"></td>
+                    </tr>
+                    <tr>
+                        <td colspan="2">扣分小计</td>
+                        <td colspan="3">超时</td>
+                    </tr>
+                    <tr>
+                        <td colspan="2">五.成绩</td>
+                        <td colspan="3"></td>
+                    </tr>
+                    <tr>
+                        <td colspan="2">说明</td>
+                        <td colspan="3"></td>
+                    </tr>
+                </table>
+            </div>
+
+        </div>
+        <div class="form-group" style="text-align: center;margin-top: 5%">
+            <button type="submit" class="btn btn-info" style="text-align: center;width: 10%">{:__('结束')}</button>
+        </div>
+        </form>
+    </div>
+</div>

+ 209 - 0
application/admin/view/student/exercise/examing.html

@@ -0,0 +1,209 @@
+<style>
+    .profile-avatar-container {
+        position: relative;
+        width: 100px;
+        margin: 0 auto;
+    }
+
+    .profile-avatar-container .profile-user-img {
+        width: 100px;
+        height: 100px;
+    }
+
+    .profile-avatar-container .profile-avatar-text {
+        display: none;
+    }
+
+    .profile-avatar-container:hover .profile-avatar-text {
+        display: block;
+        position: absolute;
+        height: 100px;
+        width: 100px;
+        background: #444;
+        opacity: .6;
+        color: #fff;
+        top: 0;
+        left: 0;
+        line-height: 100px;
+        text-align: center;
+    }
+
+    .profile-avatar-container button {
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100px;
+        height: 100px;
+        opacity: 0;
+    }
+    .readme {
+        margin-top:2%;
+        text-align: center;
+        line-height:8px;
+        font-size:22px;
+    }
+    .djs {
+        margin-top:2%;
+        text-align: center;
+        line-height:8px;
+        font-size:22px;
+        color:red;
+        margin-bottom: 3%;
+    }
+</style>
+<style type="text/css">
+    .new_table {
+        border-collapse: collapse;
+        margin: 0 auto;
+        text-align: center;
+        width: 100%;
+        font-size: 12px;
+    }
+
+    .new_table td,
+    table th {
+        border: 1px solid #cad9ea;
+        color: #666;
+        height: 2.5em;
+    }
+
+    .new_table thead th {
+        background-color: #CCE8EB;
+        width: 100px;
+    }
+
+    .span_show {
+        float: left;
+        margin-left: 15px;
+        font-size: 11px;
+        color: #0a84ff;
+        cursor: pointer;
+    }
+
+    .span_hide {
+        float: left;
+        margin-left: 15px;
+        font-size: 11px;
+        color: #0a84ff;
+        cursor: pointer;
+    }
+
+    .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
+        background-color: #17223f;
+        color: #ffffff;
+        border-color: #17223f;
+
+        outline: none
+    }
+    .nav-tabs {
+        border-bottom: 1.5px solid #17223f;
+        margin-bottom: 10px;
+    }
+    .panel-heading{font-size: 18px}
+</style>
+<div class="row animated fadeInRight">
+    <div class="col-md-12">
+        <div class="box box-primary">
+
+            <div class="panel-body">
+                <form id="update-form" role="form" data-toggle="validator" method="POST" action="">
+                    {:token()}
+                    <div class="panel-heading">
+                        <div class="readme">正在练习中,考试时间 50 分钟</div>
+                        <div class="djs">距离练习结束还有 <span id="timer"></span> </div>
+                    </div>
+                    <div class="box-body box-profile">
+                        <div class="col-xs-12 col-sm-12">
+                            <div class="form-group">
+                                <label  style=" width: 10%;" class="control-label col-xs-3 col-sm-3 addRedStar">{:__('更换件列表')}:</label>
+                                <div class="col-xs-9 col-sm-9">
+                                    <dl class="fieldlist" data-name="row[other_supplier]" data-template="other_suppliertpl">
+                                        <dd>
+                                            <ins style="width: 450px;">更换件类型</ins>
+                                            <ins style="width: 300px;">状态</ins>
+                                        </dd>
+                                        <dd>
+                                            <a href="javascript:;" class="btn btn-sm btn-info btn-append"><i class="fa fa-plus"></i> 追加</a>
+                                        </dd>
+                                        <textarea name="row[other_supplier]" class="form-control hide" cols="30" rows="5" data-rule="required"></textarea>
+                                    </dl>
+                                    <!--定义模板,模板语法使用Art-Template模板语法-->
+                                    <script type="text/html" id="other_suppliertpl">
+                                        <dd class="form-inline">
+<!--                                            <input type="text" name="unwin[<%=index%>][name]"-->
+<!--                                                   class="form-control" value="<%=row['name']%>" style="width: 450px;" >-->
+                                            <select class="form-control" name="unwin[<%=index%>][name]" style="width: 550px;">
+                                                {foreach name="departmentdata" item="vo"}
+                                                <option value="{$vo.report_id}" >{$vo.name}</option>
+                                                {/foreach}
+                                            </select>
+                                            <select class="form-control" name="unwin[<%=index%>][states]" style="width: 420px;">
+                                                <option value="0">未送</option>
+                                                <option value="0">已送</option>
+                                            </select>
+<!--                                            <input type="text" name="unwin[<%=index%>][price]"-->
+<!--                                                   style="width: 300px;"-->
+<!--                                                   class="form-control" value="<%=row['price']%>" >-->
+                                            <span class="btn btn-sm btn-danger btn-remove" title="移除"><i class="fa fa-times"></i></span>
+                                            <span class="btn btn-sm btn-success btn-save" title="保存"><i class="fa fa-check"></i></span>
+                                        </dd>
+                                    </script>
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="col-xs-12 col-sm-12">
+                            <div class="form-group">
+                                <label  style=" width: 10%;" class="control-label col-xs-3 col-sm-3 addRedStar">{:__('更换件列表')}:</label>
+                                <div class="col-xs-9 col-sm-9">
+                                    <dl class="fieldlist" data-name="row[other_supplier1]" data-template="other_suppliertpl1">
+                                        <dd>
+                                            <ins style="width: 250px;">故障现象</ins>
+                                            <ins style="width: 250px;">可能原因</ins>
+                                            <ins style="width: 250px;">故障部位</ins>
+                                            <ins style="width: 250px;">排除方法</ins>
+
+                                        </dd>
+                                        <dd>
+                                            <a href="javascript:;" class="btn btn-sm btn-info btn-append"><i class="fa fa-plus"></i> 追加</a>
+                                        </dd>
+                                        <textarea name="row[other_supplier1]" class="form-control hide" cols="30" rows="5" data-rule="required"></textarea>
+                                    </dl>
+                                    <!--定义模板,模板语法使用Art-Template模板语法-->
+                                    <script type="text/html" id="other_suppliertpl1">
+                                        <dd class="form-inline">
+                                            <input type="text" name="unwin[<%=index%>][name]"
+                                                   class="form-control" value="<%=row['name']%>" style="width: 250px;" >
+                                            <input type="text" name="unwin[<%=index%>][price]"
+                                                   style="width: 250px;"
+                                                   class="form-control" value="<%=row['price']%>" >
+                                            <input type="text" name="unwin[<%=index%>][price]"
+                                                   style="width: 250px;"
+                                                   class="form-control" value="<%=row['price']%>" >
+                                            <input type="text" name="unwin[<%=index%>][price]"
+                                                   style="width: 250px;"
+                                                   class="form-control" value="<%=row['price']%>" >
+                                            <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
+                                        </dd>
+                                    </script>
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="col-xs-12 col-sm-12">
+                            <div class="form-group">
+                                <label  style=" width: 10%;" class="control-label col-xs-3 col-sm-3 addRedStar">{:__('修复结论')}:</label>
+                                <div class="col-xs-9 col-sm-9">
+                                    <textarea class="form-control" data-rule="required" name="row[jielun]" style="width: 91%"></textarea>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="form-group" style="text-align: center;">
+                        <button type="submit" class="btn btn-info" style="text-align: center;width: 10%">{:__('交卷')}</button>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>

+ 79 - 0
application/admin/view/student/exercise/index.html

@@ -0,0 +1,79 @@
+<style>
+    .profile-avatar-container {
+        position: relative;
+        width: 100px;
+        margin: 0 auto;
+    }
+
+    .profile-avatar-container .profile-user-img {
+        width: 100px;
+        height: 100px;
+    }
+
+    .profile-avatar-container .profile-avatar-text {
+        display: none;
+    }
+
+    .profile-avatar-container:hover .profile-avatar-text {
+        display: block;
+        position: absolute;
+        height: 100px;
+        width: 100px;
+        background: #444;
+        opacity: .6;
+        color: #fff;
+        top: 0;
+        left: 0;
+        line-height: 100px;
+        text-align: center;
+    }
+
+    .profile-avatar-container button {
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100px;
+        height: 100px;
+        opacity: 0;
+    }
+    .panel-heading{font-size: 18px}
+</style>
+<div class="row animated fadeInRight">
+    <div class="col-md-12">
+        <div class="box box-primary">
+
+            <div class="panel-body">
+                <form id="update-form" role="form" data-toggle="validator" method="POST" action="">
+                    {:token()}
+                    <div class="panel-heading">
+                        {:__('基本信息')}
+                    </div>
+                    <div class="box-body box-profile">
+                        <div class="row">
+                            <div class="form-group col-sm-12">
+                                <label class="control-label">{:__('模拟器类型')}:</label>
+                                <select class="form-control" name="row[sim_type]" data-rule="required" style="width: 80%">
+                                    <option value="">请选择</option>
+                                    {volist name="sim_sim_type" id="vo"}
+                                    <option value="{$key}">{$vo}</option>
+                                    {/volist}
+                                </select>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="panel-heading">
+                        {:__('注意事项')}
+                    </div>
+                    <div class="box-body box-profile">
+                        <div style="color: rgb(192, 74, 84)">1.遵守考场纪律‌</div>
+                        <div style="color: rgb(192, 74, 84)">2.合理安排时间</div>
+                    </div>
+                    <div class="form-group" style="text-align: center">
+                        <button type="submit" class="btn btn-info">{:__('开始练习')}</button>
+                        <!--                            <button type="reset" class="btn btn-default">{:__('Reset')}</button>-->
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>

+ 160 - 0
application/admin/view/student/practice/analysis.html

@@ -0,0 +1,160 @@
+<link href="/assets/libs/font-awesome/css/font-awesome.min.css?v=Math.random()" rel="stylesheet">
+<link href="/assets/css/bootstrap.css?v=Math.random()" rel="stylesheet">
+<style type="text/css">
+    .new_table {
+        border-collapse: collapse;
+        margin: 0 auto;
+        text-align: left;
+        width: 100%;
+        font-size: 12px;
+    }
+
+    .new_table td,
+    table th {
+        border: 1px solid #cad9ea;
+        color: #666;
+        height: 3.5em;
+        padding-left: 1%;
+    }
+
+    .new_table thead th {
+        background-color: #CCE8EB;
+        width: 100px;
+    }
+
+
+
+    .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
+        background-color: #17223f;
+        color: #ffffff;
+        border-color: #17223f;
+        outline: none
+    }
+    .nav-tabs {
+        border-bottom: 1.5px solid #17223f;
+        margin-bottom: 10px;
+    }
+     .djs{
+         margin-right: 5%;
+         text-align: right;
+         line-height:8px;
+         font-size:20px;
+         margin-top: 50px;
+     }
+    .df {
+        color:red;
+    }
+</style>
+
+<div class="row">
+    <div class="djs">得分成绩/满分成绩: <span class="df">55</span>/100</div>
+    <div class="col-lg-12" style="margin: 10px 10px 0 10px">
+        <form id="update-form" role="form" data-toggle="validator" method="POST" action="">
+        <div class="tab-content" style="margin-top:5px;margin-right: 20px">
+            <div class="tab-pane tab_log1" style="display: block">
+                <table class="new_table">
+                    <tr>
+                        <td style="width:15%">序号</td>
+                        <td style="width:20%">评分标准</td>
+                        <td style="width:15%">扣分</td>
+                        <td style="width:15%">维修情况</td>
+                        <td>题目</td>
+                    </tr>
+                    <tr>
+                        <td colspan="5" style="text-align: left;padding-left: 1%">一.故障排除(75分)</td>
+                    </tr>
+                    <tr>
+                        <td>1</td>
+                        <td>故障一未排除扣25分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td>2</td>
+                        <td>故障二未排除扣25分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td>2</td>
+                        <td>故障三未排除扣25分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td style="width:15%">序号</td>
+                        <td style="width:20%">评分标准</td>
+                        <td style="width:15%">扣分</td>
+                        <td style="width:15%">报告情况</td>
+                        <td>题目</td>
+                    </tr>
+                    <tr>
+                        <td colspan="5" style="text-align: left;padding-left: 1%">二.修理报告表(15分)</td>
+                    </tr>
+                    <tr>
+                        <td>1</td>
+                        <td>故障现象少写或错写1条扣1分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td>2</td>
+                        <td>可能原因少写或错写1条扣1分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td>3</td>
+                        <td>故障部位少写或错写1条扣1分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td>4</td>
+                        <td>排除方法少写或错写1条扣1分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td>5</td>
+                        <td>修复结论错扣2分</td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td colspan="5" style="text-align: left;padding-left: 1%">三.维修时间(10分)</td>
+                    </tr>
+                    <tr>
+                        <td colspan="2">按没超过1分钟扣1分的比例扣分</td>
+                        <td colspan="3"></td>
+                    </tr>
+                    <tr>
+                        <td colspan="2">扣分小计</td>
+                        <td colspan="3">超时</td>
+                    </tr>
+                    <tr>
+                        <td colspan="2">五.成绩</td>
+                        <td colspan="3"></td>
+                    </tr>
+                    <tr>
+                        <td colspan="2">说明</td>
+                        <td colspan="3"></td>
+                    </tr>
+                </table>
+            </div>
+
+        </div>
+        <div class="form-group" style="text-align: center;margin-top: 5%">
+            <button type="submit" class="btn btn-info" style="text-align: center;width: 10%">{:__('结束')}</button>
+        </div>
+        </form>
+    </div>
+</div>

+ 209 - 0
application/admin/view/student/practice/examing.html

@@ -0,0 +1,209 @@
+<style>
+    .profile-avatar-container {
+        position: relative;
+        width: 100px;
+        margin: 0 auto;
+    }
+
+    .profile-avatar-container .profile-user-img {
+        width: 100px;
+        height: 100px;
+    }
+
+    .profile-avatar-container .profile-avatar-text {
+        display: none;
+    }
+
+    .profile-avatar-container:hover .profile-avatar-text {
+        display: block;
+        position: absolute;
+        height: 100px;
+        width: 100px;
+        background: #444;
+        opacity: .6;
+        color: #fff;
+        top: 0;
+        left: 0;
+        line-height: 100px;
+        text-align: center;
+    }
+
+    .profile-avatar-container button {
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100px;
+        height: 100px;
+        opacity: 0;
+    }
+    .readme {
+        margin-top:2%;
+        text-align: center;
+        line-height:8px;
+        font-size:22px;
+    }
+    .djs {
+        margin-top:2%;
+        text-align: center;
+        line-height:8px;
+        font-size:22px;
+        color:red;
+        margin-bottom: 3%;
+    }
+</style>
+<style type="text/css">
+    .new_table {
+        border-collapse: collapse;
+        margin: 0 auto;
+        text-align: center;
+        width: 100%;
+        font-size: 12px;
+    }
+
+    .new_table td,
+    table th {
+        border: 1px solid #cad9ea;
+        color: #666;
+        height: 2.5em;
+    }
+
+    .new_table thead th {
+        background-color: #CCE8EB;
+        width: 100px;
+    }
+
+    .span_show {
+        float: left;
+        margin-left: 15px;
+        font-size: 11px;
+        color: #0a84ff;
+        cursor: pointer;
+    }
+
+    .span_hide {
+        float: left;
+        margin-left: 15px;
+        font-size: 11px;
+        color: #0a84ff;
+        cursor: pointer;
+    }
+
+    .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
+        background-color: #17223f;
+        color: #ffffff;
+        border-color: #17223f;
+
+        outline: none
+    }
+    .nav-tabs {
+        border-bottom: 1.5px solid #17223f;
+        margin-bottom: 10px;
+    }
+    .panel-heading{font-size: 18px}
+</style>
+<div class="row animated fadeInRight">
+    <div class="col-md-12">
+        <div class="box box-primary">
+
+            <div class="panel-body">
+                <form id="update-form" role="form" data-toggle="validator" method="POST" action="">
+                    {:token()}
+                    <div class="panel-heading">
+                        <div class="readme">正在练习中,考试时间 50 分钟</div>
+                        <div class="djs">距离练习结束还有 <span id="timer"></span> </div>
+                    </div>
+                    <div class="box-body box-profile">
+                        <div class="col-xs-12 col-sm-12">
+                            <div class="form-group">
+                                <label  style=" width: 10%;" class="control-label col-xs-3 col-sm-3 addRedStar">{:__('更换件列表')}:</label>
+                                <div class="col-xs-9 col-sm-9">
+                                    <dl class="fieldlist" data-name="row[other_supplier]" data-template="other_suppliertpl">
+                                        <dd>
+                                            <ins style="width: 450px;">更换件类型</ins>
+                                            <ins style="width: 300px;">状态</ins>
+                                        </dd>
+                                        <dd>
+                                            <a href="javascript:;" class="btn btn-sm btn-info btn-append"><i class="fa fa-plus"></i> 追加</a>
+                                        </dd>
+                                        <textarea name="row[other_supplier]" class="form-control hide" cols="30" rows="5" data-rule="required"></textarea>
+                                    </dl>
+                                    <!--定义模板,模板语法使用Art-Template模板语法-->
+                                    <script type="text/html" id="other_suppliertpl">
+                                        <dd class="form-inline">
+<!--                                            <input type="text" name="unwin[<%=index%>][name]"-->
+<!--                                                   class="form-control" value="<%=row['name']%>" style="width: 450px;" >-->
+                                            <select class="form-control" name="unwin[<%=index%>][name]" style="width: 550px;">
+                                                {foreach name="departmentdata" item="vo"}
+                                                <option value="{$vo.report_id}" >{$vo.name}</option>
+                                                {/foreach}
+                                            </select>
+                                            <select class="form-control" name="unwin[<%=index%>][states]" style="width: 420px;">
+                                                <option value="0">未送</option>
+                                                <option value="0">已送</option>
+                                            </select>
+<!--                                            <input type="text" name="unwin[<%=index%>][price]"-->
+<!--                                                   style="width: 300px;"-->
+<!--                                                   class="form-control" value="<%=row['price']%>" >-->
+                                            <span class="btn btn-sm btn-danger btn-remove" title="移除"><i class="fa fa-times"></i></span>
+                                            <span class="btn btn-sm btn-success btn-save" title="保存"><i class="fa fa-check"></i></span>
+                                        </dd>
+                                    </script>
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="col-xs-12 col-sm-12">
+                            <div class="form-group">
+                                <label  style=" width: 10%;" class="control-label col-xs-3 col-sm-3 addRedStar">{:__('更换件列表')}:</label>
+                                <div class="col-xs-9 col-sm-9">
+                                    <dl class="fieldlist" data-name="row[other_supplier1]" data-template="other_suppliertpl1">
+                                        <dd>
+                                            <ins style="width: 250px;">故障现象</ins>
+                                            <ins style="width: 250px;">可能原因</ins>
+                                            <ins style="width: 250px;">故障部位</ins>
+                                            <ins style="width: 250px;">排除方法</ins>
+
+                                        </dd>
+                                        <dd>
+                                            <a href="javascript:;" class="btn btn-sm btn-info btn-append"><i class="fa fa-plus"></i> 追加</a>
+                                        </dd>
+                                        <textarea name="row[other_supplier1]" class="form-control hide" cols="30" rows="5" data-rule="required"></textarea>
+                                    </dl>
+                                    <!--定义模板,模板语法使用Art-Template模板语法-->
+                                    <script type="text/html" id="other_suppliertpl1">
+                                        <dd class="form-inline">
+                                            <input type="text" name="unwin[<%=index%>][name]"
+                                                   class="form-control" value="<%=row['name']%>" style="width: 250px;" >
+                                            <input type="text" name="unwin[<%=index%>][price]"
+                                                   style="width: 250px;"
+                                                   class="form-control" value="<%=row['price']%>" >
+                                            <input type="text" name="unwin[<%=index%>][price]"
+                                                   style="width: 250px;"
+                                                   class="form-control" value="<%=row['price']%>" >
+                                            <input type="text" name="unwin[<%=index%>][price]"
+                                                   style="width: 250px;"
+                                                   class="form-control" value="<%=row['price']%>" >
+                                            <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
+                                        </dd>
+                                    </script>
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="col-xs-12 col-sm-12">
+                            <div class="form-group">
+                                <label  style=" width: 10%;" class="control-label col-xs-3 col-sm-3 addRedStar">{:__('修复结论')}:</label>
+                                <div class="col-xs-9 col-sm-9">
+                                    <textarea class="form-control" data-rule="required" name="row[jielun]" style="width: 91%"></textarea>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="form-group" style="text-align: center;">
+                        <button type="submit" class="btn btn-info" style="text-align: center;width: 10%">{:__('交卷')}</button>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>

+ 91 - 0
application/admin/view/student/practice/into.html

@@ -0,0 +1,91 @@
+<style>
+    .profile-avatar-container {
+        position: relative;
+        width: 100px;
+        margin: 0 auto;
+    }
+
+    .profile-avatar-container .profile-user-img {
+        width: 100px;
+        height: 100px;
+    }
+
+    .profile-avatar-container .profile-avatar-text {
+        display: none;
+    }
+
+    .profile-avatar-container:hover .profile-avatar-text {
+        display: block;
+        position: absolute;
+        height: 100px;
+        width: 100px;
+        background: #444;
+        opacity: .6;
+        color: #fff;
+        top: 0;
+        left: 0;
+        line-height: 100px;
+        text-align: center;
+    }
+
+    .profile-avatar-container button {
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100px;
+        height: 100px;
+        opacity: 0;
+    }
+    .panel-heading{font-size: 18px}
+</style>
+<div class="row animated fadeInRight">
+    <div class="col-md-12">
+        <div class="box box-primary">
+
+            <div class="panel-body">
+                <form id="update-form" role="form" data-toggle="validator" method="POST" action="">
+                    {:token()}
+                    <div class="panel-heading">
+                        {:__('基本信息')}
+                    </div>
+                    <input type="hidden" name="exam_collection_id" value="{$row.exam_collection_id}">
+                    <div class="box-body box-profile">
+                        <div class="row">
+                            <div class="form-group col-sm-6">
+                                <label class="control-label">{:__('当前模式')}:</label>
+                                <input type="text" class="form-control" value="练习" readonly/>
+                            </div>
+                            <div class="form-group col-sm-6">
+                                <label class="control-label">{:__('模拟器类型')}:</label>
+                                <input type="text" class="form-control" value="{$admin.nickname|htmlentities}" readonly/>
+                            </div>
+                            <div class="form-group col-sm-6">
+                                <label class="control-label">{:__('模拟器状态')}:</label>
+                                <input type="text" class="form-control"  value="在线" readonly/>
+                            </div>
+                            <div class="form-group col-sm-6">
+                                <label class="control-label">{:__('考试学员')}:</label>
+                                <input type="text" class="form-control" value="{$admin.nickname|htmlentities}" readonly/>
+                            </div>
+                            <div class="form-group col-sm-6">
+                                <label class="control-label">{:__('学员座号')}:</label>
+                                <input type="text" class="form-control"  value="01" readonly/>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="panel-heading">
+                        {:__('注意事项')}
+                    </div>
+                    <div class="box-body box-profile">
+                        <div style="color: rgb(192, 74, 84)">1.遵守考场纪律‌</div>
+                        <div style="color: rgb(192, 74, 84)">2.合理安排时间</div>
+                    </div>
+                    <div class="form-group" style="text-align: center">
+                        <button type="submit" class="btn btn-info">{:__('开始练习')}</button>
+                        <!--                            <button type="reset" class="btn btn-default">{:__('Reset')}</button>-->
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>

+ 6 - 0
application/common/model/Config.php

@@ -102,6 +102,12 @@ class Config extends Model
         return json_decode($sim_question_setting_method,true);
     }
 
+    public static function getSimExamStatus()
+    {
+        $sim_exam_status =  Db::name('config')->where('name', 'sim_exam_status')->value('content');
+        return json_decode($sim_exam_status,true);
+    }
+
     /**
      * 读取分类分组列表
      * @return array

+ 1 - 0
application/extra/site.php

@@ -45,4 +45,5 @@ return array (
   'sim_question_setting_method' => '',
   'sim_sim_state' => '',
   'sim_repair' => '',
+  'sim_exam_status' => '',
 );

+ 7 - 1
public/assets/js/backend/student/collection.js

@@ -40,7 +40,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         // },
 
                         {field: 'limit_duration', title: __('Limit_duration')},
-                        {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
+                        {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false,},
                         {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
                         // {field: 'create_user_id', title: __('Create_user_id')},
                         {field: 'create_by', title: __('Create_by'), operate: 'LIKE'},
@@ -59,6 +59,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                     text: '进入',
                                     icon: 'fa fa-hand-pointer-o',
                                     title: '进入',
+                                    visible: function (row){
+                                        if(row.is_user_examed==0){
+                                            return true;
+                                        }
+                                        return  false;
+                                    },
                                     classname: 'btn btn-info btn-xs btn-magic btn-addtabs',
                                     extend: 'data-area=\'["85%","85%"]\'',
                                     url: 'student/collection/into',

+ 10 - 10
public/assets/js/backend/student/exam.js

@@ -24,9 +24,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'exam_id', title: __('Exam_id')},
-                        {field: 'exam_id', title: __('学员学号')},
-                        {field: 'exam_id', title: __('学员姓名')},
-                        {field: 'exam_id', title: __('模拟器型号')},
+                        {field: 'exam_collection_name', title: __('考试名称')},
+                        {field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
+                        {field: 'user_username', title: __('学员学号')},
+                        {field: 'user_nickname', title: __('学员姓名')},
                         {
                             field: 'user_depart_id',
                             title: __('Department'),
@@ -51,16 +52,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         //         return  Table.api.formatter.flag.call(this, department, row, index);
                         //     }, operate:false
                         // },
-                        {field: 'exam_id', title: __('考试名称')},
-                        {field: 'exam_collection_id', title: __('Exam_collection_id')},
-                        {field: 'user_id', title: __('User_id')},
-                        {field: 'seat_id', title: __('Seat_id')},
+                        // {field: 'exam_collection_id', title: __('Exam_collection_id')},
+                        // {field: 'user_id', title: __('User_id')},
+                        // {field: 'seat_id', title: __('Seat_id')},
                         // {field: 'sim_id', title: __('Sim_id')},
-                        {field: 'exam_status', title: __('Exam_status')},
+                        {field: 'exam_status', title: __('Exam_status'),searchList: {"0":"未登录","1":"已登录","2":"模拟器检查并下发故障中","3":"模拟器正常","4":"答题中","5":"已交卷","6":"计算成绩中","7":"获取到成绩报告","80":"教师标记缺考","81":"登录未开始答题","90":"模拟器异常结束"},formatter: Table.api.formatter.simexamstatus},
                         {field: 'total_score', title: __('Total_score')},
                         // {field: 'deduction_total_score', title: __('Deduction_total_score')},
-                        {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
-                        {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
+                        {field: 'starttime', title: __('Start_time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
+                        {field: 'endtime', title: __('End_time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
                         // {field: 'login_time', title: __('Login_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
                         // {field: 'logout_time', title: __('Logout_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
                         // {field: 'create_by', title: __('Create_by'), operate: 'LIKE'},

+ 54 - 0
public/assets/js/backend/student/exercise.js

@@ -0,0 +1,54 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            Form.api.bindevent($("form[role=form]"), function(data, ret) {
+                if(ret.code==1){
+                    Backend.api.addtabs( ret.url,'正在练习');
+                }
+            });
+        },
+        examing: function () {
+            $(document).ready(function() {
+                var countdownTime = Config.timer; // 倒计时时间,单位为秒
+                var display = $('#timer');
+
+                var timer = setInterval(function() {
+                    var minutes = parseInt(countdownTime / 60, 10);
+                    var seconds = parseInt(countdownTime % 60, 10);
+
+                    minutes = minutes < 10 ? "0" + minutes : minutes;
+                    seconds = seconds < 10 ? "0" + seconds : seconds;
+
+                    display.text(minutes + "分" + seconds+'秒');
+
+                    if (--countdownTime < 0) {
+                        clearInterval(timer);
+                        display.text("时间到!");
+                    }
+                }, 1000);
+            });
+            Form.api.bindevent($("form[role=form]"), function(data, ret) {
+                if(ret.code==1){
+                    Backend.api.addtabs( ret.url,'得分分析');
+                }
+            });
+        },
+        analysis: function () {
+            Form.api.bindevent($("form[role=form]"), function(data, ret) {
+                if(ret.code==1){
+                    Backend.api.addtabs( ret.url);
+                }
+            });
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});

+ 80 - 16
public/assets/js/backend/student/practice.js

@@ -5,7 +5,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             // 初始化表格参数配置
             Table.api.init({
                 extend: {
-                    index_url: 'student/collection/index' + location.search,
+                    index_url: 'student/practice/index' + location.search,
                     table: 'teacher_collection',
                 }
             });
@@ -24,32 +24,55 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'exam_collection_id', title: __('编号')},
+                        {field: 'exam_collection_name', title: __('Exam_collection_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                         {field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
                         {field: 'question_setting_method', title: __('Question_setting_method'),searchList:{"1":"系统随机","2":"教师自选","3":"任务自选"},formatter: Table.api.formatter.simmethod},
-                        {field: 'exam_collection_type', title: __('Exam_collection_type'),operate: false,formatter: function (value, row, index) {
-                                return '练习';
-                            }
-                        },
-                        {
-                            field: 'exam_collection_state',searchList:{"2":"打开","3":"关闭"},
-                            title: __('Exam_collection_state'),
-                            align: 'center',
-                            table: table,disable:true,
-                            formatter: Table.api.formatter.collectonstate
-                        },
-                        {field: 'exam_collection_name', title: __('Exam_collection_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
-                        // {field: 'task_id', title: __('Task_id')},
+                        // {field: 'exam_collection_type', title: __('Exam_collection_type'),operate: false,formatter: function (value, row, index) {
+                        //         return '考试';
+                        //     }
+                        // },
+                        // {
+                        //     field: 'exam_collection_state',searchList:{"2":"打开","3":"关闭"},
+                        //     title: __('Exam_collection_state'),
+                        //     align: 'center',
+                        //     table: table,disable:true,
+                        //     formatter: Table.api.formatter.collectonstate
+                        // },
+
                         {field: 'limit_duration', title: __('Limit_duration')},
                         {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
                         {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
                         // {field: 'create_user_id', title: __('Create_user_id')},
                         {field: 'create_by', title: __('Create_by'), operate: 'LIKE'},
-                        {field: 'createtime', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
+                        // {field: 'createtime', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
                         // {field: 'update_by', title: __('Update_by'), operate: 'LIKE'},
                         // {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
                         // {field: 'remark', title: __('Remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
-                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                        // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                        {field: 'operate', title: __('Operate'), table: table,
+                            events: Table.api.events.operate,
+                            // formatter: Table.api.formatter.operate,
+                            formatter: Table.api.formatter.buttons,
+                            buttons: [
+                                {
+                                    name: 'dispatch',
+                                    text: '进入',
+                                    icon: 'fa fa-hand-pointer-o',
+                                    title: '进入',
+                                    // visible: function (row){
+                                    //     if(row.is_user_examed==0){
+                                    //         return true;
+                                    //     }
+                                    //     return  false;
+                                    // },
+                                    classname: 'btn btn-info btn-xs btn-magic btn-addtabs',
+                                    extend: 'data-area=\'["85%","85%"]\'',
+                                    url: 'student/practice/into',
+                                }
+                            ],
+                        }
                     ]
+
                 ]
             });
 
@@ -59,6 +82,47 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
         add: function () {
             Controller.api.bindevent();
         },
+        into: function () {
+            // Controller.api.bindevent();
+            Form.api.bindevent($("form[role=form]"), function(data, ret) {
+                if(ret.code==1){
+                    Backend.api.addtabs( ret.url,'正在练习');
+                }
+            });
+        },
+        examing: function () {
+            $(document).ready(function() {
+                var countdownTime = Config.timer; // 倒计时时间,单位为秒
+                var display = $('#timer');
+
+                var timer = setInterval(function() {
+                    var minutes = parseInt(countdownTime / 60, 10);
+                    var seconds = parseInt(countdownTime % 60, 10);
+
+                    minutes = minutes < 10 ? "0" + minutes : minutes;
+                    seconds = seconds < 10 ? "0" + seconds : seconds;
+
+                    display.text(minutes + "分" + seconds+'秒');
+
+                    if (--countdownTime < 0) {
+                        clearInterval(timer);
+                        display.text("时间到!");
+                    }
+                }, 1000);
+            });
+            Form.api.bindevent($("form[role=form]"), function(data, ret) {
+                if(ret.code==1){
+                    Backend.api.addtabs( ret.url,'得分分析');
+                }
+            });
+        },
+        analysis: function () {
+            Form.api.bindevent($("form[role=form]"), function(data, ret) {
+                if(ret.code==1){
+                    Backend.api.addtabs( ret.url);
+                }
+            });
+        },
         edit: function () {
             Controller.api.bindevent();
         },

+ 10 - 0
public/assets/js/require-table.js

@@ -783,11 +783,21 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                     return Table.api.formatter.normal.call(this, value, row, index);
                 },
                 simtype: function (value, row, index) {
+
                     var custom = {'0001': 'success', '0002': 'info', '0003': 'warning'};
                     if (typeof this.custom !== 'undefined') {
                         custom = $.extend(custom, this.custom);
                     }
                     this.custom = custom;
+                    return Table.api.formatter.normal.call(this, value, row, index);
+                },
+               // ["primary", "success", "danger", "warning", "info", "gray", "red", "yellow", "aqua", "blue", "navy", "teal", "olive", "lime", "fuchsia", "purple", "maroon"];
+                simexamstatus: function (value, row, index) {
+                    var custom = {'0': 'gray', '1': 'info', '2': 'danger', '3': 'success','4': 'warning','5': 'warning','6': 'navy','7': 'blue','80': 'red','81': 'yellow','90': 'maroon'};
+                    if (typeof this.custom !== 'undefined') {
+                        custom = $.extend(custom, this.custom);
+                    }
+                    this.custom = custom;
                     this.icon = 'fa fa-circle';
                     return Table.api.formatter.normal.call(this, value, row, index);
                 },