Browse Source

使用考试培训项目覆盖

lizhen 5 ngày trước cách đây
mục cha
commit
ddc392d1d0
64 tập tin đã thay đổi với 1001 bổ sung636 xóa
  1. 5 4
      application/admin/controller/exam/Cate.php
  2. 7 5
      application/admin/controller/exam/Dashboard.php
  3. 7 14
      application/admin/controller/exam/Grade.php
  4. 80 92
      application/admin/controller/exam/Paper.php
  5. 10 41
      application/admin/controller/exam/Question.php
  6. 4 12
      application/admin/controller/exam/RoomGrade.php
  7. 3 1
      application/admin/lang/zh-cn/exam/grade.php
  8. 4 1
      application/admin/lang/zh-cn/exam/paper.php
  9. 1 1
      application/admin/model/exam/CateModel.php
  10. 0 33
      application/admin/model/exam/PaperModel.php
  11. 14 48
      application/admin/model/exam/QuestionModel.php
  12. 18 20
      application/admin/model/exam/QuestionWrongModel.php
  13. 1 2
      application/admin/model/exam/RoomGradeModel.php
  14. 8 11
      application/admin/view/exam/cate/add.html
  15. 7 7
      application/admin/view/exam/cate/edit.html
  16. 1 1
      application/admin/view/exam/cate/index.html
  17. 2 2
      application/admin/view/exam/cate/recyclebin.html
  18. 1 1
      application/admin/view/exam/config_info/ad.html
  19. 1 1
      application/admin/view/exam/config_info/index.html
  20. 1 1
      application/admin/view/exam/correction_question/add.html
  21. 1 1
      application/admin/view/exam/correction_question/edit.html
  22. 1 1
      application/admin/view/exam/correction_question/index.html
  23. 13 158
      application/admin/view/exam/dashboard/index.html
  24. 16 9
      application/admin/view/exam/grade/detail.html
  25. 394 0
      application/admin/view/exam/grade/detailnew.html
  26. 2 2
      application/admin/view/exam/manual_grade/add.html
  27. 2 2
      application/admin/view/exam/manual_grade/edit.html
  28. 1 1
      application/admin/view/exam/manual_grade/index.html
  29. 1 1
      application/admin/view/exam/manual_room_grade/add.html
  30. 1 1
      application/admin/view/exam/manual_room_grade/edit.html
  31. 1 1
      application/admin/view/exam/manual_room_grade/index.html
  32. 1 1
      application/admin/view/exam/notice/add.html
  33. 1 1
      application/admin/view/exam/notice/edit.html
  34. 1 1
      application/admin/view/exam/notice/index.html
  35. 51 15
      application/admin/view/exam/paper/add.html
  36. 6 6
      application/admin/view/exam/paper/configs_setting.html
  37. 8 12
      application/admin/view/exam/paper/configs_setting_fix.html
  38. 34 12
      application/admin/view/exam/paper/edit.html
  39. 1 14
      application/admin/view/exam/paper/extend.html
  40. 1 1
      application/admin/view/exam/paper/index.html
  41. 25 0
      application/admin/view/exam/paper/nograde.html
  42. 2 2
      application/admin/view/exam/paper/recyclebin.html
  43. 24 0
      application/admin/view/exam/paper/selectuser.html
  44. 5 5
      application/admin/view/exam/question/add-bak.html
  45. 11 8
      application/admin/view/exam/question/add.html
  46. 5 5
      application/admin/view/exam/question/edit-bak.html
  47. 11 8
      application/admin/view/exam/question/edit.html
  48. 1 1
      application/admin/view/exam/question/import.html
  49. 1 6
      application/admin/view/exam/question/index.html
  50. 2 2
      application/admin/view/exam/question/recyclebin.html
  51. 1 1
      application/admin/view/exam/question/select.html
  52. 5 5
      application/admin/view/exam/room/add.html
  53. 5 5
      application/admin/view/exam/room/edit.html
  54. 1 1
      application/admin/view/exam/room/index.html
  55. 2 2
      application/admin/view/exam/room_grade/add.html
  56. 5 5
      application/admin/view/exam/room_grade/detail.html
  57. 2 2
      application/admin/view/exam/room_grade/edit.html
  58. 1 1
      application/admin/view/exam/room_signup/add.html
  59. 1 1
      application/admin/view/exam/room_signup/edit.html
  60. 1 1
      application/admin/view/exam/room_signup/index.html
  61. 18 3
      public/assets/js/backend/exam/cate.js
  62. 19 7
      public/assets/js/backend/exam/grade.js
  63. 121 9
      public/assets/js/backend/exam/paper.js
  64. 20 18
      public/assets/js/backend/exam/question.js

+ 5 - 4
application/admin/controller/exam/Cate.php

@@ -8,6 +8,7 @@ use fast\Tree;
 use think\Db;
 use think\exception\PDOException;
 use think\exception\ValidateException;
+use think\Exception;
 
 /**
  * 试题分类
@@ -263,14 +264,14 @@ class Cate extends Backend
             // 编辑时
             if ($row) {
                 if ($params['parent_id'] == $row['id']) {
-                    throw new \Exception('不能将当前分类设置为父级分类');
+                    throw new Exception('不能将当前分类设置为父级分类');
                 }
                 if ($parent['kind'] != $params['kind']) {
-                    throw new \Exception('不能将当前分类设置为其他种类的下级');
+                    throw new Exception('不能将当前分类设置为其他种类的下级');
                 }
                 $child_ids = CateModel::where('parent_id', $row['id'])->column('id');
                 if (in_array($params['parent_id'], $child_ids)) {
-                    throw new \Exception('不能将当前分类的子级设置为当前分类的父级');
+                    throw new Exception('不能将当前分类的子级设置为当前分类的父级');
                 }
             }
 
@@ -279,7 +280,7 @@ class Cate extends Backend
             } else if ($parent['level'] == 2) {
                 $params['level'] = 3;
             } else {
-                throw new \Exception('错误:最多添加3级分类,请重新选择父级类别');
+                throw new Exception('最多添加3级分类,请重新选择父级类别');
             }
         }
     }

+ 7 - 5
application/admin/controller/exam/Dashboard.php

@@ -13,7 +13,7 @@ use app\admin\model\exam\RoomModel;
 use app\admin\model\exam\RoomSignupModel;
 use app\common\controller\Backend;
 use fast\Date;
-
+use think\Db;
 /**
  * 控制台
  * @icon   fa fa-dashboard
@@ -60,18 +60,20 @@ class Dashboard extends Backend
             'total_question_count'          => QuestionModel::where('status', CommonStatus::NORMAL)->count(),
             // 总试卷数
             'total_paper_count'             => PaperModel::where('status', CommonStatus::NORMAL)->count(),
+            //总培训数
+            'total_peixun_count'             => Db::name('train_active')->where('deletetime',null)->count(),
             // 总考场数
-            'total_room_count'              => RoomModel::where('status', CommonStatus::NORMAL)->count(),
+//            'total_room_count'              => RoomModel::where('status', CommonStatus::NORMAL)->count(),
             // 总参与考试次数
             'total_exam_user_count'         => GradeModel::count(),
             // 今日参与考试次数
             'today_exam_user_count'         => GradeModel::where('createtime', '>', $today_time)->count(),
             // 总参与考场考试次数
-            'total_room_user_count'         => RoomGradeModel::count(),
+//            'total_room_user_count'         => RoomGradeModel::count(),
             // 今日参与考场考试次数
-            'today_room_user_count'         => RoomGradeModel::where('createtime', '>', $today_time)->count(),
+//            'today_room_user_count'         => RoomGradeModel::where('createtime', '>', $today_time)->count(),
             // 待处理报名数量
-            'total_wait_apply_signup_count' => RoomSignupModel::where('status', RoomSignupStatus::WAIT)->count(),
+//            'total_wait_apply_signup_count' => RoomSignupModel::where('status', RoomSignupStatus::WAIT)->count(),
         ]);
 
         $this->assignconfig('column', array_keys($user_list));

+ 7 - 14
application/admin/controller/exam/Grade.php

@@ -8,7 +8,6 @@ use app\common\controller\Backend;
 
 /**
  * 考试成绩
- *
  * @icon fa fa-circle-o
  */
 class Grade extends Backend
@@ -18,7 +17,6 @@ class Grade extends Backend
 
     /**
      * GradeModel模型对象
-     *
      * @var \app\admin\model\exam\GradeModel
      */
     protected $model = null;
@@ -53,7 +51,7 @@ class Grade extends Backend
             if ($this->request->request('keyField')) {
                 return $this->selectpage();
             }
-            [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
 
             $list = $this->model
                 ->with(['cate', 'paper', 'user'])
@@ -67,7 +65,7 @@ class Grade extends Backend
                 $row->getRelation('paper')->visible(['title']);
             }
 
-            $result = ["total" => $list->total(), "rows" => $list->items()];
+            $result = array("total" => $list->total(), "rows" => $list->items());
 
             return json($result);
         }
@@ -91,7 +89,8 @@ class Grade extends Backend
         }
 
         $this->view->assign("row", $row);
-        return $this->view->fetch();
+        $this->view->engine->layout(false);
+        return $this->view->fetch('detailnew');
     }
 
     /**
@@ -105,7 +104,6 @@ class Grade extends Backend
 
     /**
      * 获取并处理详情数据
-     *
      * @param $ids
      * @return \app\admin\model\exam\GradeModel|array
      */
@@ -126,17 +124,12 @@ class Grade extends Backend
             // 合并材料题子题目
             $row['questions'] = QuestionModel::mergeMaterialQuestions($row['questions']);
         } else {
-            $row['questions'] = QuestionModel::whereIn('id', $row['question_ids'])
-                ->orderRaw("find_in_set(id, '" . $row['question_ids'] . "')")
-                ->select();
+            $row['questions'] = QuestionModel::whereIn('id', $row['question_ids'])->orderRaw("find_in_set(id, '" . $row['question_ids'] . "')")->select();
         }
         $row['user_answers']    = json_decode($row['user_answers'], true);
         $row['configs']         = json_decode($row['configs'], true);
-        $row['createtime_text'] = date('Y-m-d H:i:s', $row['createtime']);
-
-        // 及格线
-        $row['pass_score'] = $row['pass_score'] ?: $row['paper']['pass_score'];
-
+        $row['finishtime_text'] = date('Y-m-d H:i:s', $row['finish_time']);
+        
         return $row;
     }
 }

+ 80 - 92
application/admin/controller/exam/Paper.php

@@ -9,13 +9,10 @@ use app\common\controller\Backend;
 use think\Db;
 use think\exception\PDOException;
 use think\exception\ValidateException;
-use think\exception\DbException;
-use think\db\exception\DataNotFoundException;
-use think\db\exception\ModelNotFoundException;
-
+use app\common\model\Usergangwei;
+use fast\Tree;
 /**
  * 试卷
- *
  * @icon fa fa-circle-o
  */
 class Paper extends Backend
@@ -23,11 +20,10 @@ class Paper extends Backend
 
     /**
      * PaperModel模型对象
-     *
      * @var \app\admin\model\exam\PaperModel
      */
     protected $model = null;
-
+    protected $noNeedRight = ['nograde','selectuser'];
     public function _initialize()
     {
         parent::_initialize();
@@ -35,6 +31,12 @@ class Paper extends Backend
         $this->view->assign("modeList", $this->model->getModeList());
         $this->view->assign("kindList", $this->model->getKindList());
         $this->view->assign("statusList", $this->model->getStatusList());
+
+        //岗位
+        $tree = Tree::instance();
+        $tree->init(Usergangwei::getCategoryArray(), 'pid');
+        $gangweilist = $tree->getTreeList($tree->getTreeArray(0), 'name');
+        $this->view->assign("gangweilist", $gangweilist);
     }
 
 
@@ -60,7 +62,7 @@ class Paper extends Backend
             if ($this->request->request('keyField')) {
                 return $this->selectpage();
             }
-            [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
 
             $list = $this->model
                 ->with(['cate'])
@@ -73,7 +75,7 @@ class Paper extends Backend
                 $row->getRelation('cate')->visible(['name']);
             }
 
-            $result = ["total" => $list->total(), "rows" => $list->items()];
+            $result = array("total" => $list->total(), "rows" => $list->items());
 
             return json($result);
         }
@@ -192,63 +194,11 @@ class Paper extends Backend
     }
 
     /**
-     * 删除
-     *
-     * @param $ids
-     * @return void
-     * @throws DbException
-     * @throws DataNotFoundException
-     * @throws ModelNotFoundException
-     */
-    public function del($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'));
-        }
-        $pk       = $this->model->getPk();
-        $adminIds = $this->getDataLimitAdminIds();
-        if (is_array($adminIds)) {
-            $this->model->where($this->dataLimitField, 'in', $adminIds);
-        }
-        $list = $this->model->where($pk, 'in', $ids)->select();
-
-        foreach ($list as $item) {
-            if ($this->model::getGradeCount($item['id'])) {
-                $this->error("试卷【{$item['title']}】已有考试记录,无法删除");
-            }
-            if ($this->model::getRoomGradeCount($item['id'])) {
-                $this->error("试卷【{$item['title']}】已有考场考试记录,无法删除");
-            }
-        }
-
-        $count = 0;
-        Db::startTrans();
-        try {
-            foreach ($list as $item) {
-                $count += $item->delete();
-            }
-            Db::commit();
-        } catch (PDOException|Exception $e) {
-            Db::rollback();
-            $this->error($e->getMessage());
-        }
-        if ($count) {
-            $this->success();
-        }
-        $this->error(__('No rows were deleted'));
-    }
-
-    /**
      * 验证参数
-     *
      * @param $params
      * @return void
      */
