|
|
@@ -44,7 +44,8 @@ public class ExamService {
|
|
|
private final LearnQuestionsMapper learnQuestionsMapper;
|
|
|
private final IDzSubjectService dzSubjectService;
|
|
|
private final LearnKnowledgeCourseMapper learnKnowledgeCourseMapper;
|
|
|
- private Set<PaperType> paperTypeSet = Sets.newHashSet(PaperType.Real, PaperType.Custom, PaperType.Test);
|
|
|
+ private final LearnTestStudentMapper learnTestStudentMapper;
|
|
|
+ private Set<PaperType> paperTypeSet = Sets.newHashSet(PaperType.Real, PaperType.Custom);
|
|
|
private final LearnPaperMapper paperMapper;
|
|
|
private final LearnKnowledgeTreeMapper knowledgeTreeMapper;
|
|
|
private final LearnExamineeMapper examineeMapper;
|
|
|
@@ -55,7 +56,7 @@ public class ExamService {
|
|
|
private final IAMarjorPlanService marjorPlanService;
|
|
|
private final ISysUserService sysUserService;
|
|
|
|
|
|
- public ExamService(LearnPaperMapper paperMapper, LearnKnowledgeTreeMapper knowledgeTreeMapper, LearnExamineeMapper examineeMapper, ILearnPaperService learnPaperService, PaperService paperService, IAMarjorPlanService marjorPlanService, LearnAnswerMapper learnAnswerMapper, LearnExamineeMapper learnExamineeMapper, ISysUserService sysUserService, LearnStudentMapper learnStudentMapper, ILearnPlanService learnPlanService, LearnQuestionsMapper learnQuestionsMapper, IDzSubjectService dzSubjectService, LearnWrongBookMapper wrongBookMapper, LearnWrongDetailMapper wrongDetailMapper, LearnKnowledgeCourseMapper learnKnowledgeCourseMapper) {
|
|
|
+ public ExamService(LearnPaperMapper paperMapper, LearnKnowledgeTreeMapper knowledgeTreeMapper, LearnExamineeMapper examineeMapper, ILearnPaperService learnPaperService, PaperService paperService, IAMarjorPlanService marjorPlanService, LearnAnswerMapper learnAnswerMapper, LearnExamineeMapper learnExamineeMapper, ISysUserService sysUserService, LearnStudentMapper learnStudentMapper, ILearnPlanService learnPlanService, LearnQuestionsMapper learnQuestionsMapper, IDzSubjectService dzSubjectService, LearnWrongBookMapper wrongBookMapper, LearnWrongDetailMapper wrongDetailMapper, LearnKnowledgeCourseMapper learnKnowledgeCourseMapper, LearnTestStudentMapper learnTestStudentMapper) {
|
|
|
this.paperMapper = paperMapper;
|
|
|
this.knowledgeTreeMapper = knowledgeTreeMapper;
|
|
|
this.examineeMapper = examineeMapper;
|
|
|
@@ -72,6 +73,7 @@ public class ExamService {
|
|
|
this.wrongBookMapper = wrongBookMapper;
|
|
|
this.wrongDetailMapper = wrongDetailMapper;
|
|
|
this.learnKnowledgeCourseMapper = learnKnowledgeCourseMapper;
|
|
|
+ this.learnTestStudentMapper = learnTestStudentMapper;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -103,6 +105,13 @@ public class ExamService {
|
|
|
throw new RuntimeException("请先定设置定向学习" + exist.getUserId());
|
|
|
}
|
|
|
return openExaminee(ls, subjectId, exist);
|
|
|
+ } else if(PaperType.Test.equals(paperType)) {
|
|
|
+ SysUser exist = sysUserService.selectUserById(SecurityUtils.getUserId());
|
|
|
+ LearnTestStudent ts = learnTestStudentMapper.selectLearnTestStudentById(relatedId);
|
|
|
+ if(null == ts || !ts.getStudentId().equals(exist.getUserId())) {
|
|
|
+ throw new RuntimeException("无效批次卷" + relatedId);
|
|
|
+ }
|
|
|
+ return openExamineeForTest(ts, exist);
|
|
|
}
|
|
|
throw new RuntimeException("错误类型: " + paperType);
|
|
|
}
|
|
|
@@ -255,7 +264,14 @@ public class ExamService {
|
|
|
calculateWrongAnswers(exitExaminee, questionMap, answersList, PaperType.Course.name());
|
|
|
} else if(PaperType.Simulated.getVal().equals(exitExaminee.getPaperType())) {
|
|
|
calculateWrongAnswers(exitExaminee, questionMap, answersList, PaperType.Simulated.name());
|
|
|
+ } else if(PaperType.Test.getVal().equals(exitExaminee.getPaperType())) {
|
|
|
+ calculateWrongAnswers(exitExaminee, questionMap, answersList, PaperType.Test.name());
|
|
|
+ LearnTestStudent uts = new LearnTestStudent();
|
|
|
+ uts.setExamineeId(answerSheet.getExamineeId());
|
|
|
+ uts.setStatus(answerSheet.getState());
|
|
|
+ learnTestStudentMapper.updateExamineeStatus(uts);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -363,6 +379,20 @@ public class ExamService {
|
|
|
}
|
|
|
return buildAnswerSheet(paper, learnExaminee);
|
|
|
}
|
|
|
+ @Transactional
|
|
|
+ public AnswerSheet openExamineeForTest(LearnTestStudent ts, SysUser sysUser) {
|
|
|
+ if(null != ts.getExamineeId()) {
|
|
|
+ return loadExaminee(ts.getExamineeId(), true);
|
|
|
+ }
|
|
|
+ AnswerSheet answerSheet = openExaminee(PaperType.Test, ts.getPaperId(), ts.getStudentId());
|
|
|
+
|
|
|
+ LearnTestStudent uts = new LearnTestStudent();
|
|
|
+ uts.setId(ts.getId());
|
|
|
+ uts.setExamineeId(answerSheet.getExamineeId());
|
|
|
+ uts.setStatus(answerSheet.getState());
|
|
|
+ learnTestStudentMapper.updateLearnTestStudent(uts);
|
|
|
+ return answerSheet;
|
|
|
+ }
|
|
|
|
|
|
private AnswerSheet openExaminee(LearnStudent ls, Long subjectId, SysUser sysUser) {
|
|
|
if(StringUtils.isNotBlank(ls.getModules()) && ls.getModules().equals("技能展示/实践操作")) {
|