| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.jxkg.domain.*; |
| | | import com.ycl.jxkg.domain.entity.*; |
| | | import com.ycl.jxkg.domain.enums.ExamPaperAnswerStatusEnum; |
| | | import com.ycl.jxkg.domain.enums.ExamPaperTypeEnum; |
| | | import com.ycl.jxkg.domain.enums.QuestionTypeEnum; |
| | |
| | | import com.ycl.jxkg.utils.DateTimeUtil; |
| | | import com.ycl.jxkg.utils.ExamUtil; |
| | | import com.ycl.jxkg.utils.JsonUtil; |
| | | import com.ycl.jxkg.vo.admin.paper.ExamPaperAnswerPageRequestVO; |
| | | import com.ycl.jxkg.vo.student.exam.ExamPaperSubmitItemVO; |
| | | import com.ycl.jxkg.vo.student.exam.ExamPaperSubmitVO; |
| | | import com.ycl.jxkg.vo.student.exampaper.ExamPaperAnswerPageVO; |
| | | import com.ycl.jxkg.domain.vo.admin.paper.ExamPaperAnswerPageRequestVO; |
| | | import com.ycl.jxkg.domain.vo.student.exam.ExamPaperSubmitItemVO; |
| | | import com.ycl.jxkg.domain.vo.student.exam.ExamPaperSubmitVO; |
| | | import com.ycl.jxkg.domain.vo.student.exampaper.ExamPaperAnswerPageVO; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ExamPaperAnswerServiceImpl extends ServiceImpl<ExamPaperAnswerMapper ,ExamPaperAnswer> implements ExamPaperAnswerService { |
| | | public class ExamPaperAnswerServiceImpl extends ServiceImpl<ExamPaperAnswerMapper , ExamPaperAnswer> implements ExamPaperAnswerService { |
| | | |
| | | private final ExamPaperAnswerMapper examPaperAnswerMapper; |
| | | private final ExamPaperMapper examPaperMapper; |
| | |
| | | ExamPaper examPaper = examPaperMapper.selectById(examPaperSubmitVO.getId()); |
| | | ExamPaperTypeEnum paperTypeEnum = ExamPaperTypeEnum.fromCode(examPaper.getPaperType()); |
| | | //任务试卷只能做一次 |
| | | if (paperTypeEnum == ExamPaperTypeEnum.Task) { |
| | | if (paperTypeEnum == ExamPaperTypeEnum.RandomOrder) { |
| | | ExamPaperAnswer examPaperAnswer = examPaperAnswerMapper.getByPidUid(examPaperSubmitVO.getId(), user.getId()); |
| | | if (null != examPaperAnswer) |
| | | return null; |
| | |
| | | |
| | | ExamPaperTypeEnum examPaperTypeEnum = ExamPaperTypeEnum.fromCode(examPaperAnswer.getPaperType()); |
| | | switch (examPaperTypeEnum) { |
| | | case Task: |
| | | case RandomOrder: |
| | | //任务试卷批改完成后,需要更新任务的状态 |
| | | ExamPaper examPaper = examPaperMapper.selectById(examPaperAnswer.getExamPaperId()); |
| | | Integer taskId = examPaper.getTaskExamId(); |