|
|
@ -58,21 +58,48 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@GetMapping("/previous") |
|
|
|
@PostMapping("/previous") |
|
|
|
public R previousQuestion(@RequestParam("evaluationRecordId") Integer evaluationRecordId, |
|
|
|
public R previousQuestion(@RequestBody EvaluationRecordVO evaluationRecordVO) throws ExecutionException, InterruptedException { |
|
|
|
@RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo, |
|
|
|
Integer evaluationRecordId = evaluationRecordVO.getId(); |
|
|
|
@RequestParam(value = "userAnswer", required = false) String userAnswer) throws ExecutionException, InterruptedException { |
|
|
|
String userAnswer = evaluationRecordVO.getUserAnswer(); |
|
|
|
EvaluationRecordVO evaluationRecordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo - 1); |
|
|
|
Integer currentQuestionSortNo = evaluationRecordVO.getCurrentQuestionSortNo(); |
|
|
|
return R.ok().put("data", evaluationRecordVO); |
|
|
|
EvaluationRecordVO recordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo + 1); |
|
|
|
|
|
|
|
return R.ok().put("data", recordVO); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 备份:上一题/下一题/提交
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
|
|
|
// @GetMapping("/previous")
|
|
|
|
|
|
|
|
// public R previousQuestion(@RequestParam("evaluationRecordId") Integer evaluationRecordId,
|
|
|
|
|
|
|
|
// @RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo,
|
|
|
|
|
|
|
|
// @RequestParam(value = "userAnswer", required = false) String userAnswer) throws ExecutionException, InterruptedException {
|
|
|
|
|
|
|
|
// EvaluationRecordVO evaluationRecordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo - 1);
|
|
|
|
|
|
|
|
// return R.ok().put("data", evaluationRecordVO);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
|
|
|
// @GetMapping("/next")
|
|
|
|
|
|
|
|
// public R nextQuestion(@RequestParam("evaluationRecordId") Integer evaluationRecordId,
|
|
|
|
|
|
|
|
// @RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo,
|
|
|
|
|
|
|
|
// @RequestParam(value = "userAnswer", required = false) String userAnswer) throws ExecutionException, InterruptedException {
|
|
|
|
|
|
|
|
// EvaluationRecordVO evaluationRecordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo + 1);
|
|
|
|
|
|
|
|
// return R.ok().put("data", evaluationRecordVO);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
|
|
|
// @GetMapping("/submit")
|
|
|
|
|
|
|
|
// public R submitEvaluation(@RequestParam("evaluationRecordId") Integer evaluationRecordId,
|
|
|
|
|
|
|
|
// @RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo,
|
|
|
|
|
|
|
|
// @RequestParam(value = "userAnswer", required = false) String userAnswer,
|
|
|
|
|
|
|
|
// @RequestParam("userId") Integer userId) throws ExecutionException, InterruptedException {
|
|
|
|
|
|
|
|
// EvaluationRecordSubmitVO recordSubmitVO = evaluationRecordService.submitEvaluation(evaluationRecordId, currentQuestionSortNo, userAnswer, userId);
|
|
|
|
|
|
|
|
// return R.ok().put("data", recordSubmitVO);
|
|
|
|
|
|
|
|
// }
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@GetMapping("/next") |
|
|
|
@PostMapping("/next") |
|
|
|
public R nextQuestion(@RequestParam("evaluationRecordId") Integer evaluationRecordId, |
|
|
|
public R nextQuestion(@RequestBody EvaluationRecordVO evaluationRecordVO) throws ExecutionException, InterruptedException { |
|
|
|
@RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo, |
|
|
|
Integer evaluationRecordId = evaluationRecordVO.getId(); |
|
|
|
@RequestParam(value = "userAnswer", required = false) String userAnswer) throws ExecutionException, InterruptedException { |
|
|
|
String userAnswer = evaluationRecordVO.getUserAnswer(); |
|
|
|
EvaluationRecordVO evaluationRecordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo + 1); |
|
|
|
Integer currentQuestionSortNo = evaluationRecordVO.getCurrentQuestionSortNo(); |
|
|
|
return R.ok().put("data", evaluationRecordVO); |
|
|
|
EvaluationRecordVO recordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo + 1); |
|
|
|
|
|
|
|
return R.ok().put("data", recordVO); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -83,11 +110,12 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@GetMapping("/submit") |
|
|
|
@PostMapping("/submit") |
|
|
|
public R submitEvaluation(@RequestParam("evaluationRecordId") Integer evaluationRecordId, |
|
|
|
public R submitEvaluation(@RequestBody EvaluationRecordVO evaluationRecordVO) throws ExecutionException, InterruptedException { |
|
|
|
@RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo, |
|
|
|
Integer evaluationRecordId = evaluationRecordVO.getId(); |
|
|
|
@RequestParam(value = "userAnswer", required = false) String userAnswer, |
|
|
|
String userAnswer = evaluationRecordVO.getUserAnswer(); |
|
|
|
@RequestParam("userId") Integer userId) throws ExecutionException, InterruptedException { |
|
|
|
Integer currentQuestionSortNo = evaluationRecordVO.getCurrentQuestionSortNo(); |
|
|
|
|
|
|
|
Integer userId = evaluationRecordVO.getUserId(); |
|
|
|
EvaluationRecordSubmitVO recordSubmitVO = evaluationRecordService.submitEvaluation(evaluationRecordId, currentQuestionSortNo, userAnswer, userId); |
|
|
|
EvaluationRecordSubmitVO recordSubmitVO = evaluationRecordService.submitEvaluation(evaluationRecordId, currentQuestionSortNo, userAnswer, userId); |
|
|
|
return R.ok().put("data", recordSubmitVO); |
|
|
|
return R.ok().put("data", recordSubmitVO); |
|
|
|
} |
|
|
|
} |
|
|
|