-    protected function valid(&$params, $row = null)
+    protected function valid(&$params)
     {
         if ($params['pass_score'] > $params['total_score']) {
             $this->error('及格分数不能大于总分');
@@ -290,39 +240,10 @@ class Paper extends Backend
             $limit_time += $params['limit_time_minute'] * 60;
         }
         $params['limit_time'] = $limit_time;
-
-        // 编辑时
-        if ($row) {
-            $grade_count      = $this->model::getGradeCount($row['id']);
-            $room_grade_count = $this->model::getRoomGradeCount($row['id']);
-
-            // 如果已有考试记录,不允许修改试卷主要数据
-            if ($grade_count > 0 || $room_grade_count > 0) {
-                if ($params['title'] != $row['title']) {
-                    $this->error('试卷已有考试记录(含考场考试记录),不允许修改试卷名称');
-                }
-                if ($params['mode'] != $row['mode']) {
-                    $this->error('试卷已有考试记录(含考场考试记录),不允许修改试卷选题模式');
-                }
-                if ($params['quantity'] != $row['quantity']) {
-                    $this->error('试卷已有考试记录(含考场考试记录),不允许修改试卷题目数');
-                }
-                if ($params['total_score'] != $row['total_score']) {
-                    $this->error('试卷已有考试记录(含考场考试记录),不允许修改试卷总分');
-                }
-                if ($params['pass_score'] != $row['pass_score']) {
-                    $this->error('试卷已有考试记录(含考场考试记录),不允许修改及格分数');
-                }
-                if ($params['limit_time'] != $row['limit_time']) {
-                    $this->error('试卷已有考试记录(含考场考试记录),不允许修改考试限时');
-                }
-            }
-        }
     }
 
     /**
      * 保存固定选题
-     *
      * @param $paper
      * @param $params
      * @return void
@@ -340,16 +261,83 @@ class Paper extends Backend
         $questions = $params['questions'];
         $data      = [];
         foreach ($questions as $key => $question) {
+            // $item = [
+            //     'paper_id'    => $paper['id'],
+            //     'question_id' => $question['id'],
+            //     'score'       => $question['score'],
+            //     'sort'        => $key + 1,
+            //     'createtime'  => time(),
+            // ];
+            //
+            // if ($question['kind'] == 'SHORT') {
+            //     $item['answer'] = $question['answer'];
+            // }
+
+            // $data[] = $item;
             $data[] = [
                 'paper_id'      => $paper['id'],
                 'question_id'   => $question['id'],
                 'score'         => $question['score'],
                 'answer_config' => is_array($question['answer']) ? json_encode($question['answer'], JSON_UNESCAPED_UNICODE) : $question['answer'],
-                'sort'          => $question['sort'] ?? ($key + 1),
+                'sort'          => $key + 1,
                 'createtime'    => time(),
             ];
         }
 
         (new PaperQuestionModel())->saveAll($data);
     }
+
+    /**
+     * 缺考用户
+     */
+    public function nograde(){
+        $id = input('id');
+        $info = Db::name('exam_paper')->where('id',$id)->find();
+        $user_ids = $info['user_ids'];
+
+        $grade_uids = Db::name('exam_grade')->where('paper_id',$id)->where('status',2)->column('user_id');
+
+        $lists = Db::name('user')->where('id','IN',$user_ids)->where('id','NOTIN',$grade_uids)->select();
+        $this->assign('lists',$lists);
+        return $this->view->fetch();
+    }
+
+    /**
+     * 选人
+     */
+    public function selectuser(){
+
+        $id = input('id');
+
+        if($this->request->isPost()){
+            $params = $this->request->post('row/a');
+            $user_rule = explode(',',$params['user_rule']);
+
+            $user_ids = [];
+            foreach($user_rule as $key => $val){
+                if(strpos($val,'u_') !== false){
+                    $user_ids[] = substr($val,2);
+                }
+            }
+            $user_ids = implode(',',$user_ids);
+
+            $update = [
+                'user_ids' => $user_ids,
+                'user_rule' => $params['user_rule'],
+            ];
+            Db::name('exam_paper')->where('id',$id)->update($update);
+            $this->success('设置成功');
+        }
+
+        $id = input('id');
+        $row = Db::name('exam_paper')->where('id',$id)->find();
+
+        $user_rule = explode(',', $row['user_rule']);
+        $nodeList = \app\admin\model\User::getTreeList($user_rule);
+        $this->assign("nodeList", $nodeList);
+
+        $this->assign('row',$row);
+        return $this->view->fetch();
+    }
+
 }

+ 10 - 41
application/admin/controller/exam/Question.php

@@ -18,7 +18,6 @@ use think\Session;
 
 /**
  * 试题
- *
  * @icon fa fa-circle-o
  */
 class Question extends Backend
@@ -26,7 +25,6 @@ class Question extends Backend
 
     /**
      * QuestionModel模型对象
-     *
      * @var \app\admin\model\exam\QuestionModel
      */
     protected $model = null;
@@ -65,7 +63,7 @@ class Question extends Backend
             if ($this->request->request('keyField')) {
                 return $this->selectpage();
             }
-            [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
 
             $list = $this->model
                 ->with(['cate'])
@@ -74,32 +72,11 @@ class Question extends Backend
                 ->paginate($limit);
 
             foreach ($list as $row) {
-                if (isset($row['cate'])) {
-                    $row->getRelation('cate')->visible(['name']);
-                }
-            }
 
-            $count = $list->total();
-            $items = $list->items();
-
-            // 检测是否有重复题目
-            foreach ($items as &$question) {
-                $title = str_replace(' ', '', $question['title']);;
-                $question['is_repeat'] = 0;
-
-                foreach ($items as $item) {
-                    if ($item['id'] != $question['id']) {
-                        $title2 = str_replace(' ', '', $item['title']);
-                        if ($title == $title2) {
-                            // 标记重复
-                            $question['is_repeat'] = 1;
-                            break;
-                        }
-                    }
-                }
+                $row->getRelation('cate')->visible(['name']);
             }
 
-            $result = ["total" => $count, "rows" => $items];
+            $result = array("total" => $list->total(), "rows" => $list->items());
 
             return json($result);
         }
@@ -178,9 +155,9 @@ class Question extends Backend
                 return $query->with([
                     'question' => function ($query) {
                         return $query->with('cates');
-                    },
+                    }
                 ])->order('weigh');
-            },
+            }
         ]);
 
         // dd($row->toArray());
@@ -246,7 +223,6 @@ class Question extends Backend
 
     /**
      * 选项图片页面
-     *
      * @return string
      */
     public function image()
@@ -498,7 +474,6 @@ class Question extends Backend
 
     /**
      * 试题导入提交
-     *
      * @return string|void
      */
     public function import()
@@ -556,12 +531,11 @@ class Question extends Backend
             if ($this->request->request('keyField')) {
                 return $this->selectpage();
             }
-            [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
 
             $list = $this->model
                 ->with(['cate'])
                 ->where($where)
-                ->where('status', CommonStatus::NORMAL)
                 ->order($sort, $order)
                 ->paginate($limit);
 
@@ -573,7 +547,7 @@ class Question extends Backend
                 $row['title'] = strip_tags($row['title']);
             }
 
-            $result = ["total" => $list->total(), "rows" => $rows];
+            $result = array("total" => $list->total(), "rows" => $rows);
 
             return json($result);
         }
@@ -587,7 +561,6 @@ class Question extends Backend
 
     /**
      * 检查答案输入
-     *
      * @param $params
      */
     protected function checkAnswer(&$params)
@@ -658,7 +631,7 @@ class Question extends Backend
                 // 转json
                 $params['answer'] = json_encode([
                     'answer' => $answer,
-                    'config' => $answer_config,
+                    'config' => $answer_config
                 ], JSON_UNESCAPED_UNICODE);
                 break;
 
@@ -687,7 +660,7 @@ class Question extends Backend
 
                 // 转json
                 $params['answer'] = json_encode([
-                    'questions' => $params['material_questions'],
+                    'questions' => $params['material_questions']
                 ], JSON_UNESCAPED_UNICODE);
                 break;
         }
@@ -705,7 +678,6 @@ class Question extends Backend
 
     /**
      * 保存材料题父题
-     *
      * @param $question
      * @return void
      */
@@ -726,7 +698,7 @@ class Question extends Backend
                             'score'         => $question['material_score'],
                             'answer'        => is_array($question['answer']) ? json_encode($question['answer'], JSON_UNESCAPED_UNICODE) : $question['answer'],
                             'answer_config' => null,
-                        ],
+                        ]
                     ],
                 ];
             } else {
@@ -778,7 +750,6 @@ class Question extends Backend
 
     /**
      * 保存材料题子题
-     *
      * @param $parentQuestion
      * @param $questions
      * @return void
@@ -808,7 +779,6 @@ class Question extends Backend
 
     /**
      * 处理选项图片链接域名
-     *
      * @param $data
      */
     protected function optionsImage(&$data)
@@ -827,7 +797,6 @@ class Question extends Backend
 
     /**
      * 检查题目内容输入
-     *
      * @param $params
      */
     protected function checkTitle(&$params)

+ 4 - 12
application/admin/controller/exam/RoomGrade.php

@@ -7,16 +7,14 @@ use app\common\controller\Backend;
 
 /**
  * 考场考试成绩
- *
  * @icon fa fa-circle-o
  */
 class RoomGrade extends Backend
 {
-    protected $noNeedRight = ['*'];
+    protected $noNeedRight = ['index'];
 
     /**
      * RoomGradeModel模型对象
-     *
      * @var \app\admin\model\exam\RoomGradeModel
      */
     protected $model = null;
@@ -52,7 +50,7 @@ class RoomGrade extends Backend
             if ($this->request->request('keyField')) {
                 return $this->selectpage();
             }
-            [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
 
             $list = $this->model
                 ->with(['user', 'cate', 'room', 'paper', 'signup1'])
@@ -68,7 +66,7 @@ class RoomGrade extends Backend
                 $row->getRelation('paper')->visible(['title']);
             }
 
-            $result = ["total" => $list->total(), "rows" => $list->items()];
+            $result = array("total" => $list->total(), "rows" => $list->items());
 
             return json($result);
         }
@@ -99,16 +97,10 @@ class RoomGrade extends Backend
             $this->error('答卷数据缺少,无法查看(可能是旧版本未记录数据导致)');
         }
 
-        $row['questions']       = QuestionModel::whereIn('id', $row['question_ids'])
-            ->orderRaw("find_in_set(id, '" . $row['question_ids'] . "')")
-            ->select();
+        $row['questions']       = QuestionModel::whereIn('id', $row['question_ids'])->orderRaw("find_in_set(id, '" . $row['question_ids'] . "')")->select();
         $row['user_answers']    = json_decode($row['user_answers'], true);
         $row['configs']         = json_decode($row['configs'], true);
         $row['createtime_text'] = date('Y-m-d H:i:s', $row['createtime']);
-
-        // 及格线
-        $row['pass_score'] = $row['pass_score'] ?: $row['paper']['pass_score'];
-
         $this->view->assign("row", $row);
         return $this->view->fetch();
     }

+ 3 - 1
application/admin/lang/zh-cn/exam/grade.php

@@ -14,5 +14,7 @@ return [
     'Createtime'  => '创建时间',
     'Updatetime'  => '修改时间',
     'Cate.name'   => '名称',
-    'Paper.title' => '试卷名称'
+    'Paper.title' => '试卷名称',
+    'Start_time'  => '开考时间',
+    'Finish_time'  => '交卷时间',
 ];

+ 4 - 1
application/admin/lang/zh-cn/exam/paper.php

@@ -1,10 +1,11 @@
 <?php
 
 return [
-    'Cate_id'         => '试卷分类',
+    'Cate_id'         => '所属题库',
     'Mode'            => '选题模式',
     'Kind'            => '选题模式',
     'Title'           => '试卷名称',
+    'Image'           => '封面图',
     'Configs'         => '选题配置',
     'Quantity'        => '题目数量',
     'Total_score'     => '试卷总分',
@@ -20,4 +21,6 @@ return [
     'Start_time'      => '使用开始时间',
     'End_time'        => '使用结束时间',
     'Is_only_room'    => '仅用于考场',
+    'Limit_count'     => '每人限制考试次数',
+    'User_ids'        => '可参与人员',
 ];

+ 1 - 1
application/admin/model/exam/CateModel.php

@@ -52,8 +52,8 @@ class CateModel extends BaseModel
         return [
             'QUESTION' => __('Question'),
             'ROOM'     => __('Room'),
-            'PAPER'    => __('Paper'),
             // 'COURSE'   => __('Course'),
+            // 'PAPER' => __('Paper'),
         ];
     }
 

+ 0 - 33
application/admin/model/exam/PaperModel.php

@@ -96,7 +96,6 @@ class PaperModel extends BaseModel
 
     /**
      * 试卷不同类型或难度题的分数
-     *
      * @param $configs
      * @param $kind
      * @param $difficulty
@@ -112,36 +111,4 @@ class PaperModel extends BaseModel
 
         return $config['score'];
     }
-
-    /**
-     * 获取试卷考试成绩数量
-     *
-     * @param $paper_id
-     * @return int|string
-     * @throws \think\Exception
-     */
-    public static function getGradeCount($paper_id)
-    {
-        if (!$paper_id) {
-            return 0;
-        }
-
-        return GradeModel::where('paper_id', $paper_id)->count();
-    }
-
-    /**
-     * 获取试卷考场考试成绩数量
-     *
-     * @param $paper_id
-     * @return int|string
-     * @throws \think\Exception
-     */
-    public static function getRoomGradeCount($paper_id)
-    {
-        if (!$paper_id) {
-            return 0;
-        }
-
-        return RoomGradeModel::where('paper_id', $paper_id)->count();
-    }
 }

+ 14 - 48
application/admin/model/exam/QuestionModel.php

@@ -37,7 +37,7 @@ class QuestionModel extends BaseModel
             'explain_video_url',
         ];
 
-    const kindList       = ['JUDGE', 'SINGLE', 'MULTI', 'FILL', 'SHORT', 'MATERIAL'];
+    const kindList       = ['JUDGE', 'SINGLE', 'MULTI', /*'FILL',*/ 'SHORT', /*'MATERIAL'*/];
     const difficultyList = ['EASY', 'GENERAL', 'HARD'];
     const statusList     = ['NORMAL', 'HIDDEN'];
 
@@ -47,9 +47,9 @@ class QuestionModel extends BaseModel
             'JUDGE'    => '判断题',
             'SINGLE'   => '单选题',
             'MULTI'    => '多选题',
-            'FILL'     => '填空题',
+//            'FILL'     => '填空题',
             'SHORT'    => '简答题',
-            'MATERIAL' => '材料题',
+//            'MATERIAL' => '材料题',
         ];
     }
 
@@ -111,7 +111,6 @@ class QuestionModel extends BaseModel
 
     /**
      * 材料题子题目
-     *
      * @return \think\model\relation\HasMany
      */
     public function materialQuestions()
@@ -145,7 +144,6 @@ class QuestionModel extends BaseModel
 
     /**
      * 获取多题库下各类题型的不同难度题数
-     *
      * @param $cate_ids
      * @return array|bool|\PDOStatement|string|Model|null
      */
@@ -154,7 +152,6 @@ class QuestionModel extends BaseModel
         return Db::name($this->name)
             ->whereIn('cate_id', $cate_ids)
             ->where('is_material_child', 0) // 材料题子题不计入总数
