|
@@ -80,7 +80,7 @@ public class TEExamController {
|
|
@ApiOperation(value = "开始考试")
|
|
@ApiOperation(value = "开始考试")
|
|
@RequestMapping(value = "/start", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/start", method = RequestMethod.POST)
|
|
@ApiResponses({ @ApiResponse(code = 200, message = "试卷信息") })
|
|
@ApiResponses({ @ApiResponse(code = 200, message = "试卷信息") })
|
|
- public ExamStartBean start(@ApiParam(value = "考生ID", required = true) @RequestParam Long recordId,
|
|
|
|
|
|
+ public ExamStartBean start(@ApiParam(value = "考试记录ID", required = true) @RequestParam Long recordId,
|
|
@ApiParam(value = "断点续考原因", required = false) @RequestParam String reason) {
|
|
@ApiParam(value = "断点续考原因", required = false) @RequestParam String reason) {
|
|
TEStudent teStudent = (TEStudent) ServletUtil.getRequestStudentAccount();
|
|
TEStudent teStudent = (TEStudent) ServletUtil.getRequestStudentAccount();
|
|
String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
@@ -98,7 +98,7 @@ public class TEExamController {
|
|
@ApiOperation(value = "上传个人试卷结构")
|
|
@ApiOperation(value = "上传个人试卷结构")
|
|
@RequestMapping(value = "/student_paper_struct/upload", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/student_paper_struct/upload", method = RequestMethod.POST)
|
|
@ApiResponses({ @ApiResponse(code = 200, message = "试卷信息") })
|
|
@ApiResponses({ @ApiResponse(code = 200, message = "试卷信息") })
|
|
- public Long studentPaperStruct(@ApiParam(value = "考生ID", required = true) @RequestParam Long recordId,
|
|
|
|
|
|
+ public Long studentPaperStruct(@ApiParam(value = "考试记录ID", required = true) @RequestParam Long recordId,
|
|
@ApiParam(value = "试卷结构json字符串", required = true) @RequestParam String content) {
|
|
@ApiParam(value = "试卷结构json字符串", required = true) @RequestParam String content) {
|
|
TEStudent teStudent = (TEStudent) ServletUtil.getRequestStudentAccount();
|
|
TEStudent teStudent = (TEStudent) ServletUtil.getRequestStudentAccount();
|
|
String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
@@ -116,7 +116,7 @@ public class TEExamController {
|
|
@ApiOperation(value = "提交作答结果")
|
|
@ApiOperation(value = "提交作答结果")
|
|
@RequestMapping(value = "/answer/submit", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/answer/submit", method = RequestMethod.POST)
|
|
@ApiResponses({ @ApiResponse(code = 200, message = "试卷信息") })
|
|
@ApiResponses({ @ApiResponse(code = 200, message = "试卷信息") })
|
|
- public Long answerSubmit(@ApiParam(value = "考生ID", required = true) @RequestParam Long recordId,
|
|
|
|
|
|
+ public Long answerSubmit(@ApiParam(value = "考试记录ID", required = true) @RequestParam Long recordId,
|
|
@ApiParam(value = "大题号", required = true) @RequestParam Integer mainNumber,
|
|
@ApiParam(value = "大题号", required = true) @RequestParam Integer mainNumber,
|
|
@ApiParam(value = "小题号", required = true) @RequestParam Integer subNumber,
|
|
@ApiParam(value = "小题号", required = true) @RequestParam Integer subNumber,
|
|
@ApiParam(value = "套题子题序号", required = false) @RequestParam Integer subIndex,
|
|
@ApiParam(value = "套题子题序号", required = false) @RequestParam Integer subIndex,
|
|
@@ -136,4 +136,23 @@ public class TEExamController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "更新音频剩余播放次数")
|
|
|
|
+ @RequestMapping(value = "/audio_left_play_count/submit", method = RequestMethod.POST)
|
|
|
|
+ @ApiResponses({ @ApiResponse(code = 200, message = "试卷信息") })
|
|
|
|
+ public Integer audioLeftPlayCountSubmit(@ApiParam(value = "考试记录ID", required = true) @RequestParam Long recordId,
|
|
|
|
+ @ApiParam(value = "音频标识", required = true) @RequestParam String key,
|
|
|
|
+ @ApiParam(value = "剩余播放次数", required = true) @RequestParam Integer count) {
|
|
|
|
+ TEStudent teStudent = (TEStudent) ServletUtil.getRequestStudentAccount();
|
|
|
|
+ String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
|
|
+ Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
|
|
+ if (!lock) {
|
|
|
|
+ throw new BusinessException(ExceptionResultEnum.REQUEST_AWAIT);
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ return teExamService.audioLeftPlayCountSubmit(teStudent.getId(), recordId,key,count);
|
|
|
|
+ } finally {
|
|
|
|
+ redisUtil.releaseLock(lockKey);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|