|
@@ -52,7 +52,7 @@ class Exercise extends Backend
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
if ($this->request->isPost()) {
|
|
|
- $params = $this->request->post('row/a');
|
|
|
+ $params = $this->request->post();
|
|
|
$count = 0;
|
|
|
Db::startTrans();
|
|
|
try {
|
|
@@ -63,6 +63,7 @@ class Exercise extends Backend
|
|
|
$params['limit_duration'] = 30;
|
|
|
$params['start_time'] = date('Y-m-d');
|
|
|
$params['end_time'] = date('Y-m-d');
|
|
|
+
|
|
|
$exam_id = $this->model->insertGetId($params);
|
|
|
|
|
|
$sim = Db::name('sim')->where('sim_type',$params['sim_type'])->where('seat_id',$this->auth->seat_id)->find();
|
|
@@ -127,6 +128,14 @@ class Exercise extends Backend
|
|
|
$this->error($e->getMessage());
|
|
|
}
|
|
|
if ($count) {
|
|
|
+ //先请求接口判断,再进行处理
|
|
|
+ if(Env::get('app.is_fault')){
|
|
|
+ $url = config('site.url_type').'/sim/real-exam/student/self-exercise/start/'.$count;
|
|
|
+ $ret = json_decode(send_get($url),true);
|
|
|
+ if($ret['code']!=200){
|
|
|
+ $this->error($ret['msg']);
|
|
|
+ }
|
|
|
+ }
|
|
|
$this->success('开始成功','/admin/student/exercise/examing/ids/'.$count);
|
|
|
}
|
|
|
$this->error(__('No rows were updated'));
|
|
@@ -139,14 +148,6 @@ class Exercise extends Backend
|
|
|
if(!$row){
|
|
|
$this->error('未找到记录');
|
|
|
}
|
|
|
- //先请求接口判断,再进行处理
|
|
|
- if(Env::get('app.is_fault') && $row->exam_status==0){
|
|
|
- $url = config('site.url_type').'/sim/real-exam/student/self-exercise/start/'.$ids;
|
|
|
- $ret = json_decode(send_get($url),true);
|
|
|
- if($ret['code']!=200){
|
|
|
- $this->error($ret['msg']);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
if ($this->request->isPost()) {
|
|
|
|