-            ->where('status', 'NORMAL')
             ->whereNull('deletetime')
             ->field("
                 COUNT(id) as 'total', 
@@ -222,7 +219,6 @@ class QuestionModel extends BaseModel
 
     /**
      * 获取题目列表
-     *
      * @param string $cates 分类ID,多个逗号隔开
      * @param string $kind  题型
      * @param array  $with  关联模型
@@ -239,7 +235,6 @@ class QuestionModel extends BaseModel
 
     /**
      * 获取试卷固定题目
-     *
      * @param int   $paper_id 试卷ID
      * @param array $with     关联模型
      * @return bool|\PDOStatement|string|Collection
@@ -255,7 +250,7 @@ class QuestionModel extends BaseModel
             ->where('pq.paper_id', $paper_id)
             ->where('is_material_child', 0)
             ->field('question_model.*, pq.score, pq.sort, pq.answer_config')
-            ->order('pq.sort', 'desc')
+            ->order('pq.sort', 'asc')
             ->select();
 
         foreach ($questions as &$question) {
@@ -271,7 +266,8 @@ class QuestionModel extends BaseModel
     }
 
     /**
-     * 记录错题
+     * 记录错题。
+     * 没用到,改用下面的方法了
      */
     public function logWrong($user_id, $user_answer = null)
     {
@@ -316,60 +312,30 @@ class QuestionModel extends BaseModel
 
     /**
      * 记录错题
-     *
-     * @param string $question_kind 题型
-     * @param int    $question_id   题目ID
-     * @param int    $user_id       用户ID
-     * @param null   $user_answer   用户答案
-     * @param string $source        来源:PAPER=试卷,ROOM=考场,TRAINING=练题
-     * @return mixed
      */
-    public static function recordWrong($question_kind, $question_id, $user_id, $user_answer = null, $source = 'PAPER', $source_data = [])
+    public static function recordWrong($question_id, $user_id, $user_answer = null)
     {
         if (is_array($user_answer)) {
             $user_answer = json_encode($user_answer, JSON_UNESCAPED_UNICODE);
         } else if (is_string($user_answer)) {
             $user_answer = trim($user_answer);
-            if (in_array($question_kind, ['JUDGE', 'SINGLE', 'MULTI'])) {
-                $user_answer = strtoupper($user_answer);
-            } else if (strpos($user_answer, ',')) {
+            if (strpos($user_answer, ',')) {
                 $user_answer = json_encode(explode(',', $user_answer), JSON_UNESCAPED_UNICODE);
             }
         } else {
             $user_answer = null;
         }
 
-        // 按每次错题记录
-        return QuestionWrongModel::create(
+        return QuestionWrongModel::updateOrCreate(
+            [
+                'user_id'     => $user_id,
+                'question_id' => $question_id,
+            ],
             [
                 'user_id'     => $user_id,
                 'question_id' => $question_id,
-                'user_answer' => $user_answer,
-                'kind'        => $source,
-                'cate_id'     => $source_data['cate_id'] ?? 0,
-                'paper_id'    => $source_data['paper_id'] ?? 0,
-                'room_id'     => $source_data['room_id'] ?? 0,
+                'user_answer' => $user_answer, //is_array($user_answer) ? json_encode($user_answer, JSON_UNESCAPED_UNICODE) : $user_answer,
             ]
         );
-        // 相同题目仅记录最后一次错题
-        // return QuestionWrongModel::updateOrCreate(
-        //     [
-        //         'user_id'     => $user_id,
-        //         'question_id' => $question_id,
-        //         'kind'        => $source,
-        //         'cate_id'     => $source_data['cate_id'] ?? 0,
-        //         'paper_id'    => $source_data['paper_id'] ?? 0,
-        //         'room_id'     => $source_data['room_id'] ?? 0,
-        //     ],
-        //     [
-        //         'user_id'     => $user_id,
-        //         'question_id' => $question_id,
-        //         'user_answer' => $user_answer, //is_array($user_answer) ? json_encode($user_answer, JSON_UNESCAPED_UNICODE) : $user_answer,
-        //         'kind'        => $source,
-        //         'cate_id'     => $source_data['cate_id'] ?? 0,
-        //         'paper_id'    => $source_data['paper_id'] ?? 0,
-        //         'room_id'     => $source_data['room_id'] ?? 0,
-        //     ]
-        // );
     }
 }

+ 18 - 20
application/admin/model/exam/QuestionWrongModel.php

@@ -19,33 +19,31 @@ class QuestionWrongModel extends BaseModel
     protected $deleteTime = false;
 
     // 追加属性
-    protected $append = [
-        'user_answer',
-    ];
+    protected $append
+        = [
+            'user_answer',
+        ];
 
-    public function getUserAnswerAttr($value, $data)
-    {
-        $user_answer = json_decode($data['user_answer'], true);
-        if (!$user_answer) {
-            if (is_string($data['user_answer'])) {
-                return $data['user_answer'];
-            }
-        }
-        return $user_answer;
-    }
+    protected $type
+        = [
+            'user_answer' => 'array',
+        ];
+
+    // public function getUserAnswerAttr($value, $data)
+    // {
+    //     return json_decode($data['user_answer'], true);
+    // }
 
     public function question()
     {
         return $this->belongsTo(\addons\exam\model\QuestionModel::class, 'question_id', 'id', [], 'LEFT')->setEagerlyType(0);
     }
 
-    public function paper()
-    {
-        return $this->belongsTo(PaperModel::class, 'paper_id');
-    }
-
-    public function room()
+    public static function add($user_id, $question_id)
     {
-        return $this->belongsTo(RoomModel::class, 'room_id');
+        return self::create([
+            'user_id'     => $user_id,
+            'question_id' => $question_id,
+        ]);
     }
 }

+ 1 - 2
application/admin/model/exam/RoomGradeModel.php

@@ -107,8 +107,7 @@ class RoomGradeModel extends BaseModel
 
     public function signup1()
     {
-        return $this->belongsTo(RoomSignupModel::class, 'user_id', 'user_id', [])->where('status', RoomSignupStatus::ACCEPT);
-        // return $this->belongsTo(RoomSignupModel::class, 'user_id', 'user_id', [], 'LEFT')->setEagerlyType(0)->where('status', RoomSignupStatus::ACCEPT);
+        return $this->belongsTo(RoomSignupModel::class, 'user_id', 'user_id', [], 'LEFT')->setEagerlyType(0)->where('status', RoomSignupStatus::ACCEPT);
     }
 
     /**

+ 8 - 11
application/admin/view/exam/cate/add.html

@@ -6,18 +6,15 @@
             <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
         </div>
     </div>
-    <div class='form-group '>
+   <!-- <div class='form-group'>
         <label class="control-label col-xs-12 col-sm-2">{:__('Kind')}:</label>
         <div class="col-xs-12 col-sm-8">
 
-            <select id="c-kind" data-rule="required" class="form-control selectpicker" name="row[kind]">
-                {foreach name="kindList" item="vo"}
-                <option value="{$key|htmlentities}" {in name="key" value="$Think.get.kind"}selected{/in}>{$vo|htmlentities}</option>
-                {/foreach}
-            </select>
+
 
         </div>
-    </div>
+    </div>-->
+    <input id="c-kind" type="hidden" name="row[kind]" value="QUESTION">
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Parent_id')}:</label>
         <div class="col-xs-12 col-sm-8">
@@ -25,10 +22,10 @@
             <select id="c-parent_id" data-rule="required" class="form-control selectpicker" name="row[parent_id]">
                 <option value="0" selected>无</option>
                 {foreach name="parentList" item="vo"}
-                <option data-type="{$vo.kind|htmlentities}" value="{$vo.id|htmlentities}">{$vo.name|htmlentities}</option>
+                <option data-type="{$vo.kind}" value="{$vo.id}">{$vo.name}</option>
                 {/foreach}
             </select>
-            <!--<input id="c-parent_id" data-source="cate/index" class="form-control selectpage" name="row[parent_id]"
+            <!--<input id="c-parent_id" data-source="exam/cate/selectpage" class="form-control selectpage" name="row[parent_id]"
                    type="text" value="">-->
         </div>
     </div>
@@ -52,12 +49,12 @@
             <input id="c-sort" data-rule="required" class="form-control" name="row[sort]" type="number" value="1">
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
         <div class="col-xs-12 col-sm-8">
             <textarea id="c-remark" class="form-control editor" name="row[remark]"></textarea>
         </div>
-    </div>
+    </div>-->
     <div class="form-group layer-footer">
         <label class="control-label col-xs-12 col-sm-2"></label>
         <div class="col-xs-12 col-sm-8">

+ 7 - 7
application/admin/view/exam/cate/edit.html

@@ -7,25 +7,25 @@
                    value="{$row.name|htmlentities}">
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Kind')}:</label>
         <div class="col-xs-12 col-sm-8">
 
             <select id="c-kind" data-rule="required" class="form-control selectpicker" name="row[kind]">
                 {foreach name="kindList" item="vo"}
-                <option value="{$key|htmlentities}" {in name="key" value="$row.kind" }selected{/in}>{$vo|htmlentities}</option>
+                <option value="{$key}" {in name="key" value="$row.kind" }selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
 
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Parent_id')}:</label>
         <div class="col-xs-12 col-sm-8">
             <select id="c-parent_id" data-rule="required" class="form-control selectpicker" name="row[parent_id]">
                 <option value="0">无</option>
                 {foreach name="parentList" item="vo"}
-                <option data-type="{$vo.kind|htmlentities}" value="{$vo.id|htmlentities}" {eq name="vo.id" value="$row.parent_id"}selected{/eq}>{$vo.name|htmlentities}</option>
+                <option data-type="{$vo.kind}" value="{$vo.id}" {eq name="vo.id" value="$row.parent_id"}selected{/eq}>{$vo.name}</option>
                 {/foreach}
             </select>
         </div>
@@ -51,15 +51,15 @@
                    value="{$row.sort|htmlentities}">
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
         <div class="col-xs-12 col-sm-8">
             <textarea id="c-remark" class="form-control editor" name="row[remark]">{$row.remark|htmlentities}</textarea>
-        </div>
+        </div>-->
     <div class="form-group layer-footer">
         <label class="control-label col-xs-12 col-sm-2"></label>
         <div class="col-xs-12 col-sm-8">
-            <input type="hidden" id="id" value="{$row.id|htmlentities}">
+            <input type="hidden" id="id" value="{$row.id}">
             <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
             <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
         </div>

+ 1 - 1
application/admin/view/exam/cate/index.html

@@ -4,7 +4,7 @@
         <ul class="nav nav-tabs">
             <li class="active"><a href="#all" data-toggle="tab">{:__('All')}</a></li>
             {foreach name="kindList" item="vo"}
-            <li><a href="#{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
+            <li><a href="#{$key}" data-toggle="tab">{$vo}</a></li>
             {/foreach}
         </ul>
 

+ 2 - 2
application/admin/view/exam/cate/recyclebin.html

@@ -8,9 +8,9 @@
                     <div id="toolbar" class="toolbar">
                         {:build_toolbar('refresh')}
                         <a class="btn btn-info btn-multi btn-disabled disabled {:$auth->check('exam/cate/restore')?'':'hide'}" href="javascript:;" data-url="exam/cate/restore" data-action="restore"><i class="fa fa-rotate-left"></i> {:__('Restore')}</a>
-                        <a class="btn btn-danger btn-multi btn-disabled disabled {:$auth->check('exam/cate/destroy')?'':'hide'}" href="javascript:;" data-url="exam/cate/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>
+                        <!--<a class="btn btn-danger btn-multi btn-disabled disabled {:$auth->check('exam/cate/destroy')?'':'hide'}" href="javascript:;" data-url="exam/cate/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>-->
                         <a class="btn btn-success btn-restoreall {:$auth->check('exam/cate/restore')?'':'hide'}" href="javascript:;" data-url="exam/cate/restore" title="{:__('Restore all')}"><i class="fa fa-rotate-left"></i> {:__('Restore all')}</a>
-                        <a class="btn btn-danger btn-destroyall {:$auth->check('exam/cate/destroy')?'':'hide'}" href="javascript:;" data-url="exam/cate/destroy" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>
+                        <!--<a class="btn btn-danger btn-destroyall {:$auth->check('exam/cate/destroy')?'':'hide'}" href="javascript:;" data-url="exam/cate/destroy" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>-->
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover"
                            data-operate-restore="{:$auth->check('exam/cate/restore')}"

+ 1 - 1
application/admin/view/exam/config_info/ad.html

@@ -216,7 +216,7 @@
     </div>
 
     <input type="hidden" name="type" value="ad">
-    <input type="hidden" name="config_id" {notempty name="$config_id" }value="{$config_id|htmlentities}" {/notempty}>
+    <input type="hidden" name="config_id" {notempty name="$config_id" }value="{$config_id}" {/notempty}>
     <div class="form-group layer-footer">
         <label class="control-label col-xs-12 col-sm-2"></label>
         <div class="col-xs-12 col-sm-8">

+ 1 - 1
application/admin/view/exam/config_info/index.html

@@ -21,7 +21,7 @@
 
 <div class="panel panel-default panel-intro">
     <div class="panel-heading">
-        <input type="hidden" id="config_id" {notempty name="config_id" }value="{$config_id|htmlentities}" {/notempty}>
+        <input type="hidden" id="config_id" {notempty name="config_id" }value="{$config_id}" {/notempty}>
 
         <ul class="nav nav-tabs" data-field="status">
             <li class="active"><a href="#t-system" data-toggle="tab">系统配置</a></li>

+ 1 - 1
application/admin/view/exam/correction_question/add.html

@@ -36,7 +36,7 @@
             
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="0"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label> 
             {/foreach}
             </div>
 

+ 1 - 1
application/admin/view/exam/correction_question/edit.html

@@ -36,7 +36,7 @@
             
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.status"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
             {/foreach}
             </div>
 

+ 1 - 1
application/admin/view/exam/correction_question/index.html

@@ -5,7 +5,7 @@
         <ul class="nav nav-tabs" data-field="status">
             <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
             {foreach name="statusList" item="vo"}
-            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
             {/foreach}
         </ul>
     </div>

+ 13 - 158
application/admin/view/exam/dashboard/index.html

@@ -180,38 +180,39 @@
                         <div class="sm-st clearfix">
                             <span class="sm-st-icon st-red"><i class="fa fa-users"></i></span>
                             <div class="sm-st-info">
-                                <span>{$total_user_count|htmlentities}</span>
+                                <span>{$total_user_count}</span>
                                 总用户数
                             </div>
                         </div>
                     </div>
                     <div class="col-sm-3 col-xs-6">
                         <div class="sm-st clearfix">
-                            <span class="sm-st-icon st-violet"><i class="fa fa-question-circle-o"></i></span>
+                            <span class="sm-st-icon st-green"><i class="fa fa-home"></i></span>
                             <div class="sm-st-info">
-                                <span>{$total_question_count|htmlentities}</span>
-                                总
+                                <span>{$total_peixun_count}</span>
+                                总培训
                             </div>
                         </div>
                     </div>
                     <div class="col-sm-3 col-xs-6">
                         <div class="sm-st clearfix">
-                            <span class="sm-st-icon st-blue"><i class="fa fa-newspaper-o"></i></span>
+                            <span class="sm-st-icon st-violet"><i class="fa fa-question-circle-o"></i></span>
                             <div class="sm-st-info">
-                                <span>{$total_paper_count|htmlentities}</span>
-                                总试卷
+                                <span>{$total_question_count}</span>
+                                总
                             </div>
                         </div>
                     </div>
                     <div class="col-sm-3 col-xs-6">
                         <div class="sm-st clearfix">
-                            <span class="sm-st-icon st-green"><i class="fa fa-home"></i></span>
+                            <span class="sm-st-icon st-blue"><i class="fa fa-newspaper-o"></i></span>
                             <div class="sm-st-info">
-                                <span>{$total_room_count|htmlentities}</span>
-                                总考场
+                                <span>{$total_paper_count}</span>
+                                总试卷
                             </div>
                         </div>
                     </div>
+
                 </div>
 
                 <div class="row">
@@ -226,7 +227,7 @@
                                     <div class="col-xs-6 stat-col">
                                         <div class="stat-icon"><i class="fa fa-rocket"></i></div>
                                         <div class="stat">
-                                            <div class="value"> {$today_exam_user_count|htmlentities}</div>
+                                            <div class="value"> {$today_exam_user_count}</div>
                                             <div class="name">今日参与试卷考试次数</div>
                                         </div>
                                         <div class="progress">
@@ -236,7 +237,7 @@
                                     <div class="col-xs-6  stat-col">
                                         <div class="stat-icon"><i class="fa fa-calendar"></i></div>
                                         <div class="stat">
-                                            <div class="value"> {$total_exam_user_count|htmlentities}</div>
+                                            <div class="value"> {$total_exam_user_count}</div>
                                             <div class="name"> 总参与试卷考试次数</div>
                                         </div>
                                         <div class="progress">
@@ -245,160 +246,14 @@
                                     </div>
 
 
-                                    <div class="col-xs-6 stat-col">
-                                        <div class="stat-icon"><i class="fa fa-vcard"></i></div>
-                                        <div class="stat">
-                                            <div class="value"> {$today_room_user_count|htmlentities}</div>
-                                            <div class="name">今日参与考场考试次数</div>
-                                        </div>
-                                        <div class="progress">
-                                            <div class="progress-bar progress-bar-success" style="width: 20%"></div>
-                                        </div>
-                                    </div>
-                                    <div class="col-xs-6 stat-col">
-                                        <div class="stat-icon"><i class="fa fa-calendar-plus-o"></i></div>
-                                        <div class="stat">
-                                            <div class="value"> {$total_room_user_count|htmlentities}</div>
-                                            <div class="name"> 总参与考场考试次数</div>
-                                        </div>
-                                        <div class="progress">
-                                            <div class="progress-bar progress-bar-success" style="width: 20%"></div>
-                                        </div>
-                                    </div>
 
-
-                                    <div class="col-xs-6 stat-col" id="signup_count" style="cursor: pointer;">
-                                        <div class="stat-icon"><i class="fa fa-pencil-square-o"></i></div>
-                                        <div class="stat">
-                                            <div class="value" id="total_wait_apply_signup_count">{$total_wait_apply_signup_count|htmlentities}</div>
-                                            <div class="name">待处理报名数量</div>
-                                        </div>
-                                        <div class="progress">
-                                            <div class="progress-bar progress-bar-success" style="width: 20%"></div>
-                                        </div>
-                                    </div>
-                                    <!--<div class="col-xs-6  stat-col">
-                                        <div class="stat-icon"><i class="fa fa-user-circle-o"></i></div>
-                                        <div class="stat">
-                                            <div class="value"> {$today_exam_user_count|htmlentities}</div>
-                                            <div class="name"> {:__('Thirty dau')}</div>
-                                        </div>
-                                        <div class="progress">
-                                            <div class="progress-bar progress-bar-success" style="width: 20%"></div>
-                                        </div>
-                                    </div>-->
                                 </div>
                             </div>
                         </div>
                     </div>
                 </div>
 
-                <!--<div class="row" style="margin-top:15px;" id="statistics">
 
-                    <div class="col-lg-12">
-                    </div>
-                    <div class="col-xs-6 col-md-3">
-                        <div class="panel bg-blue-gradient no-border">
-                            <div class="panel-body">
-                                <div class="panel-title">
-                                    <span class="label label-primary pull-right">{:__('Real time')}</span>
-                                    <h5>{:__('Working addon count')}</h5>
-                                </div>
-                                <div class="panel-content">
-                                    <div class="row">
-                                        <div class="col-md-12">
-                                            <h1 class="no-margins">{$today_exam_user_count|htmlentities}</h1>
-                                            <div class="font-bold"><i class="fa fa-magic"></i>
-                                                <small>{:__('Working addon count tips')}</small>
-                                            </div>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="col-xs-6 col-md-3">
-                        <div class="panel bg-teal-gradient no-border">
-                            <div class="panel-body">
-                                <div class="ibox-title">
-                                    <span class="label label-primary pull-right">{:__('Real time')}</span>
-                                    <h5>{:__('Database count')}</h5>
-                                </div>
-                                <div class="ibox-content">
-                                    <div class="row">
-                                        <div class="col-md-6">
-                                            <h1 class="no-margins">{$today_exam_user_count|htmlentities}</h1>
-                                            <div class="font-bold"><i class="fa fa-database"></i>
-                                                <small>{:__('Database table nums')}</small>
-                                            </div>
-                                        </div>
-                                        <div class="col-md-6">
-                                            <h1 class="no-margins">{$today_exam_user_count|format_bytes=###,'',0}</h1>
-                                            <div class="font-bold"><i class="fa fa-filter"></i>
-                                                <small>{:__('Database size')}</small>
-                                            </div>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-
-                    <div class="col-xs-6 col-md-3">
-                        <div class="panel bg-purple-gradient no-border">
-                            <div class="panel-body">
-                                <div class="ibox-title">
-                                    <span class="label label-primary pull-right">{:__('Real time')}</span>
-                                    <h5>{:__('Attachment count')}</h5>
-                                </div>
-                                <div class="ibox-content">
-
-                                    <div class="row">
-                                        <div class="col-md-6">
-                                            <h1 class="no-margins">{$today_exam_user_count|htmlentities}</h1>
-                                            <div class="font-bold"><i class="fa fa-files-o"></i>
-                                                <small>{:__('Attachment nums')}</small>
-                                            </div>
-                                        </div>
-                                        <div class="col-md-6">
-                                            <h1 class="no-margins">{$today_exam_user_count|format_bytes=###,'',0}</h1>
-                                            <div class="font-bold"><i class="fa fa-filter"></i>
-                                                <small>{:__('Attachment size')}</small>
-                                            </div>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="col-xs-6 col-md-3">
-                        <div class="panel bg-green-gradient no-border">
-                            <div class="panel-body">
-                                <div class="ibox-title">
-                                    <span class="label label-primary pull-right">{:__('Real time')}</span>
-                                    <h5>{:__('Picture count')}</h5>
-                                </div>
-                                <div class="ibox-content">
-
-                                    <div class="row">
-                                        <div class="col-md-6">
-                                            <h1 class="no-margins">{$today_exam_user_count|htmlentities}</h1>
-                                            <div class="font-bold"><i class="fa fa-picture-o"></i>
-                                                <small>{:__('Picture nums')}</small>
-                                            </div>
-                                        </div>
-                                        <div class="col-md-6">
-                                            <h1 class="no-margins">{$today_exam_user_count|format_bytes=###,'',0}</h1>
-                                            <div class="font-bold"><i class="fa fa-filter"></i>
-                                                <small>{:__('Picture size')}</small>
-                                            </div>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>-->
             </div>
             <div class="tab-pane fade" id="two">
                 <div class="row">

+ 16 - 9
application/admin/view/exam/grade/detail.html

@@ -24,13 +24,13 @@
             <el-descriptions-item label="考卷分类">{{row.cate.name}}</el-descriptions-item>
             <el-descriptions-item label="考卷名称">{{row.paper.title}}</el-descriptions-item>
             <el-descriptions-item label="出题模式">
-                <el-tag size="small" v-if="row.mode == 'RANDOM'">随机模式</el-tag>
-                <el-tag size="small" v-else-if="row.mode == 'FIX'" type="success">固定模式</el-tag>
+                <el-tag size="small" v-if="row.paper.mode == 'RANDOM'">随机模式</el-tag>
+                <el-tag size="small" v-else-if="row.paper.mode == 'FIX'" type="success">固定模式</el-tag>
             </el-descriptions-item>
-            <el-descriptions-item label="题目数量">{{row.total_count}}题</el-descriptions-item>
-            <el-descriptions-item label="试卷总分">{{row.total_score}}分</el-descriptions-item>
+            <el-descriptions-item label="题目数量">{{row.paper.quantity}}题</el-descriptions-item>
+            <el-descriptions-item label="试卷总分">{{row.paper.total_score}}分</el-descriptions-item>
             <el-descriptions-item label="及格线">
-                <span style="font-weight: bold;">{{row.pass_score}}</span>分
+                <span style="font-weight: bold;">{{row.paper.pass_score}}</span>分
             </el-descriptions-item>
             <el-descriptions-item label="考试限时">{{formatSecond(row.paper.limit_time)}}分</el-descriptions-item>
         </el-descriptions>
@@ -50,7 +50,7 @@
             </el-descriptions-item>
             <el-descriptions-item label="答对数" content-class-name="answer-right">{{row.right_count}}题</el-descriptions-item>
             <el-descriptions-item label="答错数" content-class-name="answer-fail">{{row.error_count}}题</el-descriptions-item>
-            <el-descriptions-item label="交卷时间">{{row.createtime_text}}</el-descriptions-item>
+            <el-descriptions-item label="交卷时间">{{row.finishtime_text}}</el-descriptions-item>
             <el-descriptions-item label="考试用时">{{formatSecond(row.grade_time)}}</el-descriptions-item>
         </el-descriptions>
     </el-card>
@@ -201,13 +201,17 @@
              */
             getUserShortAnswer() {
                 return function (questionIndex) {
+                    return this.row.user_answers && this.row.user_answers[questionIndex] ? this.row.user_answers[questionIndex].answer : '';
+
                     if (this.row.user_answers && this.row.user_answers[questionIndex]) {
                         let html = '';
-                        if (this.row.user_answers[questionIndex].answer_score) {
+                        if (this.row.user_answers[questionIndex].answer_score.length) {
                             for (let i = 0; i < this.row.user_answers[questionIndex].answer_score.length; i++) {
                                 let short_user_answer = this.row.user_answers[questionIndex].answer_score[i];
                                 html += '<p class="fill-answer-item">' + short_user_answer.answer + '</p>';
                             }
+                        }else{
+                            html = this.row.user_answers[questionIndex].answer;
                         }
                         return html
                         // return this.row.user_answers[questionIndex].answer.join(',');
@@ -253,7 +257,7 @@
                                 return score;
                             }
                         } else if (question.kind === 'SHORT') {
-                            let score = 0;
+                            /*let score = 0;
                             if (this.row.user_answers && this.row.user_answers[questionIndex]) {
 
                                 if (this.row.user_answers[questionIndex].answer_score) {
@@ -264,7 +268,10 @@
                                 }
                               // return this.row.user_answers[questionIndex].answer.join(',');
                             }
-                            return score;
+                            return score;*/
+                            if (this.row.user_answers[questionIndex].is_right) {
+                                return score;
+                            }
                         } else {
                             if (this.row.user_answers[questionIndex].answer === question.answer) {
                                 return score;

+ 394 - 0
application/admin/view/exam/grade/detailnew.html

@@ -0,0 +1,394 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>123</title>
+    {include file="common/meta" /}
+</head>
+<style>
+    /* 默认情况下,屏幕上显示 */
+    .hide-on-print {
+        display: block;
+        text-align: right;
+        margin-bottom: 20px;
+        padding-top: 20px;
+    }
+
+    .table-bordered {
+        border: 1px solid #ddd;
+    }
+    .panel-heading {
+        padding: 10px 0px;
+    }
+
+    .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
+        border: 1px solid #ddd;
+    }
+
+    /* 打印时隐藏 */
+    @media print {
+        .hide-on-print {
+            display: none;
+        }
+    }
+</style>
+
+<body  style="width: 760px;margin: 0 auto">
+
+<div class="hide-on-print">
+    <button type="button" onclick="printPage()" class="btn btn-primary dropdown-toggle">打印</button>
+</div>
+
+<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
+<script src="__CDN__/assets/addons/exam/js/vue.js"></script>
+<link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/exam/css/common.css"></link>
+
+<link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/exam/js/element-ui/index.css"/>
+<script src="__CDN__/assets/addons/exam/js/element-ui/index.js"></script>
+
+<div id="app">
+    <el-card class="box-card" style="margin-bottom: 20px;">
+        <div slot="header" class="clearfix">
+            <span>考试用户信息</span>
+        </div>
+        <el-descriptions title="" :column="2" border>
+            <el-descriptions-item label="用户名">{{row.user.nickname}}</el-descriptions-item>
+            <el-descriptions-item label="手机号">{{row.user.mobile}}</el-descriptions-item>
+        </el-descriptions>
+    </el-card>
+
+    <el-card class="box-card" style="margin-bottom: 20px;">
+        <div slot="header" class="clearfix">
+            <span>考卷信息</span>
+        </div>
+        <el-descriptions title="" :column="3" border>
+            <el-descriptions-item label="考卷分类">{{row.cate.name}}</el-descriptions-item>
+            <el-descriptions-item label="考卷名称">{{row.paper.title}}</el-descriptions-item>
+            <el-descriptions-item label="出题模式">
+                <el-tag size="small" v-if="row.paper.mode == 'RANDOM'">随机模式</el-tag>
+                <el-tag size="small" v-else-if="row.paper.mode == 'FIX'" type="success">固定模式</el-tag>
+            </el-descriptions-item>
+            <el-descriptions-item label="题目数量">{{row.paper.quantity}}题</el-descriptions-item>
+            <el-descriptions-item label="试卷总分">{{row.paper.total_score}}分</el-descriptions-item>
+            <el-descriptions-item label="及格线">
+                <span style="font-weight: bold;">{{row.paper.pass_score}}</span>分
+            </el-descriptions-item>
+            <el-descriptions-item label="考试限时">{{formatSecond(row.paper.limit_time)}}分</el-descriptions-item>
+        </el-descriptions>
+    </el-card>
+
+    <el-card class="box-card" style="margin-bottom: 20px;">
+        <div slot="header" class="clearfix">
+            <span>用户考试情况</span>
+            <!--<el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
+        </div>
+
+        <el-descriptions title="" :column="3" border style="margin-bottom: 30px;">
+            <el-descriptions-item label="考试分数">
+                <span style="margin-right: 10px;">{{row.score}}分</span>
+                <el-tag size="small" v-if="row.is_pass" type="success">及格</el-tag>
+                <el-tag size="small" v-else type="danger">不及格</el-tag>
+            </el-descriptions-item>
+            <el-descriptions-item label="答对数" content-class-name="answer-right">{{row.right_count}}题</el-descriptions-item>
+            <el-descriptions-item label="答错数" content-class-name="answer-fail">{{row.error_count}}题</el-descriptions-item>
+            <el-descriptions-item label="交卷时间">{{row.finishtime_text}}</el-descriptions-item>
+            <el-descriptions-item label="考试用时">{{formatSecond(row.grade_time)}}</el-descriptions-item>
+        </el-descriptions>
+    </el-card>
+
+    <el-card class="box-card" style="margin-bottom: 20px;">
+        <div slot="header" class="clearfix">
+            <span>用户答题情况</span>
+            <!--<el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
+        </div>
+
+        <div v-for="(question, index) in row.questions" :key="index" class="question-item">
+            <div class="el-descriptions">
+                <div class="el-descriptions__body">
+                    <table class="el-descriptions__table is-bordered">
+                        <tbody>
+                        <tr class="el-descriptions-row" v-if="question.material_title">
+                            <th colspan="1" class="el-descriptions-item__cell el-descriptions-item__label is-bordered-label th-fix-width ">材料题内容</th>
+                            <td colspan="9" class="el-descriptions-item__cell el-descriptions-item__content"><span v-html="question.material_title"></span></td>
+                        </tr>
+                        <tr class="el-descriptions-row">
+                            <th colspan="1" class="el-descriptions-item__cell el-descriptions-item__label is-bordered-label th-fix-width ">标题</th>
+                            <td colspan="9" class="el-descriptions-item__cell el-descriptions-item__content">{{index+1}}.<span v-html="question.title"></span></td>
+                        </tr>
+                        <tr class="el-descriptions-row">
+                            <th colspan="1" class="el-descriptions-item__cell el-descriptions-item__label is-bordered-label th-fix-width ">选项</th>
+                            <td colspan="9" class="el-descriptions-item__cell el-descriptions-item__content">
+                                <div v-if="question.kind !== 'FILL'">
+                                    <div v-for="(option, indexOption) in question.options_json" :key="indexOption" class="option-item">
+                                        {{option.key}}:{{option.value}}
+                                    </div>
+                                </div>
+                            </td>
+                        </tr>
+                        </tbody>
+                        <tbody>
+                        <tr class="el-descriptions-row">
+                            <th colspan="1" class="el-descriptions-item__cell el-descriptions-item__label is-bordered-label th-fix-width">题型</th>
+                            <td colspan="1" class="el-descriptions-item__cell el-descriptions-item__content th-fix-width">
+                                <el-tag size="small" effect="plain" v-if="question.kind == 'JUDGE'">判断题</el-tag>
+                                <el-tag size="small" effect="plain" v-else-if="question.kind == 'SINGLE'" type="success">单选题</el-tag>
+                                <el-tag size="small" effect="plain" v-else-if="question.kind == 'MULTI'" type="info">多选题</el-tag>
+                                <el-tag size="small" effect="plain" v-else-if="question.kind == 'FILL'" type="warning">填空题</el-tag>
+                                <el-tag size="small" effect="plain" v-else-if="question.kind == 'SHORT'" type="warning">简答题</el-tag>
+                            </td>
+
+                            <th colspan="1" class="el-descriptions-item__cell el-descriptions-item__label is-bordered-label th-fix-width">难度</th>
+                            <td colspan="1" class="el-descriptions-item__cell el-descriptions-item__content th-fix-width">
+                                <el-tag size="small" effect="dark" v-if="question.difficulty == 'EASY'" type="success">简单</el-tag>
+                                <el-tag size="small" effect="dark" v-else-if="question.difficulty == 'GENERAL'" type="warning">普通</el-tag>
+                                <el-tag size="small" effect="dark" v-else-if="question.difficulty == 'HARD'" type="danger">困难</el-tag>
+                            </td>
+                            <th colspan="1" class="el-descriptions-item__cell el-descriptions-item__label is-bordered-label th-fix-width">正确答案</th>
+                            <td colspan="1" class="el-descriptions-item__cell el-descriptions-item__content">
+                                <div v-if="question.kind == 'JUDGE' || question.kind == 'SINGLE' || question.kind == 'MULTI'">{{question.answer}}</div>
+                                <div v-else-if="question.kind == 'FILL'" v-html="getRightFillAnswer(question)"></div>
+                                <div v-else-if="question.kind == 'SHORT'" v-html="getRightShortAnswer(question)"></div>
+                            </td>
+
+                            <th colspan="1" class="el-descriptions-item__cell el-descriptions-item__label is-bordered-label th-fix-width">用户答案</th>
+                            <td colspan="1" class="el-descriptions-item__cell el-descriptions-item__content" v-if="question.kind == 'JUDGE' || question.kind == 'SINGLE' || question.kind == 'MULTI'" :class="getUserAnswer(index) == question.answer ? ['answer-right'] : ['answer-fail']">
+                                <div>{{getUserAnswer(index) || '未答'}}</div>
+                            </td>
+                            <td colspan="1" class="el-descriptions-item__cell el-descriptions-item__content" v-else-if="question.kind == 'FILL'" :class="row.user_answers[index].is_right ? ['answer-right'] : ['answer-fail']">
+                                <div>{{getUserFillAnswer(index) || '未答'}}</div>
+                                {{row.user_answers[index].answer.is_right}}
+                            </td>
+                            <td colspan="1" class="el-descriptions-item__cell el-descriptions-item__content" v-else-if="question.kind == 'SHORT'" :class="row.user_answers[index].is_right ? ['answer-right'] : ['answer-fail']">
+                                <div v-html="getUserShortAnswer(index) || '未答'"></div>
+                                {{row.user_answers[index].answer.is_right}}
+                            </td>
+
+                            <th colspan="1" class="el-descriptions-item__cell el-descriptions-item__label is-bordered-label th-fix-width">得分</th>
+                            <td colspan="1" class="el-descriptions-item__cell el-descriptions-item__content th-fix-width"><b>{{getSingleScore(question, index)}}</b>分</td>
+                        </tr>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+        </div>
+    </el-card>
+
+</div>
+
+<script>
+    var row = {:html_entity_decode(str_replace('&quot;', "'", json_encode($row)))};
+    var app = new Vue({
+        el: '#app',
+        data: {
+            row: row,
+        },
+        computed: {
+            /**
+             * 获取填空题正确答案
+             * @returns {(function(*): (string|string))|*}
+             */
+            getRightFillAnswer() {
+        return function (question) {
+            if (question && question.answer) {
+                let html = '';
+                question.answer.forEach(function (item, index) {
+                    html += '<span class="fill-answer-item">填空位' + (index + 1) + '答案:<b>' + item.answers.join(',') + '</b></span>';
+                });
+                return html;
+            }
+            return '';
+        }
+    },
+    /**
+     * 获取简答题正确答案
+     * @returns {(function(*): (string|string))|*}
+     */
+    getRightShortAnswer() {
+        return function (question) {
+            if (question && question.answer) {
+                let html = '正确答案:<b>' + question.answer.answer + '</b></br>';
+                question.answer.config.forEach(function (item, index) {
+                    html += '<p class="fill-answer-item">关键词' + (index + 1) + ':<b>' + item.answer + '(' + item.score + '分)' + '</b></p>';
+                });
+                return html;
+            }
+            return '';
+        }
+    },
+    /**
+     * 获取用户答案
+     * @returns {function(*): string|*}
+     */
+    getUserAnswer() {
+        return function (questionIndex) {
+            return this.row.user_answers && this.row.user_answers[questionIndex] ? this.row.user_answers[questionIndex].answer : '';
+        }
+    },
+    /**
+     * 获取用户填空题答案
+     * @returns {(function(*): (string|string))|*}
+     */
+    getUserFillAnswer() {
+        return function (questionIndex) {
+            if (this.row.user_answers && this.row.user_answers[questionIndex]) {
+                return this.row.user_answers[questionIndex].answer.join(',');
+            }
+            return '';
+        }
+    },
+    /**
+     * 获取用户简答题答案
+     * @returns {(function(*): (string|string))|*}
+     */
+    getUserShortAnswer() {
+        return function (questionIndex) {
+            return this.row.user_answers && this.row.user_answers[questionIndex] ? this.row.user_answers[questionIndex].answer : '';
+
+            if (this.row.user_answers && this.row.user_answers[questionIndex]) {
+                let html = '';
+                if (this.row.user_answers[questionIndex].answer_score.length) {
+                    for (let i = 0; i < this.row.user_answers[questionIndex].answer_score.length; i++) {
+                        let short_user_answer = this.row.user_answers[questionIndex].answer_score[i];
+                        html += '<p class="fill-answer-item">' + short_user_answer.answer + '</p>';
+                    }
+                }else{
+                    html = this.row.user_answers[questionIndex].answer;
+                }
+                return html
+                // return this.row.user_answers[questionIndex].answer.join(',');
+            }
+            return '';
+        }
+    },
+    /**
+     * 获取用户简答题得分
+     * @returns {(function(*): (string|string))|*}
+     */
+    // getUserShortAnswerScore() {
+    //     return function (questionIndex) {
+    //         let score = 0;
+    //         if (this.row.user_answers && this.row.user_answers[questionIndex]) {
+    //             if (this.row.user_answers[questionIndex].answer_score) {
+    //                 for (let i = 0; i < this.row.user_answers[questionIndex].answer_score.length; i++) {
+    //                     let short_user_answer = this.row.user_answers[questionIndex].answer_score[i];
+    //                     score += short_user_answer.score;
+    //                 }
+    //             }
+    //             // return this.row.user_answers[questionIndex].answer.join(',');
+    //         }
+    //         return score;
+    //     }
+    // },
+    /**
+     * 获取单个题目得分数
+     * @returns {function(*): string|*}
+     */
+    getSingleScore() {
+        return function (question, questionIndex) {
+            var score = 0;
+            if (this.row.mode == 'FIX') {
+                score = question.score;
+            } else {
+                score = this.getConfigsScore(question.kind, question.difficulty);
+            }
+
+            if (this.row.user_answers && this.row.user_answers[questionIndex]) {
+                if (question.kind === 'FILL') {
+                    if (this.row.user_answers[questionIndex].is_right) {
+                        return score;
+                    }
+                } else if (question.kind === 'SHORT') {
+                    /*let score = 0;
+                     if (this.row.user_answers && this.row.user_answers[questionIndex]) {
+
+                     if (this.row.user_answers[questionIndex].answer_score) {
+                     for (let i = 0; i < this.row.user_answers[questionIndex].answer_score.length; i++) {
+                     let short_user_answer = this.row.user_answers[questionIndex].answer_score[i];
+                     score += parseInt(short_user_answer.score);
+                     }
+                     }
+                     // return this.row.user_answers[questionIndex].answer.join(',');
+                     }
+                     return score;*/
+                    if (this.row.user_answers[questionIndex].is_right) {
+                        return score;
+                    }
+                } else {
+                    if (this.row.user_answers[questionIndex].answer === question.answer) {
+                        return score;
+                    }
+                }
+            }
+
+            return 0;
+        }
+    },
+    },
+    created() {
+
+    },
+    methods: {
+        /**
+         * 获取单个题目得分数
+         * @returns {function(*): string|*}
+         */
+        getConfigsScore(kind, difficulty) {
+            const configs = this.row.configs[kind.toLowerCase()];
+            if (configs && configs['use_difficulty']) {
+                return configs['difficulty'][difficulty.toLowerCase()]['score'];
+            }
+            return configs['score'];
+        },
+
+        /**
+         * 格式化秒数
+         * @param second
+         * @returns {string}
+         */
+        formatSecond: function (second) {
+            if (second == 0) return '不限时'
+
+            let result = parseInt(second)
+            let h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600);
+            let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60));
+            let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
+
+            let res = '';
+            if (h !== '00') res += `${h}时`;
+            if (m !== '00') res += `${m}分`;
+            res += `${s}秒`;
+            return res;
+        }
+    }
+    })
+</script>
+<style>
+    .answer-right {
+        background: #E1F3D8;
+    }
+
+    .answer-fail {
+        background: #FDE2E2;
+    }
+
+    .question-item {
+        padding: 15px;
+    }
+
+    .option-item {
+        margin-left: 10px;
+    }
+
+    .th-fix-width {
+        width: 100px;
+        text-align: center !important;
+    }
+
+    .fill-answer-item {
+        margin-right: 20px;
+    }
+</style>
+
+
+{include file="common/script" /}
+</body>
+</html>

+ 2 - 2
application/admin/view/exam/manual_grade/add.html

@@ -24,7 +24,7 @@
                         
             <select  id="c-kind" data-rule="required" class="form-control selectpicker" name="row[kind]">
                 {foreach name="kindList" item="vo"}
-                    <option value="{$key|htmlentities}" {in name="key" value=""}selected{/in}>{$vo|htmlentities}</option>
+                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
 
@@ -60,7 +60,7 @@
             
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="0"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label> 
             {/foreach}
             </div>
 

+ 2 - 2
application/admin/view/exam/manual_grade/edit.html

@@ -24,7 +24,7 @@
                         
             <select  id="c-kind" data-rule="required" class="form-control selectpicker" name="row[kind]">
                 {foreach name="kindList" item="vo"}
-                    <option value="{$key|htmlentities}" {in name="key" value="$row.kind"}selected{/in}>{$vo|htmlentities}</option>
+                    <option value="{$key}" {in name="key" value="$row.kind"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
 
@@ -60,7 +60,7 @@
             
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.status"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
             {/foreach}
             </div>
 

+ 1 - 1
application/admin/view/exam/manual_grade/index.html

@@ -5,7 +5,7 @@
         <ul class="nav nav-tabs" data-field="status">
             <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
             {foreach name="statusList" item="vo"}
-            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
             {/foreach}
         </ul>
     </div>

+ 1 - 1
application/admin/view/exam/manual_room_grade/add.html

@@ -48,7 +48,7 @@
             
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="0"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label> 
             {/foreach}
             </div>
 

+ 1 - 1
application/admin/view/exam/manual_room_grade/edit.html

@@ -48,7 +48,7 @@
             
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.status"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
             {/foreach}
             </div>
 

+ 1 - 1
application/admin/view/exam/manual_room_grade/index.html

@@ -5,7 +5,7 @@
         <ul class="nav nav-tabs" data-field="status">
             <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
             {foreach name="statusList" item="vo"}
-            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
             {/foreach}
         </ul>
     </div>

+ 1 - 1
application/admin/view/exam/notice/add.html

@@ -25,7 +25,7 @@
 
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="NORMAL"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="NORMAL"}checked{/in} /> {$vo}</label>
             {/foreach}
             </div>
 

+ 1 - 1
application/admin/view/exam/notice/edit.html

@@ -25,7 +25,7 @@
 
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.status"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
             {/foreach}
             </div>
 

+ 1 - 1
application/admin/view/exam/notice/index.html

@@ -5,7 +5,7 @@
         <ul class="nav nav-tabs" data-field="status">
             <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
             {foreach name="statusList" item="vo"}
-            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
             {/foreach}
         </ul>
     </div>

+ 51 - 15
application/admin/view/exam/paper/add.html

@@ -11,7 +11,7 @@
             <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
             <div class="col-xs-12 col-sm-8">
                 <input id="c-cate_id" data-rule="required" data-source="exam/cate/selectpage"
-                       data-params='{"custom[kind]":"PAPER","isTree":true}' class="form-control selectpage" name="row[cate_id]"
+                       data-params='{"custom[kind]":"QUESTION","isTree":true}' class="form-control selectpage" name="row[cate_id]"
                        type="text" value="">
             </div>
         </div>
@@ -22,7 +22,7 @@
 
                 <select  id="c-kind" data-rule="required" class="form-control selectpicker" name="row[kind]">
                     {foreach name="kindList" item="vo"}
-                        <option value="{$key|htmlentities}" {in name="key" value="RANDOM"}selected{/in}>{$vo|htmlentities}</option>
+                        <option value="{$key}" {in name="key" value="RANDOM"}selected{/in}>{$vo}</option>
                     {/foreach}
                 </select>
 
@@ -37,6 +37,21 @@
         </div>
 
         <div class="form-group">
+            <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
+            <div class="col-xs-12 col-sm-8">
+                <div class="input-group">
+                    <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="">
+                    <div class="input-group-addon no-border no-padding">
+                        <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                        <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                    </div>
+                    <span class="msg-box n-right" for="c-image"></span>
+                </div>
+                <ul class="row list-inline faupload-preview" id="p-image"></ul>
+            </div>
+        </div>
+
+        <div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">{:__('Quantity')}:</label>
             <div class="col-xs-12 col-sm-8">
                 <input id="c-quantity" data-rule="required" class="form-control" name="row[quantity]" type="number" step="1"
@@ -64,8 +79,8 @@
 
                 <div class="radio">
                     {foreach name="modeList" item="vo"}
-                    <label for="row[mode]-{$key|htmlentities}">
-                      <input @change="changeMode" id="row[mode]-{$key|htmlentities}" name="row[mode]" type="radio" value="{$key|htmlentities}" {in name="key" value="RANDOM" }checked{/in} /> {$vo|htmlentities}
+                    <label for="row[mode]-{$key}">
+                      <input @change="changeMode" id="row[mode]-{$key}" name="row[mode]" type="radio" value="{$key}" {in name="key" value="RANDOM" }checked{/in} /> {$vo}
                     </label>
                     {/foreach}
                 </div>
@@ -102,13 +117,7 @@
             </div>
         </div>
 
-        <div class="form-group">
-            <label class="control-label col-xs-12 col-sm-2">{:__('Day_limit_count')}:</label>
-            <div class="col-xs-12 col-sm-8" style="line-height: 31px;">
-                <input id="c-day_limit_count" data-rule="required" class="form-control" name="row[day_limit_count]" type="number"
-                       step="1" min="0" value="0" style="width: 200px" placeholder="考试限时,0不限制">
-            </div>
-        </div>
+
 
         <div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
@@ -124,7 +133,7 @@
             </div>
         </div>
 
-        <div class="form-group">
+       <!-- <div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">{:__('Is_only_room')}:</label>
             <div class="col-xs-12 col-sm-8">
                 <input id="c-is_only_room" name="row[is_only_room]" type="hidden" value="{$row.is_only_room|default=0}">
@@ -133,7 +142,7 @@
                 </a>
                 <p class="text-info">* 开启该功能后,该试卷将不再显示于前端试卷列表,仅考场可使用</p>
             </div>
-        </div>
+        </div>-->
 
         <!--<div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
@@ -145,18 +154,45 @@
         </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">
 
                 <div class="radio">
                     {foreach name="statusList" item="vo"}
-                    <label for="row[status]-{$key|htmlentities}">
-                        <input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="NORMAL" }checked{/in} /> {$vo|htmlentities}</label>
+                    <label for="row[status]-{$key}">
+                        <input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="NORMAL" }checked{/in} /> {$vo}</label>
                     {/foreach}
                 </div>
 
             </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">
