Commit 0289cb74 authored by 陈立彬's avatar 陈立彬

重复答题清除原答题结果

parent 68397d25
...@@ -245,6 +245,7 @@ public class ExamController { ...@@ -245,6 +245,7 @@ public class ExamController {
@RequestParam(value = "user_id") String userId, @RequestParam(value = "user_id") String userId,
@RequestParam(value = "question") String question, @RequestParam(value = "question") String question,
@RequestParam(value = "answer") String answer, @RequestParam(value = "answer") String answer,
@RequestParam(value = "question_id") Long questionId,
@RequestParam(value = "user_answer") String userAnswer) { @RequestParam(value = "user_answer") String userAnswer) {
...@@ -257,6 +258,18 @@ public class ExamController { ...@@ -257,6 +258,18 @@ public class ExamController {
qa.setQuestion(question); qa.setQuestion(question);
qa.setAnswer(answer); qa.setAnswer(answer);
qa.setScene(scene); qa.setScene(scene);
qa.setQuestionId(questionId);
// 更新之前考试过的题目
ElehSessionQaRecordDo recordDo = qaRecordMapper.selectQaRecord(tenant, sessionId, userId, questionId);
if(Objects.nonNull(recordDo)) {
ElehSessionQaRecordDo update = new ElehSessionQaRecordDo();
update.setAnswer("");
update.setScoreCriteria("");
update.setScore(null);
update.setId(recordDo.getId());
qaRecordMapper.updateById(update);
}
log.info("PUT REDIS KEY = {}, REDIS VALUE = {}", redisKey, JSONObject.toJSONString(qa)); log.info("PUT REDIS KEY = {}, REDIS VALUE = {}", redisKey, JSONObject.toJSONString(qa));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment