|
|
@@ -229,7 +229,7 @@ public class ExamService {
|
|
|
upExaminee.setScoreRate(score * 100 / totalScore);
|
|
|
upExaminee.setWrongCount(wrongCount);
|
|
|
learnExamineeMapper.updateLearnExaminee(upExaminee);
|
|
|
- if(PaperType.Simulated.getVal().equals(exitExaminee.getPaperType())) {
|
|
|
+ if(PaperType.Simulated.getVal().equals(exitExaminee.getPaperType()) || PaperType.Test.getVal().equals(exitExaminee.getPaperType())) {
|
|
|
List<JSONObject> paperStatList = learnExamineeMapper.selectExamRankingStats(upExaminee.getScore(), Lists.newArrayList(exitExaminee.getPaperId()));
|
|
|
JSONObject o = paperStatList.get(0);
|
|
|
Integer totalCount = o.getInteger("totalCount");
|
|
|
@@ -361,6 +361,31 @@ public class ExamService {
|
|
|
return answer;
|
|
|
}
|
|
|
|
|
|
+ private AnswerSheet openExamineeForTest(PaperType paperType, Long paperId, LearnTestStudent ts) {
|
|
|
+ LearnPaper paper = paperMapper.selectLearnPaperById(paperId);
|
|
|
+
|
|
|
+ LearnExaminee learnExaminee = new LearnExaminee();
|
|
|
+ learnExaminee.setStudentId(ts.getStudentId());
|
|
|
+ learnExaminee.setPaperId(paperId);
|
|
|
+ learnExaminee.setPaperType(paperType.getVal());
|
|
|
+ learnExaminee.setState(ExamineeStatus.Exam.getVal());
|
|
|
+ List<LearnExaminee> examineeList = examineeMapper.selectLearnExamineeList(learnExaminee);
|
|
|
+ if (CollectionUtils.isNotEmpty(examineeList)) {
|
|
|
+ learnExaminee = examineeList.get(0);
|
|
|
+ } else {
|
|
|
+ if(StringUtils.isNotBlank(ts.getDirectKey())) { // 全量,只分科目
|
|
|
+ LearnStudent ls = learnStudentMapper.selectLearnStudentByStudentId(ts.getStudentId());
|
|
|
+ AMarjorPlan plan = marjorPlanService.selectAMarjorPlanById(ls.getMajorPlanId());
|
|
|
+ learnExaminee.setPaperInfo(buildPaperInfo(ls, plan));
|
|
|
+ }
|
|
|
+ learnExaminee.setState(ExamineeStatus.Exam.getVal());
|
|
|
+ learnExaminee.setBeginTime(new Date());
|
|
|
+ learnExaminee.setDuration(0L);
|
|
|
+ examineeMapper.insertLearnExaminee(learnExaminee);
|
|
|
+ }
|
|
|
+ return buildAnswerSheet(paper, learnExaminee);
|
|
|
+ }
|
|
|
+
|
|
|
private AnswerSheet openExaminee(PaperType paperType, Long paperId, Long studentId) {
|
|
|
LearnPaper paper = paperMapper.selectLearnPaperById(paperId);
|
|
|
|
|
|
@@ -385,7 +410,7 @@ public class ExamService {
|
|
|
if(null != ts.getExamineeId()) {
|
|
|
return loadExaminee(ts.getExamineeId(), true);
|
|
|
}
|
|
|
- AnswerSheet answerSheet = openExaminee(PaperType.Test, ts.getPaperId(), ts.getStudentId());
|
|
|
+ AnswerSheet answerSheet = openExamineeForTest(PaperType.Test, ts.getPaperId(), ts);
|
|
|
|
|
|
LearnTestStudent uts = new LearnTestStudent();
|
|
|
uts.setId(ts.getId());
|
|
|
@@ -412,17 +437,7 @@ public class ExamService {
|
|
|
for(LearnExaminee e : examineeList) {
|
|
|
if(ExamineeStatus.Sign.getVal().equals(e.getState())) {
|
|
|
LearnPaper learnPaper = paperMapper.selectLearnPaperById(e.getPaperId());
|
|
|
- AnswerSheet answerSheet = buildAnswerSheet(learnPaper, e);
|
|
|
- if(null != e.getPaperInfo()) {
|
|
|
- JSONObject info = JSONObject.parseObject(e.getPaperInfo());
|
|
|
- answerSheet.setCollegeId(info.getLong("universityId"));
|
|
|
- answerSheet.setCollegeName(info.getString("universityName"));
|
|
|
- answerSheet.setMajorId(info.getLong("planId"));
|
|
|
- answerSheet.setMajorName(info.getString("majorName"));
|
|
|
- answerSheet.setSubjectId(learnPaper.getSubjectId());
|
|
|
- answerSheet.setSubjectName(dzSubjectService.selectDzSubjectBySubjectId(learnPaper.getSubjectId()).getSubjectName());
|
|
|
- }
|
|
|
- return answerSheet;
|
|
|
+ return buildAnswerSheet(learnPaper, e);
|
|
|
}
|
|
|
existPaperIdSet.add(e.getPaperId());
|
|
|
}
|
|
|
@@ -443,12 +458,7 @@ public class ExamService {
|
|
|
upUser.setEvalCounts(evalCountObj.toJSONString());
|
|
|
sysUserService.updateUserProfile(upUser);
|
|
|
|
|
|
- JSONObject info = new JSONObject();
|
|
|
- info.put("universityId", ls.getUniversityId());
|
|
|
- info.put("universityName", plan.getUniversityName());
|
|
|
- info.put("planId", ls.getMajorPlanId());
|
|
|
- info.put("majorName", plan.getMajorName());
|
|
|
- examinee.setPaperInfo(info.toJSONString());
|
|
|
+ examinee.setPaperInfo(buildPaperInfo(ls, plan));
|
|
|
examineeMapper.insertLearnExaminee(examinee);
|
|
|
AnswerSheet answerSheet = buildAnswerSheet(paper, examinee);
|
|
|
|
|
|
@@ -462,6 +472,14 @@ public class ExamService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private String buildPaperInfo(LearnStudent ls, AMarjorPlan plan) {
|
|
|
+ JSONObject info = new JSONObject();
|
|
|
+ info.put("universityId", ls.getUniversityId());
|
|
|
+ info.put("universityName", plan.getUniversityName());
|
|
|
+ info.put("planId", ls.getMajorPlanId());
|
|
|
+ info.put("majorName", plan.getMajorName());
|
|
|
+ return info.toJSONString();
|
|
|
+ }
|
|
|
|
|
|
private AnswerSheet openExamineeForCourse(Long knowledgeId, Long studentId, Boolean directed) {
|
|
|
LearnKnowledgeCourse kc = learnKnowledgeCourseMapper.selectLearnKnowledgeCourseById(knowledgeId);
|
|
|
@@ -650,6 +668,16 @@ public class ExamService {
|
|
|
answerSheet.setState(examinee.getState());
|
|
|
answerSheet.setAllowAnswer(true);
|
|
|
answerSheet.setAllowScore(false);
|
|
|
+
|
|
|
+ if(null != examinee.getPaperInfo()) {
|
|
|
+ JSONObject info = JSONObject.parseObject(examinee.getPaperInfo());
|
|
|
+ answerSheet.setCollegeId(info.getLong("universityId"));
|
|
|
+ answerSheet.setCollegeName(info.getString("universityName"));
|
|
|
+ answerSheet.setMajorId(info.getLong("planId"));
|
|
|
+ answerSheet.setMajorName(info.getString("majorName"));
|
|
|
+ answerSheet.setSubjectId(paper.getSubjectId());
|
|
|
+ answerSheet.setSubjectName(dzSubjectService.selectDzSubjectBySubjectId(paper.getSubjectId()).getSubjectName());
|
|
|
+ }
|
|
|
return answerSheet;
|
|
|
}
|
|
|
}
|