xiangpei
2025-05-14 47cd9ecc0eff38ffe6b3b794b2bf197e958f4403
src/main/java/com/mindskip/xzs/listener/CalculateExamPaperAnswerListener.java
@@ -58,15 +58,17 @@
        List<ExamPaperQuestionCustomerAnswer> examPaperQuestionCustomerAnswers = examPaperAnswerInfo.getExamPaperQuestionCustomerAnswers();
        examPaperAnswerService.insertByFilter(examPaperAnswer);
        // 最优成绩有效,其余无效
        examPaperAnswerService.maxGrade(examPaperAnswer, examPaperAnswerInfo.getTemplateId());
        examPaperQuestionCustomerAnswers.stream().filter(a -> QuestionTypeEnum.needSaveTextContent(a.getQuestionType())).forEach(d -> {
            TextContent textContent = new TextContent(d.getAnswer(), now);
            textContentService.insertByFilter(textContent);
            d.setTextContentId(textContent.getId());
            d.setAnswer(null);
        });
        examPaperQuestionCustomerAnswers.forEach(d -> {
            d.setExamPaperAnswerId(examPaperAnswer.getId());
        });
        examPaperQuestionCustomerAnswers.forEach(d -> d.setExamPaperAnswerId(examPaperAnswer.getId()));
        examPaperQuestionCustomerAnswerService.insertList(examPaperQuestionCustomerAnswers);
        switch (ExamPaperTypeEnum.fromCode(examPaper.getPaperType())) {