+                <select id="c-gangwei_id" multiple="" class="form-control selectpicker" name="">
+                    {foreach name="gangweilist" item="vo"}
+                    <option value="{$vo.id}" >{$vo.name}</option>
+                    {/foreach}
+                </select>
+            </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">
+                <input id="c-user_ids" data-source="user/user/index" data-multiple="true" data-order-by="id desc" data-pagination="false" data-field="nickname" class="form-control selectpage" name="row[user_ids]" type="text" value="">
+            </div>
+        </div>-->
+
+
         <div class="form-group layer-footer">
             <label class="control-label col-xs-12 col-sm-2"></label>
             <div class="col-xs-12 col-sm-8">

+ 6 - 6
application/admin/view/exam/paper/configs_setting.html

@@ -35,7 +35,7 @@
                                                                  value="{$configs.judge.score|default=0}"> 分,</span>
                         总分 <span class="span_kind_total_score span_judge_total_score">{$configs.judge.total_score|default=0}</span>
-                        <input type="checkbox" class="checkbox_difficulty checkbox_judge" data-type="judge"> 分难度
+                        <input style="display: none" type="checkbox" class="checkbox_difficulty checkbox_judge" data-type="judge"> <!--分难度-->
                     </p>
                     <ul class="ul_difficulty ul_judge_difficulty hide">
                         <li>
