|
@@ -46,6 +46,11 @@ class Exercise extends Backend
|
|
|
|
|
|
public function index()
|
|
public function index()
|
|
{
|
|
{
|
|
|
|
+ $info = $this->exam_model->where(['user_id'=>$this->auth->id,'exam_status'=>4])->find();
|
|
|
|
+ if(!empty($info)){
|
|
|
|
+ echo "<script>location.href='/admin/student/exercise/examing/ids/".$info['exam_id']."'</script>";
|
|
|
|
+ die();
|
|
|
|
+ }
|
|
//设置过滤方法
|
|
//设置过滤方法
|
|
$this->request->filter(['strip_tags', 'trim']);
|
|
$this->request->filter(['strip_tags', 'trim']);
|
|
if (false === $this->request->isAjax()) {
|
|
if (false === $this->request->isAjax()) {
|
|
@@ -66,10 +71,10 @@ class Exercise extends Backend
|
|
|
|
|
|
$exam_id = $this->model->insertGetId($params);
|
|
$exam_id = $this->model->insertGetId($params);
|
|
|
|
|
|
- $sim = Db::name('sim')->where('sim_type',$params['sim_type'])->where('seat_id',$this->auth->seat_id)->find();
|
|
|
|
- if(empty($sim)){
|
|
|
|
- $this->error('未找到模拟器,不可练习');
|
|
|
|
- }
|
|
|
|
|
|
+// $sim = Db::name('sim')->where('sim_type',$params['sim_type'])->where('seat_id',$this->auth->seat_id)->find();
|
|
|
|
+// if(empty($sim)){
|
|
|
|
+// $this->error('未找到模拟器,不可练习');
|
|
|
|
+// }
|
|
|
|
|
|
$data = [
|
|
$data = [
|
|
'exam_collection_id' => $exam_id,
|
|
'exam_collection_id' => $exam_id,
|