|
@@ -126,7 +126,7 @@ public class TEExamController {
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
|
public Result exit(@ApiJsonObject(name = "saveInvigilateUser", value = {
|
|
|
@ApiJsonProperty(key = "recordId", type = "long", example = "1", description = "考试记录id", required = true)
|
|
|
- }) @ApiParam(value = "考试记录id", required = true) @RequestBody Map<String, Object> mapParameter) throws NoSuchAlgorithmException {
|
|
|
+ }) @ApiParam(value = "考试记录id", required = true) @RequestBody Map<String, Object> mapParameter) throws NoSuchAlgorithmException, IOException {
|
|
|
if (Objects.isNull(mapParameter.get("recordId")) || Objects.equals(mapParameter.get("recordId"), "")) {
|
|
|
throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
|
}
|
|
@@ -146,9 +146,7 @@ public class TEExamController {
|
|
|
String clientWebsocketId = ExamRecordCacheUtil.getClientWebsocketId(Long.parseLong(recordId));
|
|
|
if (Objects.nonNull(clientWebsocketId)) {
|
|
|
WebSocketOeServer webSocketOeServer = webSocketMap.get(clientWebsocketId);
|
|
|
- if (Objects.nonNull(webSocketOeServer)) {
|
|
|
- webSocketOeServer.onClose();
|
|
|
- }
|
|
|
+ WebSocketOeServer.close(webSocketOeServer);
|
|
|
}
|
|
|
return ResultUtil.ok(true);
|
|
|
}
|
|
@@ -213,7 +211,7 @@ public class TEExamController {
|
|
|
@ApiOperation(value = "提交作答结果")
|
|
|
@RequestMapping(value = "/answer/submit", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
|
- public Result answerSubmit(@RequestBody AnswerSubmitParamBean param) {
|
|
|
+ public Result answerSubmit(@RequestBody AnswerSubmitParamBean param) throws IOException {
|
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
|
if (Objects.isNull(param.getRecordId()) || Objects.equals(param.getRecordId(), "")) {
|
|
|
throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
@@ -241,11 +239,9 @@ public class TEExamController {
|
|
|
// ExamRecordCacheUtil.setStatus(param.getRecordId(), ExamRecordStatusEnum.FINISHED, System.currentTimeMillis());
|
|
|
// ConcurrentHashMap<String, WebSocketOeServer> webSocketMap = WebSocketOeServer.getWebSocketMap();
|
|
|
// String clientWebsocketId = ExamRecordCacheUtil.getClientWebsocketId(param.getRecordId());
|
|
|
-// WebSocketOeServer webSocketOeServer = webSocketMap.get(clientWebsocketId);
|
|
|
-// try {
|
|
|
+// if (Objects.nonNull(clientWebsocketId)) {
|
|
|
+// WebSocketOeServer webSocketOeServer = webSocketMap.get(clientWebsocketId);
|
|
|
// WebSocketOeServer.close(webSocketOeServer);
|
|
|
-// } catch (IOException e) {
|
|
|
-// e.printStackTrace();
|
|
|
// }
|
|
|
|
|
|
AnswerSubmitBean ret = teExamService.answerSubmit(teStudent.getId(), param.getRecordId(), param.getMainNumber(),
|