| | |
| | | import com.mindskip.xzs.domain.enums.ExamPaperAnswerStatusEnum; |
| | | import com.mindskip.xzs.event.CalculateExamPaperAnswerCompleteEvent; |
| | | import com.mindskip.xzs.event.UserEvent; |
| | | import com.mindskip.xzs.service.ExamPaperAnswerService; |
| | | import com.mindskip.xzs.service.ExamPaperService; |
| | | import com.mindskip.xzs.service.ExamPaperSubjectService; |
| | | import com.mindskip.xzs.service.SubjectService; |
| | | import com.mindskip.xzs.service.*; |
| | | import com.mindskip.xzs.utility.DateTimeUtil; |
| | | import com.mindskip.xzs.utility.ExamUtil; |
| | | import com.mindskip.xzs.utility.PageInfoHelper; |
| | |
| | | private final SubjectService subjectService; |
| | | private final ApplicationEventPublisher eventPublisher; |
| | | private final ExamPaperSubjectService examPaperSubjectService; |
| | | private final ExamTemplatesUserCountService examTemplatesUserCountService; |
| | | |
| | | @Autowired |
| | | public ExamPaperAnswerController(ExamPaperAnswerService examPaperAnswerService, ExamPaperService examPaperService, SubjectService subjectService, ApplicationEventPublisher eventPublisher, ExamPaperSubjectService examPaperSubjectService) { |
| | | 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; |
| | | } |
| | | |
| | | |
| | |
| | | userEventLog.setContent(content); |
| | | eventPublisher.publishEvent(new CalculateExamPaperAnswerCompleteEvent(examPaperAnswerInfo)); |
| | | eventPublisher.publishEvent(new UserEvent(userEventLog)); |
| | | //首页随机试卷操作 |
| | | if(examPaperSubmitVM.getTemplatesId() != null){ |
| | | ExamTemplatesUserCount examTemplatesUserCount = new ExamTemplatesUserCount(); |
| | | examTemplatesUserCount.setUserId(user.getId()); |
| | | examTemplatesUserCount.setExamPaperId(examPaperSubmitVM.getId()); |
| | | examTemplatesUserCount.setExamTemplatesId(examPaperSubmitVM.getTemplatesId()); |
| | | examTemplatesUserCountService.add(examTemplatesUserCount); |
| | | } |
| | | return RestResponse.ok(scoreVm); |
| | | } |
| | | |