@@ -82,7 +82,7 @@
                                                                   data-type="single" type="number" step="1" min="0"
                                                                   max="0" value="{$configs.single.score|default=0}"> 分,</span>
                         总分 <span class="span_kind_total_score span_single_total_score">0</span> 分
-                        <input type="checkbox" class="checkbox_difficulty checkbox_single" data-type="single"> 分难度
+                        <input style="display: none" type="checkbox" class="checkbox_difficulty checkbox_single" data-type="single"> <!--分难度-->
                     </p>
                     <ul class="ul_difficulty ul_single_difficulty hide">
                         <li>
@@ -130,7 +130,7 @@
                                                                  max="0"
                                                                  value="{$configs.multi.score|default=0}"> 分,</span>
                         总分 <span class="span_kind_total_score span_multi_total_score">0</span> 分
-                        <input type="checkbox" class="checkbox_difficulty checkbox_multi" data-type="multi"> 分难度
+                        <input style="display: none" type="checkbox" class="checkbox_difficulty checkbox_multi" data-type="multi"> <!--分难度-->
                     </p>
                     <ul class="ul_difficulty ul_multi_difficulty hide">
                         <li>
@@ -168,7 +168,7 @@
                     </ul>
                 </div>
 
-                <div class="p-l-80 m-tb-10">
+                <div style="display: none" class="p-l-80 m-tb-10">
                     <p>
                         填空题: 共 <span class="span_fill_total">0</span> 题,
                         选取 <input class="input_kind_count input_fill input_count w-60" data-type="fill" type="number"
