|
@@ -228,44 +228,41 @@ public class TEStudentController {
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
//获取未完考试
|
|
//获取未完考试
|
|
if (Objects.isNull(ExamingDataCacheUtil.getUnFinishedRecordId(teStudent.getId()))) {
|
|
if (Objects.isNull(ExamingDataCacheUtil.getUnFinishedRecordId(teStudent.getId()))) {
|
|
- //获取待考列表
|
|
|
|
- List<TEExamWaitDto> list = teExamService.getWaitingExam(teStudent.getId(), examId, orgId);
|
|
|
|
- if (Objects.nonNull(list) && list.size() > 0) {
|
|
|
|
- map.put("waiting", list);
|
|
|
|
- }
|
|
|
|
|
|
+ map = this.getWaitList(teStudent.getId(), examId, orgId, map);
|
|
} else {
|
|
} else {
|
|
Long recordId = ExamingDataCacheUtil.getUnFinishedRecordId(teStudent.getId());
|
|
Long recordId = ExamingDataCacheUtil.getUnFinishedRecordId(teStudent.getId());
|
|
//获取考试记录缓存
|
|
//获取考试记录缓存
|
|
ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(recordId);
|
|
ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(recordId);
|
|
if (Objects.isNull(status)) {
|
|
if (Objects.isNull(status)) {
|
|
- throw new BusinessException(ExceptionResultEnum.EXAM_STATUS_NOT_NULL);
|
|
|
|
- }
|
|
|
|
- Long ecExamId = ExamRecordCacheUtil.getExamId(recordId);
|
|
|
|
- Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
|
|
- Long examActivityId = ExamRecordCacheUtil.getExamActivityId(recordId);
|
|
|
|
- ExamCacheBean ec = teExamService.getExamCacheBean(ecExamId);//考试缓存
|
|
|
|
- ExamActivityCacheBean examActivityCacheBean = teExamActivityService
|
|
|
|
- .getExamActivityCacheBean(examActivityId);//考试场次缓存
|
|
|
|
- ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
|
|
- //如果断点时间大于整体断点时间,则强制交卷
|
|
|
|
- if (Objects.equals(status, ExamRecordStatusEnum.ANSWERING) || Objects
|
|
|
|
- .equals(status, ExamRecordStatusEnum.BREAK_OFF) || Objects
|
|
|
|
- .equals(status, ExamRecordStatusEnum.RESUME_PREPARE)) {
|
|
|
|
- //只有ANSWERING状态才生成断点
|
|
|
|
- if (Objects.equals(status, ExamRecordStatusEnum.ANSWERING)) {
|
|
|
|
- ExamConstant.sendExamStopMsg(recordId, true, false);
|
|
|
|
- tOeExamRecordService.setExamBreak(recordId);
|
|
|
|
- }
|
|
|
|
- Boolean finished = tOeExamRecordService.examBreakLogic(recordId, false);
|
|
|
|
- if (finished) {
|
|
|
|
- map = this.getWaitList(teStudent.getId(), examId, orgId, map);
|
|
|
|
|
|
+ map = this.getWaitList(teStudent.getId(), examId, orgId, map);
|
|
|
|
+ } else {
|
|
|
|
+ Long ecExamId = ExamRecordCacheUtil.getExamId(recordId);
|
|
|
|
+ Long examStudentId = ExamRecordCacheUtil.getExamStudentId(recordId);
|
|
|
|
+ Long examActivityId = ExamRecordCacheUtil.getExamActivityId(recordId);
|
|
|
|
+ ExamCacheBean ec = teExamService.getExamCacheBean(ecExamId);//考试缓存
|
|
|
|
+ ExamActivityCacheBean examActivityCacheBean = teExamActivityService
|
|
|
|
+ .getExamActivityCacheBean(examActivityId);//考试场次缓存
|
|
|
|
+ ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(examStudentId);
|
|
|
|
+ //如果断点时间大于整体断点时间,则强制交卷
|
|
|
|
+ if (Objects.equals(status, ExamRecordStatusEnum.ANSWERING) || Objects
|
|
|
|
+ .equals(status, ExamRecordStatusEnum.BREAK_OFF) || Objects
|
|
|
|
+ .equals(status, ExamRecordStatusEnum.RESUME_PREPARE)) {
|
|
|
|
+ //只有ANSWERING状态才生成断点
|
|
|
|
+ if (Objects.equals(status, ExamRecordStatusEnum.ANSWERING)) {
|
|
|
|
+ ExamConstant.sendExamStopMsg(recordId, true, false);
|
|
|
|
+ tOeExamRecordService.setExamBreak(recordId);
|
|
|
|
+ }
|
|
|
|
+ Boolean finished = tOeExamRecordService.examBreakLogic(recordId, false);
|
|
|
|
+ if (finished) {
|
|
|
|
+ map = this.getWaitList(teStudent.getId(), examId, orgId, map);
|
|
|
|
+ } else {
|
|
|
|
+ ExamUnFinishBean examUnFinishBean = this
|
|
|
|
+ .unFinishCommon(recordId, ec, examStudentCacheBean, examActivityCacheBean, examStudentId);
|
|
|
|
+ map.put("unFinished", examUnFinishBean);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- ExamUnFinishBean examUnFinishBean = this
|
|
|
|
- .unFinishCommon(recordId, ec, examStudentCacheBean, examActivityCacheBean, examStudentId);
|
|
|
|
- map.put("unFinished", examUnFinishBean);
|
|
|
|
|
|
+ map = this.getWaitList(teStudent.getId(), examId, orgId, map);
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- map = this.getWaitList(teStudent.getId(), examId, orgId, map);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//获取全局考试配置
|
|
//获取全局考试配置
|
|
@@ -348,6 +345,7 @@ public class TEStudentController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
private Map<String, Object> getWaitList(Long studentId, Long examId, Long orgId, Map<String, Object> map) {
|
|
private Map<String, Object> getWaitList(Long studentId, Long examId, Long orgId, Map<String, Object> map) {
|
|
|
|
+ //获取待考列表
|
|
List<TEExamWaitDto> list = teExamService.getWaitingExam(studentId, examId, orgId);
|
|
List<TEExamWaitDto> list = teExamService.getWaitingExam(studentId, examId, orgId);
|
|
if (Objects.nonNull(list) && list.size() > 0) {
|
|
if (Objects.nonNull(list) && list.size() > 0) {
|
|
map.put("waiting", list);
|
|
map.put("waiting", list);
|