|
@@ -11,6 +11,9 @@ import cn.com.qmth.examcloud.core.oe.admin.dao.entity.*;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordDataService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordDataService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordForMarkingService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordForMarkingService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordQuestionsService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordQuestionsService;
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.student.api.ExamRecordDataCloudService;
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.student.api.request.ExistExamRecordDataReq;
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.student.api.response.ExistExamRecordDataResp;
|
|
import cn.com.qmth.examcloud.question.commons.core.question.AnswerType;
|
|
import cn.com.qmth.examcloud.question.commons.core.question.AnswerType;
|
|
import cn.com.qmth.examcloud.question.commons.core.question.DefaultQuestionStructure;
|
|
import cn.com.qmth.examcloud.question.commons.core.question.DefaultQuestionStructure;
|
|
import cn.com.qmth.examcloud.question.commons.core.question.DefaultQuestionUnit;
|
|
import cn.com.qmth.examcloud.question.commons.core.question.DefaultQuestionUnit;
|
|
@@ -80,6 +83,8 @@ public class ExamRecordCloudServiceProvider extends ControllerSupport implements
|
|
@Autowired
|
|
@Autowired
|
|
private ExamRecordDataService examRecordDataService;
|
|
private ExamRecordDataService examRecordDataService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ExamRecordDataCloudService examRecordDataCloudService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@ApiOperation(value = "查询是否已经开考")
|
|
@ApiOperation(value = "查询是否已经开考")
|
|
@@ -102,10 +107,19 @@ public class ExamRecordCloudServiceProvider extends ControllerSupport implements
|
|
return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
};
|
|
};
|
|
|
|
|
|
- long count = examRecordDataRepo.count(specification);
|
|
|
|
|
|
+ Boolean existed = examRecordDataRepo.count(specification) > 0;
|
|
|
|
+ if (!existed) {
|
|
|
|
+ // 若不存在考试记录,则再去“考试记录临时表”中查询确认一次(未交卷情况)
|
|
|
|
+ ExistExamRecordDataReq existReq = new ExistExamRecordDataReq();
|
|
|
|
+ existReq.setExamId(req.getExamId());
|
|
|
|
+ existReq.setCourseId(req.getCourseId());
|
|
|
|
+ existReq.setStudentId(req.getStudentId());
|
|
|
|
+ ExistExamRecordDataResp resp = examRecordDataCloudService.existExamRecordData(existReq);
|
|
|
|
+ existed = resp.getExisted();
|
|
|
|
+ }
|
|
|
|
|
|
CheckExamIsStartedResp resp = new CheckExamIsStartedResp();
|
|
CheckExamIsStartedResp resp = new CheckExamIsStartedResp();
|
|
- resp.setIsStarted(count > 0);
|
|
|
|
|
|
+ resp.setIsStarted(existed);
|
|
return resp;
|
|
return resp;
|
|
}
|
|
}
|
|
|
|
|