@@ -226,7 +226,7 @@
                                                                  max="0"
                                                                  value="{$configs.short.score|default=0}"> 分,</span>
                         总分 <span class="span_kind_total_score span_short_total_score">0</span> 分
-                        <input type="checkbox" class="checkbox_difficulty checkbox_short" data-type="short"> 分难度
+                        <input style="display: none" type="checkbox" class="checkbox_difficulty checkbox_short" data-type="short"> <!--分难度-->
                     </p>
                     <ul class="ul_difficulty ul_short_difficulty hide">
                         <li>
@@ -264,7 +264,7 @@
                     </ul>
                 </div>
 
-                <div class="p-l-80 m-tb-10">
+                <div style="display: none" class="p-l-80 m-tb-10">
                     <p>
                         材料题: 共 <span class="span_material_total">0</span> 题,
                         选取 <input class="input_kind_count input_material input_count w-60" data-type="material" type="number"

+ 8 - 12
application/admin/view/exam/paper/configs_setting_fix.html

@@ -9,6 +9,10 @@
                     </el-statistic>
                 </div>
             </el-col>
+
+        </el-row>
+
+        <el-row :gutter="24" class="m-t-5">
             <el-col :span="6">
                 <div>
                     <el-statistic title="判断题数/分数">
@@ -30,16 +34,13 @@
                     </el-statistic>
                 </div>
             </el-col>
-        </el-row>
-
-        <el-row :gutter="24" class="m-t-5">
-            <el-col :span="6">
+            <!--<el-col :span="6">
                 <div>
                     <el-statistic title="填空题数/分数">
                         <template slot="formatter"> {{summary.fill_quantity}}/{{summary.fill_score}} </template>
                     </el-statistic>
                 </div>
-            </el-col>
+            </el-col>-->
             <el-col :span="6">
                 <div>
                     <el-statistic title="简答题数/分数">
@@ -47,13 +48,13 @@
                     </el-statistic>
                 </div>
             </el-col>
-            <el-col :span="6">
+            <!--<el-col :span="6">
                 <div>
                     <el-statistic title="材料题数/分数">
                         <template slot="formatter"> {{summary.material_quantity}}/{{summary.material_score}} </template>
                     </el-statistic>
                 </div>
-            </el-col>
+            </el-col>-->
         </el-row>
     </div>
 
@@ -98,11 +99,6 @@
 
             </template>
         </el-table-column>
-        <el-table-column prop="sort" label="排序" align="center">
-            <template slot-scope="scope">
-                <el-input-number size="mini" v-model="scope.row.sort" :min="1" step-strictly></el-input-number>
-            </template>
-        </el-table-column>
         <el-table-column fixed="right" label="操作" width="100">
             <template slot-scope="scope">
                 <el-button type="danger" icon="el-icon-delete" size="small" @click="deleteQuestion(scope.$index)">删除</el-button>

+ 34 - 12
application/admin/view/exam/paper/edit.html

@@ -11,7 +11,7 @@
             <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
             <div class="col-xs-12 col-sm-8">
                 <input id="c-cate_id" data-rule="required" data-source="exam/cate/selectpage"
-                       data-params='{"custom[kind]":"PAPER","isTree":true}' class="form-control selectpage" name="row[cate_id]"
+                       data-params='{"custom[kind]":"QUESTION","isTree":true}' class="form-control selectpage" name="row[cate_id]"
                        type="text" value="{$row.cate_id|htmlentities}">
             </div>
         </div>
@@ -25,6 +25,21 @@
         </div>
 
         <div class="form-group">
+            <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
+            <div class="col-xs-12 col-sm-8">
+                <div class="input-group">
+                    <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
+                    <div class="input-group-addon no-border no-padding">
+                        <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                        <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                    </div>
+                    <span class="msg-box n-right" for="c-image"></span>
+                </div>
+                <ul class="row list-inline faupload-preview" id="p-image"></ul>
+            </div>
+        </div>
+
+        <div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">{:__('Quantity')}:</label>
             <div class="col-xs-12 col-sm-8">
                 <input id="c-quantity" data-rule="required" class="form-control" name="row[quantity]" type="number"
@@ -52,8 +67,8 @@
 
                 <div class="radio">
                     {foreach name="modeList" item="vo"}
-                    <label for="row[mode]-{$key|htmlentities}">
-                        <input @change="changeMode" id="row[mode]-{$key|htmlentities}" name="row[mode]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.mode" }checked{/in} /> {$vo|htmlentities}
+                    <label for="row[mode]-{$key}">
+                        <input @change="changeMode" id="row[mode]-{$key}" name="row[mode]" type="radio" value="{$key}" {in name="key" value="$row.mode" }checked{/in} /> {$vo}
                     </label>
                     {/foreach}
                 </div>
@@ -72,7 +87,6 @@
 
             <div class="col-xs-12 col-sm-8" v-show="mode === 'FIX'">
                 <a href="javascript:;" class="btn btn-sm btn-success btn-fix-configs margin-bottom" @click="openQuestionSelect()"><i class="fa fa-cog"></i> 固定选题配置</a>
-                <a href="javascript:;" class="btn btn-sm btn-info btn-refresh-sort margin-bottom" @click="refreshSort()"><i class="fa fa-refresh"></i> 刷题选题排序</a>
 
                 {include file="../application/admin/view/exam/paper/configs_setting_fix.html" /}
             </div>
@@ -105,7 +119,7 @@
             </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">
                 <input id="c-is_only_room" name="row[is_only_room]" type="hidden" value="{$row.is_only_room|default=0}">
@@ -114,7 +128,7 @@
                 </a>
                 <p class="text-info">* 开启该功能后,该试卷将不再显示于前端试卷列表,仅考场可使用</p>
             </div>
-        </div>
+        </div>-->
         <!--<div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
             <div class="col-xs-12 col-sm-8">
@@ -125,10 +139,10 @@
         </div>-->
 
         <div class="form-group">
-            <label class="control-label col-xs-12 col-sm-2">{:__('Day_limit_count')}:</label>
+            <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-day_limit_count" data-rule="required" class="form-control" name="row[day_limit_count]" type="number"
-                       step="1" min="0" value="{$row.day_limit_count|default=0}" style="width: 200px" placeholder="考试限时,0不限制">
+                <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=1}" style="width: 200px" placeholder="考试限时,0不限制">
             </div>
         </div>
 
@@ -138,14 +152,22 @@
 
                 <div class="radio">
                     {foreach name="statusList" item="vo"}
-                    <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio"
-                                                           value="{$key|htmlentities}" {in name="key" value="$row.status" }checked{/in}
-                        /> {$vo|htmlentities}</label>
+                    <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio"
+                                                           value="{$key}" {in name="key" value="$row.status" }checked{/in}
+                        /> {$vo}</label>
                     {/foreach}
                 </div>
 
             </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">
+                <input id="c-user_ids" data-source="user/user/index" data-multiple="true" data-order-by="id desc" data-pagination="false" data-field="nickname" class="form-control selectpage" name="row[user_ids]" type="text" value="{$row.user_ids}">
+            </div>
+        </div>-->
+
         <div class="form-group layer-footer">
             <label class="control-label col-xs-12 col-sm-2"></label>
             <div class="col-xs-12 col-sm-8">

+ 1 - 14
application/admin/view/exam/paper/extend.html

@@ -87,11 +87,6 @@
                 this.statistics()
             },
 
-            // 修改排序
-            sortChange(index) {
-                console.log('sortChange', index)
-            },
-
             // 打开简答题关键词分数设置
             openShortScoreDialog(row, index) {
                 let answer = row.answer
@@ -215,8 +210,7 @@
                             questions.push({
                                 id: question.id,
                                 score: question.score,
-                                answer: question.answer,
-                                sort: question.sort
+                                answer: question.answer
                             })
                         }
                         $('#c-questions').val(JSON.stringify(questions))
@@ -228,13 +222,6 @@
                         return true
 
                 }
-            },
-            // 刷新排序
-            refreshSort() {
-                // 按照sort排序,数值大靠前
-                this.questions.sort((a, b) => {
-                    return b.sort - a.sort
-                })
             }
         }
     })

+ 1 - 1
application/admin/view/exam/paper/index.html

@@ -5,7 +5,7 @@
         <ul class="nav nav-tabs" data-field="status">
             <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
             {foreach name="statusList" item="vo"}
-            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
             {/foreach}
         </ul>
     </div>

+ 25 - 0
application/admin/view/exam/paper/nograde.html

@@ -0,0 +1,25 @@
+<div class="panel panel-default panel-intro">
+
+    <table class="table table-striped table-bordered table-hover table-nowrap" width="100%">
+
+        <tr>
+            <td>用户id</td>
+            <td>用户名</td>
+            <td>昵称</td>
+        </tr>
+
+
+
+        {volist name="lists" id="vo"}
+        <tr>
+            <td>{$vo.id}</td>
+            <td>{$vo.username}</td>
+            <td>{$vo.nickname}</td>
+        </tr>
+        {/volist}
+
+
+
+
+    </table>
+</div>

+ 2 - 2
application/admin/view/exam/paper/recyclebin.html

@@ -8,9 +8,9 @@
                     <div id="toolbar" class="toolbar">
                         {:build_toolbar('refresh')}
                         <a class="btn btn-info btn-multi btn-disabled disabled {:$auth->check('exam/paper/restore')?'':'hide'}" href="javascript:;" data-url="exam/paper/restore" data-action="restore"><i class="fa fa-rotate-left"></i> {:__('Restore')}</a>
-                        <a class="btn btn-danger btn-multi btn-disabled disabled {:$auth->check('exam/paper/destroy')?'':'hide'}" href="javascript:;" data-url="exam/paper/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>
+                        <!--<a class="btn btn-danger btn-multi btn-disabled disabled {:$auth->check('exam/paper/destroy')?'':'hide'}" href="javascript:;" data-url="exam/paper/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>-->
                         <a class="btn btn-success btn-restoreall {:$auth->check('exam/paper/restore')?'':'hide'}" href="javascript:;" data-url="exam/paper/restore" title="{:__('Restore all')}"><i class="fa fa-rotate-left"></i> {:__('Restore all')}</a>
-                        <a class="btn btn-danger btn-destroyall {:$auth->check('exam/paper/destroy')?'':'hide'}" href="javascript:;" data-url="exam/paper/destroy" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>
+                        <!--<a class="btn btn-danger btn-destroyall {:$auth->check('exam/paper/destroy')?'':'hide'}" href="javascript:;" data-url="exam/paper/destroy" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>-->
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover"
                            data-operate-restore="{:$auth->check('exam/paper/restore')}"

+ 24 - 0
application/admin/view/exam/paper/selectuser.html

@@ -0,0 +1,24 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <input type="hidden" name="row[user_rule]" value="{$row.user_rule}" />
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_ids')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <span class="text-muted"><input type="checkbox" name="" id="checkall" /> <label for="checkall"><small>{:__('Check all')}</small></label></span>
+            <span class="text-muted"><input type="checkbox" name="" id="expandall" /> <label for="expandall"><small>{:__('Expand all')}</small></label></span>
+
+            <div id="treeview"></div>
+        </div>
+    </div>
+
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+        </div>
+    </div>
+</form>
+<script>
+    var nodeData = {:json_encode($nodeList); };
+</script>

+ 5 - 5
application/admin/view/exam/question/add-bak.html

@@ -33,7 +33,7 @@
 
             <select  id="c-difficulty" data-rule="required" class="form-control selectpicker" name="row[difficulty]">
                 {foreach name="difficultyList" item="vo"}
