| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | |
| | | + " 得分:" + scoreVm |
| | | + " 耗时:" + ExamUtil.secondToVM(examPaperAnswer.getDoTime()); |
| | | userEventLog.setContent(content); |
| | | examPaperAnswerInfo.setTemplateId(examPaperSubmitVM.getTemplatesId()); |
| | | eventPublisher.publishEvent(new CalculateExamPaperAnswerCompleteEvent(examPaperAnswerInfo)); |
| | | eventPublisher.publishEvent(new UserEvent(userEventLog)); |
| | | //首页随机试卷操作 |
| | |
| | | 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); |
| | | } |
| | | |