| | |
| | | package com.mindskip.xzs.controller.student; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.mindskip.xzs.base.BaseApiController; |
| | | import com.mindskip.xzs.base.RestResponse; |
| | | import com.mindskip.xzs.domain.*; |
| | |
| | | import com.mindskip.xzs.utility.DateTimeUtil; |
| | | import com.mindskip.xzs.utility.ExamUtil; |
| | | import com.mindskip.xzs.utility.PageInfoHelper; |
| | | import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; |
| | | import com.mindskip.xzs.viewmodel.student.exam.ExamPaperReadVM; |
| | | import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVO; |
| | | import com.mindskip.xzs.viewmodel.student.exam.ExamPaperReadVO; |
| | | import com.mindskip.xzs.viewmodel.student.exam.ExamPaperSubmitVM; |
| | | import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageResponseVM; |
| | | import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageVM; |
| | | import com.github.pagehelper.PageInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | + " 得分:" + scoreVm |
| | | + " 耗时:" + ExamUtil.secondToVM(examPaperAnswer.getDoTime()); |
| | | userEventLog.setContent(content); |
| | | examPaperAnswerInfo.setTemplateId(examPaperSubmitVM.getTemplatesId()); |
| | | eventPublisher.publishEvent(new CalculateExamPaperAnswerCompleteEvent(examPaperAnswerInfo)); |
| | | eventPublisher.publishEvent(new UserEvent(userEventLog)); |
| | | //首页随机试卷操作 |
| | |
| | | examTemplatesUserCount.setExamTemplatesId(examPaperSubmitVM.getTemplatesId()); |
| | | examTemplatesUserCountService.add(examTemplatesUserCount); |
| | | } |
| | | |
| | | return RestResponse.ok(scoreVm); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/read/{id}", method = RequestMethod.POST) |
| | | public RestResponse<ExamPaperReadVM> read(@PathVariable Integer id) { |
| | | public RestResponse<ExamPaperReadVO> read(@PathVariable Integer id) { |
| | | ExamPaperAnswer examPaperAnswer = examPaperAnswerService.selectById(id); |
| | | ExamPaperReadVM vm = new ExamPaperReadVM(); |
| | | ExamPaperEditRequestVM paper = examPaperService.examPaperToVM(examPaperAnswer.getExamPaperId()); |
| | | ExamPaperReadVO vm = new ExamPaperReadVO(); |
| | | ExamPaperEditRequestVO paper = examPaperService.examPaperToVM(examPaperAnswer.getExamPaperId()); |
| | | ExamPaperSubmitVM answer = examPaperAnswerService.examPaperAnswerToVM(examPaperAnswer.getId()); |
| | | vm.setPaper(paper); |
| | | vm.setAnswer(answer); |