-                    <option value="{$key|htmlentities}" {in name="key" value="GENERAL"}selected{/in}>{$vo|htmlentities}</option>
+                    <option value="{$key}" {in name="key" value="GENERAL"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
 
@@ -46,14 +46,14 @@
 
             <!--<select  id="c-kind" data-rule="required" class="form-control selectpicker" name="row[kind]">
                 {foreach name="kindList" item="vo"}
-                    <option value="{$key|htmlentities}" {in name="key" value="JUDGE"}selected{/in}>{$vo|htmlentities}</option>
+                    <option value="{$key}" {in name="key" value="JUDGE"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>-->
 
             <div class="radio">
                 {foreach name="kindList" item="vo"}
-                <label for="row[kind]-{$key|htmlentities}">
-                    <input id="row[kind]-{$key|htmlentities}" name="row[kind]" type="radio" value="{$key|htmlentities}" {in name="key" value="SINGLE" }checked{/in} /> {$vo|htmlentities}
+                <label for="row[kind]-{$key}">
+                    <input id="row[kind]-{$key}" name="row[kind]" type="radio" value="{$key}" {in name="key" value="SINGLE" }checked{/in} /> {$vo}
                 </label>
                 {/foreach}
             </div>
@@ -89,7 +89,7 @@
 
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="NORMAL"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="NORMAL"}checked{/in} /> {$vo}</label>
             {/foreach}
             </div>
 

+ 11 - 8
application/admin/view/exam/question/add.html

@@ -53,15 +53,18 @@
             <div class="col-xs-12 col-sm-8">
                 <div class="radio">
                     {foreach name="kindList" item="vo"}
-                    <label for="row[kind]-{$key|htmlentities}">
-                        <input @change="changeKind" id="row[kind]-{$key|htmlentities}" name="row[kind]" type="radio" value="{$key|htmlentities}" {in name="key" value="SINGLE" }checked{/in} /> {$vo|htmlentities}
+                    <label for="row[kind]-{$key}">
+                        <input @change="changeKind" id="row[kind]-{$key}" name="row[kind]" type="radio" value="{$key}" {in name="key" value="SINGLE" }checked{/in} /> {$vo}
                     </label>
                     {/foreach}
                 </div>
             </div>
         </div>
+        <input name="row[is_material_child]" type="hidden" value="0">
+        <input name="row[material_question_id]" type="hidden" value="">
+        <input name="row[material_score]" type="hidden" value="0">
 
-        <div class="form-group" id="is_material_child">
+        <!--<div class="form-group" id="is_material_child">
             <label class="control-label col-xs-12 col-sm-2">{:__('is_material_child')}:</label>
             <div class="col-xs-12 col-sm-8">
                 <div class="radio">
@@ -88,7 +91,7 @@
             <div class="col-xs-12 col-sm-8">
                 <input id="c-material_score" class="form-control" name="row[material_score]" type="number" value="0" step="1">
             </div>
-        </div>
+        </div>-->
 
         <!--原题型 -->
         <div v-show="kind === 'JUDGE' || kind === 'SINGLE' || kind === 'MULTI'">
@@ -186,18 +189,18 @@
             </div>
         </div>
 
-        <div class="form-group">
+        <!--<div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">{:__('Difficulty')}:</label>
             <div class="col-xs-12 col-sm-8">
 
                 <select id="c-difficulty" data-rule="required" class="form-control selectpicker" name="row[difficulty]">
                     {foreach name="difficultyList" item="vo"}
-                    <option value="{$key|htmlentities}" {in name="key" value="GENERAL"}selected{/in}>{$vo|htmlentities}</option>
+                    <option value="{$key}" {in name="key" value="GENERAL"}selected{/in}>{$vo}</option>
                     {/foreach}
                 </select>
 
             </div>
-        </div>
+        </div>-->
         <div class="form-group">
             <label class="control-label col-xs-12 col-sm-2">{:__('Explain')}:</label>
             <div class="col-xs-12 col-sm-8">
@@ -227,7 +230,7 @@
 
                 <div class="radio">
                     {foreach name="statusList" item="vo"}
-                    <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="NORMAL"}checked{/in} /> {$vo|htmlentities}</label>
+                    <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="NORMAL"}checked{/in} /> {$vo}</label>
                     {/foreach}
                 </div>
 

+ 5 - 5
application/admin/view/exam/question/edit-bak.html

@@ -32,7 +32,7 @@
 
             <select  id="c-difficulty" data-rule="required" class="form-control selectpicker" name="row[difficulty]">
                 {foreach name="difficultyList" item="vo"}
-                    <option value="{$key|htmlentities}" {in name="key" value="$row.difficulty"}selected{/in}>{$vo|htmlentities}</option>
+                    <option value="{$key}" {in name="key" value="$row.difficulty"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
 
@@ -45,14 +45,14 @@
 
             <!--<select  id="c-kind" data-rule="required" class="form-control selectpicker" name="row[kind]">
                 {foreach name="kindList" item="vo"}
-                    <option value="{$key|htmlentities}" {in name="key" value="$row.kind"}selected{/in}>{$vo|htmlentities}</option>
+                    <option value="{$key}" {in name="key" value="$row.kind"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>-->
 
             <div class="radio">
                 {foreach name="kindList" item="vo"}
-                <label for="row[kind]-{$key|htmlentities}">
-                    <input id="row[kind]-{$key|htmlentities}" name="row[kind]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.kind" }checked{/in} /> {$vo|htmlentities}
+                <label for="row[kind]-{$key}">
+                    <input id="row[kind]-{$key}" name="row[kind]" type="radio" value="{$key}" {in name="key" value="$row.kind" }checked{/in} /> {$vo}
                 </label>
                 {/foreach}
             </div>
@@ -88,7 +88,7 @@
 
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.status"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
             {/foreach}
             </div>
 

+ 11 - 8
application/admin/view/exam/question/edit.html

@@ -45,16 +45,19 @@
 
             <div class="radio">
                 {foreach name="kindList" item="vo"}
-                <label for="row[kind]-{$key|htmlentities}">
-                    <input @change="changeKind" id="row[kind]-{$key|htmlentities}" name="row[kind]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.kind" }checked{/in} /> {$vo|htmlentities}
+                <label for="row[kind]-{$key}">
+                    <input @change="changeKind" id="row[kind]-{$key}" name="row[kind]" type="radio" value="{$key}" {in name="key" value="$row.kind" }checked{/in} /> {$vo}
                 </label>
                 {/foreach}
             </div>
 
         </div>
     </div>
+    <input name="row[is_material_child]" type="hidden" value="0">
+    <input name="row[material_question_id]" type="hidden" value="">
+    <input name="row[material_score]" type="hidden" value="0">
 
-    <div class="form-group" id="is_material_child">
+    <!--<div class="form-group" id="is_material_child">
         <label class="control-label col-xs-12 col-sm-2">{:__('is_material_child')}:</label>
         <div class="col-xs-12 col-sm-8">
             <div class="radio">
@@ -81,7 +84,7 @@
         <div class="col-xs-12 col-sm-8">
             <input id="c-material_score" class="form-control" name="row[material_score]" type="number" value="{$row.material_score|htmlentities}">
         </div>
-    </div>
+    </div>-->
 
 
     <!--原题型-->
@@ -184,18 +187,18 @@
         </div>
     </div>
 
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Difficulty')}:</label>
         <div class="col-xs-12 col-sm-8">
 
             <select  id="c-difficulty" data-rule="required" class="form-control selectpicker" name="row[difficulty]">
                 {foreach name="difficultyList" item="vo"}
-                    <option value="{$key|htmlentities}" {in name="key" value="$row.difficulty"}selected{/in}>{$vo|htmlentities}</option>
+                    <option value="{$key}" {in name="key" value="$row.difficulty"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
 
         </div>
-    </div>
+    </div>-->
 
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Explain')}:</label>
@@ -226,7 +229,7 @@
 
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.status"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
             {/foreach}
             </div>
 

+ 1 - 1
application/admin/view/exam/question/import.html

@@ -27,7 +27,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">模板文件:</label>
         <div class="col-xs-12 col-sm-8">
-            <a href="/assets/addons/exam/template/import_template.xlsx" target="_blank" class="btn btn-success" title="点击下载模板文件"><i class="fa fa-download"></i> 点击下载模板文件</a>
+            <a href="/assets/addons/exam/template/import_template.xlsx?v=2" target="_blank" class="btn btn-success" title="点击下载模板文件"><i class="fa fa-download"></i> 点击下载模板文件</a>
         </div>
     </div>
 

+ 1 - 6
application/admin/view/exam/question/index.html

@@ -5,7 +5,7 @@
         <ul class="nav nav-tabs" data-field="status">
             <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
             {foreach name="statusList" item="vo"}
-            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
             {/foreach}
         </ul>
     </div>
@@ -31,17 +31,12 @@
                         </div>-->
 
                         <a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('exam/question/recyclebin')?'':'hide'}" href="exam/question/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
-
-                      <p class="help-block">* 提示:点击题目表头可排序,如有重复题目,题目会标识红色字体,可根据实际情况删除重复题目</p>
-
                     </div>
-
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                            data-operate-edit="{:$auth->check('exam/question/edit')}"
                            data-operate-del="{:$auth->check('exam/question/del')}"
                            width="100%">
                     </table>
-
                 </div>
             </div>
 

+ 2 - 2
application/admin/view/exam/question/recyclebin.html

@@ -8,9 +8,9 @@
                     <div id="toolbar" class="toolbar">
                         {:build_toolbar('refresh')}
                         <a class="btn btn-info btn-multi btn-disabled disabled {:$auth->check('exam/question/restore')?'':'hide'}" href="javascript:;" data-url="exam/question/restore" data-action="restore"><i class="fa fa-rotate-left"></i> {:__('Restore')}</a>
-                        <a class="btn btn-danger btn-multi btn-disabled disabled {:$auth->check('exam/question/destroy')?'':'hide'}" href="javascript:;" data-url="exam/question/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>
+                        <!--<a class="btn btn-danger btn-multi btn-disabled disabled {:$auth->check('exam/question/destroy')?'':'hide'}" href="javascript:;" data-url="exam/question/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>-->
                         <a class="btn btn-success btn-restoreall {:$auth->check('exam/question/restore')?'':'hide'}" href="javascript:;" data-url="exam/question/restore" title="{:__('Restore all')}"><i class="fa fa-rotate-left"></i> {:__('Restore all')}</a>
-                        <a class="btn btn-danger btn-destroyall {:$auth->check('exam/question/destroy')?'':'hide'}" href="javascript:;" data-url="exam/question/destroy" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>
+                        <!--<a class="btn btn-danger btn-destroyall {:$auth->check('exam/question/destroy')?'':'hide'}" href="javascript:;" data-url="exam/question/destroy" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>-->
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover"
                            data-operate-restore="{:$auth->check('exam/question/restore')}"

+ 1 - 1
application/admin/view/exam/question/select.html

@@ -5,7 +5,7 @@
         <ul class="nav nav-tabs" data-field="status">
             <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
             {foreach name="statusList" item="vo"}
-            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
             {/foreach}
         </ul>
     </div>

+ 5 - 5
application/admin/view/exam/room/add.html

@@ -55,7 +55,7 @@
 
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="NORMAL"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="NORMAL"}checked{/in} /> {$vo}</label>
             {/foreach}
             </div>
 
@@ -67,8 +67,8 @@
 
             <div class="radio">
                 {foreach name="signupModeList" item="vo"}
-                <label for="row[signup_mode]-{$key|htmlentities}">
-                    <input id="row[signup_mode]-{$key|htmlentities}" name="row[signup_mode]" type="radio" value="{$key|htmlentities}" {in name="key" value="NORMAL" }checked{/in} /> {$vo|htmlentities}
+                <label for="row[signup_mode]-{$key}">
+                    <input id="row[signup_mode]-{$key}" name="row[signup_mode]" type="radio" value="{$key}" {in name="key" value="NORMAL" }checked{/in} /> {$vo}
                 </label>
                 {/foreach}
             </div>
@@ -89,8 +89,8 @@
 
             <div class="radio">
                 {foreach name="isMakeupList" item="vo"}
-                <label for="row[is_makeup]-{$key|htmlentities}">
-                    <input id="row[is_makeup]-{$key|htmlentities}" name="row[is_makeup]" type="radio" value="{$key|htmlentities}" {in name="key" value="0" }checked{/in} /> {$vo|htmlentities}
+                <label for="row[is_makeup]-{$key}">
+                    <input id="row[is_makeup]-{$key}" name="row[is_makeup]" type="radio" value="{$key}" {in name="key" value="0" }checked{/in} /> {$vo}
                 </label>
                 {/foreach}
             </div>

+ 5 - 5
application/admin/view/exam/room/edit.html

@@ -55,7 +55,7 @@
 
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.status"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
             {/foreach}
             </div>
 
@@ -67,8 +67,8 @@
 
             <div class="radio">
                 {foreach name="signupModeList" item="vo"}
-                <label for="row[signup_mode]-{$key|htmlentities}">
-                    <input id="row[signup_mode]-{$key|htmlentities}" name="row[signup_mode]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.signup_mode" }checked{/in} /> {$vo|htmlentities}
+                <label for="row[signup_mode]-{$key}">
+                    <input id="row[signup_mode]-{$key}" name="row[signup_mode]" type="radio" value="{$key}" {in name="key" value="$row.signup_mode" }checked{/in} /> {$vo}
                 </label>
                 {/foreach}
             </div>
@@ -87,8 +87,8 @@
 
             <div class="radio">
                 {foreach name="isMakeupList" item="vo"}
-                <label for="row[is_makeup]-{$key|htmlentities}">
-                    <input id="row[is_makeup]-{$key|htmlentities}" name="row[is_makeup]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.is_makeup" }checked{/in} /> {$vo|htmlentities}
+                <label for="row[is_makeup]-{$key}">
+                    <input id="row[is_makeup]-{$key}" name="row[is_makeup]" type="radio" value="{$key}" {in name="key" value="$row.is_makeup" }checked{/in} /> {$vo}
                 </label>
                 {/foreach}
             </div>

+ 1 - 1
application/admin/view/exam/room/index.html

@@ -5,7 +5,7 @@
         <ul class="nav nav-tabs" data-field="status">
             <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
             {foreach name="statusList" item="vo"}
-            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
             {/foreach}
         </ul>
     </div>

+ 2 - 2
application/admin/view/exam/room_grade/add.html

@@ -36,7 +36,7 @@
                         
             <select  id="c-is_pass" data-rule="required" class="form-control selectpicker" name="row[is_pass]">
                 {foreach name="isPassList" item="vo"}
-                    <option value="{$key|htmlentities}" {in name="key" value="0"}selected{/in}>{$vo|htmlentities}</option>
+                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
 
@@ -48,7 +48,7 @@
                         
             <select  id="c-is_makeup" data-rule="required" class="form-control selectpicker" name="row[is_makeup]">
                 {foreach name="isMakeupList" item="vo"}
-                    <option value="{$key|htmlentities}" {in name="key" value="0"}selected{/in}>{$vo|htmlentities}</option>
+                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
 

+ 5 - 5
application/admin/view/exam/room_grade/detail.html

@@ -24,13 +24,13 @@
             <el-descriptions-item label="考卷分类">{{row.cate.name}}</el-descriptions-item>
             <el-descriptions-item label="考卷名称">{{row.paper.title}}</el-descriptions-item>
             <el-descriptions-item label="出题模式">
-                <el-tag size="small" v-if="row.mode == 'RANDOM'">随机模式</el-tag>
-                <el-tag size="small" v-else-if="row.mode == 'FIX'" type="success">固定模式</el-tag>
+                <el-tag size="small" v-if="row.paper.mode == 'RANDOM'">随机模式</el-tag>
+                <el-tag size="small" v-else-if="row.paper.mode == 'FIX'" type="success">固定模式</el-tag>
             </el-descriptions-item>
