|
@@ -105,7 +105,7 @@ public class TEExamController {
|
|
|
}
|
|
|
try {
|
|
|
if (param.getExamStudentId() == null) {
|
|
|
- throw new BusinessException("考生id不能为空");
|
|
|
+ throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_ID_IS_NULL);
|
|
|
}
|
|
|
return ResultUtil.ok(teExamService.prepare(teStudent.getId(), param.getExamStudentId()));
|
|
|
} finally {
|
|
@@ -131,7 +131,7 @@ public class TEExamController {
|
|
|
ExamConstant.sendExamStopMsg(Long.valueOf(recordId), false);
|
|
|
} else {
|
|
|
if (Objects.nonNull(status)) {
|
|
|
- throw new BusinessException("考试状态出错");
|
|
|
+ throw new BusinessException(ExceptionResultEnum.EXAM_STATUS_ERROR);
|
|
|
}
|
|
|
}
|
|
|
ConcurrentHashMap<String, WebSocketOeServer> webSocketMap = WebSocketOeServer.getWebSocketMap();
|
|
@@ -154,8 +154,8 @@ public class TEExamController {
|
|
|
throw new BusinessException(ExceptionResultEnum.REQUEST_AWAIT);
|
|
|
}
|
|
|
try {
|
|
|
- if (param.getRecordId() == null) {
|
|
|
- throw new BusinessException("考试记录id不能为空");
|
|
|
+ if (Objects.isNull(param.getRecordId()) || Objects.equals(param.getRecordId(), "")) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
}
|
|
|
ExamStartBean examStartBean = teExamService.start(teStudent.getId(), param.getRecordId());
|
|
|
if (Objects.nonNull(param.getReason())) {
|
|
@@ -193,8 +193,8 @@ public class TEExamController {
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
|
public Result studentPaperStruct(@RequestBody StudentPaperStructParamBean param) {
|
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
|
- if (param.getRecordId() == null) {
|
|
|
- throw new BusinessException("考试记录id不能为空");
|
|
|
+ if (Objects.isNull(param.getRecordId()) || Objects.equals(param.getRecordId(), "")) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
}
|
|
|
if (param.getContent() == null) {
|
|
|
throw new BusinessException("试卷结构json字符串不能为空");
|
|
@@ -208,8 +208,8 @@ public class TEExamController {
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
|
public Result answerSubmit(@RequestBody AnswerSubmitParamBean param) {
|
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
|
- if (param.getRecordId() == null) {
|
|
|
- throw new BusinessException("考试记录id不能为空");
|
|
|
+ if (Objects.isNull(param.getRecordId()) || Objects.equals(param.getRecordId(), "")) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
}
|
|
|
if (param.getMainNumber() == null) {
|
|
|
throw new BusinessException("大题号不能为空");
|
|
@@ -234,8 +234,8 @@ public class TEExamController {
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
|
public Result audioLeftPlayCountSubmit(@RequestBody AudioLeftPlayCountSubmitParamBean param) {
|
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
|
- if (param.getRecordId() == null) {
|
|
|
- throw new BusinessException("考试记录id不能为空");
|
|
|
+ if (Objects.isNull(param.getRecordId()) || Objects.equals(param.getRecordId(), "")) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
}
|
|
|
if (param.getKey() == null) {
|
|
|
throw new BusinessException("音频标识不能为空");
|
|
@@ -268,8 +268,8 @@ public class TEExamController {
|
|
|
throw new BusinessException(ExceptionResultEnum.REQUEST_AWAIT);
|
|
|
}
|
|
|
try {
|
|
|
- if (param.getRecordId() == null) {
|
|
|
- throw new BusinessException("考试记录id不能为空");
|
|
|
+ if (Objects.isNull(param.getRecordId()) || Objects.equals(param.getRecordId(), "")) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
}
|
|
|
return ResultUtil.ok(teExamService.resume(teStudent.getId(), param.getRecordId()));
|
|
|
} finally {
|
|
@@ -288,11 +288,11 @@ public class TEExamController {
|
|
|
throw new BusinessException(ExceptionResultEnum.REQUEST_AWAIT);
|
|
|
}
|
|
|
try {
|
|
|
- if (param.getRecordId() == null) {
|
|
|
- throw new BusinessException("考试记录id不能为空");
|
|
|
+ if (Objects.isNull(param.getRecordId()) || Objects.equals(param.getRecordId(), "")) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
}
|
|
|
if (param.getType() == null) {
|
|
|
- throw new BusinessException("结束类型不能为空");
|
|
|
+ throw new BusinessException(ExceptionResultEnum.FINISH_TYPE_IS_NULL);
|
|
|
}
|
|
|
if (param.getDurationSeconds() == null) {
|
|
|
throw new BusinessException("总用时秒数不能为空");
|
|
@@ -305,14 +305,33 @@ public class TEExamController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value = "查询交卷结果")
|
|
|
@RequestMapping(value = "/result", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
|
public Result result(@RequestBody ResultParamBean param) {
|
|
|
- if (param.getRecordId() == null) {
|
|
|
- throw new BusinessException("考试记录id不能为空");
|
|
|
+ if (Objects.isNull(param.getRecordId()) || Objects.equals(param.getRecordId(), "")) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
}
|
|
|
return ResultUtil.ok(teExamService.result(param.getRecordId()));
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取试卷下载信息")
|
|
|
+ @RequestMapping(value = "/paper/download", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
|
+ public Result paperDownload(@RequestBody ResultParamBean param) {
|
|
|
+ if (Objects.isNull(param.getRecordId()) || Objects.equals(param.getRecordId(), "")) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
+ }
|
|
|
+ return ResultUtil.ok(teExamService.paperDownload(param.getRecordId()));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "试卷下载成功通知")
|
|
|
+ @RequestMapping(value = "/paper/downloaded", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
|
+ public Result paperDownloaded(@RequestBody ResultParamBean param) {
|
|
|
+ if (Objects.isNull(param.getRecordId()) || Objects.equals(param.getRecordId(), "")) {
|
|
|
+ throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
+ }
|
|
|
+ return ResultUtil.ok(Collections.singletonMap("updateTime", System.currentTimeMillis()));
|
|
|
+ }
|
|
|
}
|