|
@@ -65,6 +65,15 @@ class Exercise extends Backend
|
|
$params['end_time'] = date('Y-m-d');
|
|
$params['end_time'] = date('Y-m-d');
|
|
$exam_id = $this->model->insertGetId($params);
|
|
$exam_id = $this->model->insertGetId($params);
|
|
|
|
|
|
|
|
+ //先请求接口判断,再进行处理
|
|
|
|
+ if(Env::get('app.is_fault')){
|
|
|
|
+ $url = config('site.url_type').'/sim/real-exam/student/self-exercise/start/'.$exam_id;
|
|
|
|
+ $ret = json_decode(send_get($url),true);
|
|
|
|
+ if($ret['code']!=200){
|
|
|
|
+ $this->error($ret['msg']);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
$sim = Db::name('sim')->where('sim_type',$params['sim_type'])->where('seat_id',$this->auth->seat_id)->find();
|
|
$sim = Db::name('sim')->where('sim_type',$params['sim_type'])->where('seat_id',$this->auth->seat_id)->find();
|
|
if(empty($sim)){
|
|
if(empty($sim)){
|
|
$this->error('未找到模拟器,不可练习');
|
|
$this->error('未找到模拟器,不可练习');
|
|
@@ -120,7 +129,7 @@ class Exercise extends Backend
|
|
|
|
|
|
$count = $examid;
|
|
$count = $examid;
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
Db::commit();
|
|
Db::commit();
|
|
} catch (PDOException|Exception $e) {
|
|
} catch (PDOException|Exception $e) {
|
|
Db::rollback();
|
|
Db::rollback();
|
|
@@ -143,10 +152,8 @@ class Exercise extends Backend
|
|
|
|
|
|
//先请求接口判断,再进行处理
|
|
//先请求接口判断,再进行处理
|
|
if(Env::get('app.is_fault')){
|
|
if(Env::get('app.is_fault')){
|
|
- $url = config('site.url_type').'/sim/real-exam/student/exam/submit/'.$ids;
|
|
|
|
- // /dev-api/sim/real-exam/student/exam/submit/{examId}
|
|
|
|
|
|
+ $url = config('site.url_type').'/sim/real-exam/student/self-exercise/submit/'.$ids;
|
|
$ret = json_decode(send_get($url),true);
|
|
$ret = json_decode(send_get($url),true);
|
|
- // halt($ret);
|
|
|
|
if($ret['code']!=200){
|
|
if($ret['code']!=200){
|
|
$this->error($ret['msg']);
|
|
$this->error($ret['msg']);
|
|
}
|
|
}
|