xiangpei
2025-05-14 47cd9ecc0eff38ffe6b3b794b2bf197e958f4403
src/main/java/com/mindskip/xzs/controller/student/ExamPaperAnswerController.java
@@ -34,17 +34,15 @@
    private final ApplicationEventPublisher eventPublisher;
    private final ExamPaperSubjectService examPaperSubjectService;
    private final ExamTemplatesUserCountService examTemplatesUserCountService;
    private final ExamMissService examMissService;
    @Autowired
    public ExamPaperAnswerController(ExamPaperAnswerService examPaperAnswerService, ExamPaperService examPaperService, SubjectService subjectService, ApplicationEventPublisher eventPublisher, ExamPaperSubjectService examPaperSubjectService, ExamTemplatesUserCountService examTemplatesUserCountService, ExamMissService examMissService) {
    public ExamPaperAnswerController(ExamPaperAnswerService examPaperAnswerService, ExamPaperService examPaperService, SubjectService subjectService, ApplicationEventPublisher eventPublisher, ExamPaperSubjectService examPaperSubjectService, ExamTemplatesUserCountService examTemplatesUserCountService) {
        this.examPaperAnswerService = examPaperAnswerService;
        this.examPaperService = examPaperService;
        this.subjectService = subjectService;
        this.eventPublisher = eventPublisher;
        this.examPaperSubjectService = examPaperSubjectService;
        this.examTemplatesUserCountService = examTemplatesUserCountService;
        this.examMissService = examMissService;
    }
@@ -89,6 +87,7 @@
                + " 得分:" + scoreVm
                + " 耗时:" + ExamUtil.secondToVM(examPaperAnswer.getDoTime());
        userEventLog.setContent(content);
        examPaperAnswerInfo.setTemplateId(examPaperSubmitVM.getTemplatesId());
        eventPublisher.publishEvent(new CalculateExamPaperAnswerCompleteEvent(examPaperAnswerInfo));
        eventPublisher.publishEvent(new UserEvent(userEventLog));
        //首页随机试卷操作
@@ -100,13 +99,6 @@
            examTemplatesUserCountService.add(examTemplatesUserCount);
        }
        // 自动提交定义为缺考
        if (examPaperSubmitVM.isAutoCommit()) {
            ExamMiss examMiss = new ExamMiss();
            examMiss.setExamId(examPaperSubmitVM.getId());
            examMiss.setUserId(user.getId());
            examMissService.save(examMiss);
        }
        return RestResponse.ok(scoreVm);
    }