-            <el-descriptions-item label="题目数量">{{row.total_count}}题</el-descriptions-item>
-            <el-descriptions-item label="试卷总分">{{row.total_score}}分</el-descriptions-item>
+            <el-descriptions-item label="题目数量">{{row.paper.quantity}}题</el-descriptions-item>
+            <el-descriptions-item label="试卷总分">{{row.paper.total_score}}分</el-descriptions-item>
             <el-descriptions-item label="及格线">
-                <span style="font-weight: bold;">{{row.pass_score}}</span>分
+                <span style="font-weight: bold;">{{row.paper.pass_score}}</span>分
             </el-descriptions-item>
             <el-descriptions-item label="考试限时">{{formatSecond(row.paper.limit_time)}}分</el-descriptions-item>
         </el-descriptions>

+ 2 - 2
application/admin/view/exam/room_grade/edit.html

@@ -36,7 +36,7 @@
                         
             <select  id="c-is_pass" data-rule="required" class="form-control selectpicker" name="row[is_pass]">
                 {foreach name="isPassList" item="vo"}
-                    <option value="{$key|htmlentities}" {in name="key" value="$row.is_pass"}selected{/in}>{$vo|htmlentities}</option>
+                    <option value="{$key}" {in name="key" value="$row.is_pass"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
 
@@ -48,7 +48,7 @@
                         
             <select  id="c-is_makeup" data-rule="required" class="form-control selectpicker" name="row[is_makeup]">
                 {foreach name="isMakeupList" item="vo"}
-                    <option value="{$key|htmlentities}" {in name="key" value="$row.is_makeup"}selected{/in}>{$vo|htmlentities}</option>
+                    <option value="{$key}" {in name="key" value="$row.is_makeup"}selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
 

+ 1 - 1
application/admin/view/exam/room_signup/add.html

@@ -36,7 +36,7 @@
 
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="0"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label>
             {/foreach}
             </div>
 

+ 1 - 1
application/admin/view/exam/room_signup/edit.html

@@ -36,7 +36,7 @@
 
             <div class="radio">
             {foreach name="statusList" item="vo"}
-            <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.status"}checked{/in} /> {$vo|htmlentities}</label>
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
             {/foreach}
             </div>
 

+ 1 - 1
application/admin/view/exam/room_signup/index.html

@@ -5,7 +5,7 @@
         <ul class="nav nav-tabs" data-field="status">
             <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
             {foreach name="statusList" item="vo"}
-            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
             {/foreach}
         </ul>
     </div>

+ 18 - 3
public/assets/js/backend/exam/cate.js

@@ -50,12 +50,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {
                             field: 'operate',
                             title: __('Operate'),
+                            buttons:[
+                                {
+                                    name:'show_question',
+                                    text:'查看试题',
+                                    title:'查看试题',
+                                    icon:'fa fa-exclamation-circle',
+                                    classname:'btn btn-xs btn-info btn-dialog btn-show_question',
+                                    url:'exam/question/index/cate_id/{ids}',
+                                    target:'_self',
+                                },
+                            ],
                             table: table,
                             events: Table.api.events.operate,
                             formatter: Table.api.formatter.operate
                         }
                     ]
-                ]
+                ],
+                onLoadSuccess:function(){
+                    // 这里就是数据渲染结束后的回调函数
+                    $(".btn-show_question").data("area", ['90%','90%']);
+                }
             });
 
             // 为表格绑定事件
@@ -138,14 +153,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                     url: 'exam/cate/restore',
                                     refresh: true
                                 },
-                                {
+                                /*{
                                     name: 'Destroy',
                                     text: __('Destroy'),
                                     classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
                                     icon: 'fa fa-times',
                                     url: 'exam/cate/destroy',
                                     refresh: true
-                                }
+                                }*/
                             ],
                             formatter: Table.api.formatter.operate
                         }

+ 19 - 7
public/assets/js/backend/exam/grade.js

@@ -45,12 +45,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'id', title: __('Id')},
                         {field: 'cate_id', title: __('Cate_id'), visible: false},
                         {field: 'cate.name', title: __('Cate_id'), operate: false},
-                        {field: 'user_id', title: __('User_id'), visible: false},
+                        {field: 'user_id', title: __('User_id')},
                         {field: 'user.nickname', title: __('交卷人昵称'), operate: 'LIKE'},
-                        {field: 'user.mobile', title: __('交卷人手机'), operate: 'LIKE'},
-                        {field: 'paper_id', title: __('Paper_id'), visible: false},
+//                        {field: 'user.mobile', title: __('交卷人手机'), operate: 'LIKE'},
+                        {field: 'paper_id', title: __('Paper_id')},
                         {field: 'paper.title', title: __('Paper.title'), operate: false},
-                        {field: 'score', title: __('Score'), operate: false},
+                        {field: 'score', title: __('Score'), operate: false,sortable:true },
                         {
                             field: 'is_pass', title: __('Is_pass'), searchList: {"1": __('及格'), "0": __('不及格')},
                             formatter: Table.api.formatter.normal
@@ -66,8 +66,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             formatter: Controller.formatter.formatSecond
                         },
                         {
-                            field: 'createtime',
-                            title: __('Createtime'),
+                            field: 'start_time',
+                            title: __('Start_time'),
+                            operate: 'RANGE',
+                            addclass: 'datetimerange',
+                            autocomplete: false,
+                            formatter: Table.api.formatter.datetime
+                        },
+                        {
+                            field: 'finish_time',
+                            title: __('Finish_time'),
                             operate: 'RANGE',
                             addclass: 'datetimerange',
                             autocomplete: false,
@@ -108,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);
@@ -125,3 +133,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
     };
     return Controller;
 });
+//打印ctrl+P
+function printPage() {
+    window.print();
+}

+ 121 - 9
public/assets/js/backend/exam/paper.js

@@ -1,8 +1,23 @@
 let configs_count = {}
 let config_dialog = 0
 
-define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
-
+define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function ($, undefined, Backend, Table, Form) {
+    //读取选中的条目
+    $.jstree.core.prototype.get_all_checked = function (full) {
+        var obj = this.get_selected(), i, j;
+        for (i = 0, j = obj.length; i < j; i++) {
+            obj = obj.concat(this.get_node(obj[i]).parents);
+        }
+        obj = $.grep(obj, function (v, i, a) {
+            return v != '#';
+        });
+        obj = obj.filter(function (itm, i, a) {
+            return i == a.indexOf(itm);
+        });
+        return full ? $.map(obj, $.proxy(function (i) {
+            return this.get_node(i);
+        }, this)) : obj;
+    };
     var Controller = {
         index: function () {
             // 初始化表格参数配置
@@ -22,7 +37,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             //在普通搜索渲染后
             table.on('post-common-search.bs.table', function (event, table) {
                 let form = $("form", table.$commonsearch);
-                $("input[name='cate_id']", form).addClass("selectpage").data("source", "exam/cate/index").data("params", {"custom[kind]": "PAPER", "custom[isTree]": true,}).data("orderBy", "sort desc");
+                $("input[name='cate_id']", form).addClass("selectpage").data("source", "exam/cate/selectpage").data("params", {"custom[kind]": "QUESTION","isTree":true}).data("orderBy", "sort desc");
                 // $("input[name='exam_type_id']", form).addClass("selectpage").data("source", "exam_type/index").data("orderBy", "sort desc");
 
                 Form.events.cxselect(form);
@@ -45,8 +60,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 showToggle: false,//隐藏浏览模式
                 showColumns: false,//隐藏显示隐藏模式
                 searchFormVisible: true,//默认显示搜索表单
-                fixedColumns: true,
-                fixedRightNumber: 1,
                 columns: [
                     [
                         {checkbox: true},
@@ -54,10 +67,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'cate_id', title: __('Cate_id'), autocomplete: false, visible: false},
                         {field: 'cate.name', title: __('Cate_id'), operate: false},
                         {field: 'title', title: __('Title'), autocomplete: false, operate: 'LIKE'},
+                        {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
                         // {field: 'configs', title: __('Configs'), operate: 'LIKE'},
                         {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'),
@@ -89,7 +104,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             autocomplete: false,
                             formatter: Table.api.formatter.datetime
                         },
-                        {field: 'is_only_room', title: __('Is_only_room'), searchList: {"1":__('Yes'),"0":__('No')}, formatter: Table.api.formatter.toggle},
+//                        {field: 'is_only_room', title: __('Is_only_room'), searchList: {"1":__('Yes'),"0":__('No')}, formatter: Table.api.formatter.toggle},
                         {
                             field: 'status',
                             title: __('Status'),
@@ -110,11 +125,46 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             field: 'operate',
                             title: __('Operate'),
                             table: table,
+                            buttons:[
+                                {
+                                    name:'selectuser',
+                                    text:'选择用户',
+                                    title:'选择用户',
+                                    icon:'fa fa-exclamation-circle',
+                                    classname:'btn btn-xs btn-info btn-dialog btn-selectuser',
+                                    url:'exam/paper/selectuser/id/{ids}?dialog=1',
+                                    target:'_self',
+                                },
+                                {
+                                    name:'grade',
+                                    text:'成绩',
+                                    title:'成绩',
+                                    icon:'fa fa-exclamation-circle',
+                                    classname:'btn btn-xs btn-info btn-dialog btn-grade',
+                                    url:'exam/grade/index/paper_id/{ids}?dialog=1',
+                                    target:'_self',
+                                },
+                                {
+                                    name:'nograde',
+                                    text:'缺考',
+                                    title:'缺考',
+                                    icon:'fa fa-exclamation-circle',
+                                    classname:'btn btn-xs btn-info btn-dialog btn-nograde',
+                                    url:'exam/paper/nograde/id/{ids}',
+                                    target:'_self',
+                                }
+                            ],
                             events: Table.api.events.operate,
                             formatter: Table.api.formatter.operate
                         }
                     ]
-                ]
+                ],
+                onLoadSuccess:function(){
+                    // 这里就是数据渲染结束后的回调函数
+                    $(".btn-selectuser").data("area", ['80%','80%']);
+                    $(".btn-grade").data("area", ['90%','90%']);
+                    $(".btn-nograde").data("area", ['90%','90%']);
+                }
             });
 
             // 为表格绑定事件
@@ -162,14 +212,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                     url: 'exam/paper/restore',
                                     refresh: true
                                 },
-                                {
+                                /*{
                                     name: 'Destroy',
                                     text: __('Destroy'),
                                     classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
                                     icon: 'fa fa-times',
                                     url: 'exam/paper/destroy',
                                     refresh: true
-                                }
+                                }*/
                             ],
                             formatter: Table.api.formatter.operate
                         }
@@ -185,6 +235,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             Controller.api.bindConfigs()
             Controller.api.bindTime()
         },
+        selectuser: function () {
+            Controller.apisu.bindevent();
+        },
+        nograde: function () {
+            Controller.api.bindevent()
+        },
         edit: function () {
             Controller.api.bindevent()
             Controller.api.bindConfigs()
@@ -192,6 +248,60 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             Controller.api.renderCountScore()
             Controller.api.bindTime()
         },
+
+        apisu: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"), null, null, function () {
+                    if ($("#treeview").length > 0) {
+                        var r = $("#treeview").jstree("get_all_checked");
+                        $("input[name='row[user_rule]']").val(r.join(','));
+                    }
+                    return true;
+                });
+                //渲染权限节点树
+                //销毁已有的节点树
+                $("#treeview").jstree("destroy");
+                Controller.apisu.rendertree(nodeData);
+                //全选和展开
+                $(document).on("click", "#checkall", function () {
+                    $("#treeview").jstree($(this).prop("checked") ? "check_all" : "uncheck_all");
+                });
+                $(document).on("click", "#expandall", function () {
+                    $("#treeview").jstree($(this).prop("checked") ? "open_all" : "close_all");
+                });
+                $("select[name='row[pid]']").trigger("change");
+            },
+
+            rendertree: function (content) {
+                $("#treeview")
+                    .on('redraw.jstree', function (e) {
+                        $(".layer-footer").attr("domrefresh", Math.random());
+                    })
+                    .jstree({
+                        "themes": {"stripes": true},
+                        "checkbox": {
+                            "keep_selected_style": false,
+                        },
+                        "types": {
+                            "root": {
+                                "icon": "fa fa-folder-open",
+                            },
+                            "menu": {
+                                "icon": "fa fa-folder-open",
+                            },
+                            "file": {
+                                "icon": "fa fa-file-o",
+                            }
+                        },
+                        "plugins": ["checkbox", "types"],
+                        "core": {
+                            'check_callback': true,
+                            "data": content
+                        }
+                    });
+            },
+        },
+
         api: {
             bindevent: function () {
                 Form.api.bindevent($("form[role=form]"), function () {
@@ -232,6 +342,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 });
             },
 
+
+
             // 选题模式设置
             bindConfigs: function () {
                 // 选题模式弹窗

+ 20 - 18
public/assets/js/backend/exam/question.js

@@ -59,34 +59,24 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'upload'], function (
                         {
                             field: 'kind',
                             title: __('Kind'),
-                            searchList: {"JUDGE": __('Judge'), "SINGLE": __('Single'), "MULTI": __('Multi'), "FILL": __('Fill'), "SHORT": __('Short'), "MATERIAL": __('Material')},
+                            searchList: {"JUDGE": __('Judge'), "SINGLE": __('Single'), "MULTI": __('Multi'), /*"FILL": __('Fill'),*/ "SHORT": __('Short')/*, "MATERIAL": __('Material')*/},
                             formatter: Table.api.formatter.normal,
                             // operate: "IN",
                         },
-                        {
-                          field: 'title', title: __('Title'), autocomplete: false, operate: 'LIKE',
-                          sortable: true,
-                          // formatter: Table.api.formatter.content,
-                          formatter: function (value, row, index) {
-                            if (row.is_repeat) {
-                              value = '<span class="text-danger">' + value + '</span>';
-                            }
-                            return Table.api.formatter.content.call(this, value, row, index);
-                          },
-                        },
-                        {
+                        {field: 'title', title: __('Title'), autocomplete: false, operate: 'LIKE', formatter: Table.api.formatter.content},
+                        /*{
                           field: 'is_material_child',
                           title: __('属于材料题子题'),
                           searchList: {"0": __('否'), "1": __('是')},
                           defaultValue: 0,
                           visible: false
-                        },
-                        {
+                        },*/
+                       /* {
                             field: 'difficulty',
                             title: __('Difficulty'),
                             searchList: {"EASY": __('Easy'), "GENERAL": __('General'), "HARD": __('Hard')},
                             formatter: Table.api.formatter.normal
-                        },
+                        },*/
                         {
                             field: 'answer', title: __('Answer'), halign: 'center', align: 'left', operate: false, formatter: function (value, row, index) {
                                 var answer = value;
@@ -128,6 +118,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'upload'], function (
                             formatter: Table.api.formatter.status,
                             operate: false
                         },
+                        {
+                            field: 'total_count',
+                            title: '总答题次数',
+                        },
+                        {
+                            field: 'right_count',
+                            title: '答对数',
+                        },
+                        {
+                            field: 'error_count',
+                            title: '答错数',
+                        },
                         /*{
                             field: 'createtime',
                             title: __('Createtime'),
@@ -212,14 +214,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'upload'], function (
                                     url: 'exam/question/restore',
                                     refresh: true
                                 },
-                                {
+                                /*{
                                     name: 'Destroy',
                                     text: __('Destroy'),
                                     classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
                                     icon: 'fa fa-times',
                                     url: 'exam/question/destroy',
                                     refresh: true
-                                }
+                                }*/
                             ],
                             formatter: Table.api.formatter.operate
                         }