|
@@ -12,10 +12,12 @@ import cn.com.qmth.stmms.biz.exam.model.CheckStudent;
|
|
import cn.com.qmth.stmms.biz.exam.model.Exam;
|
|
import cn.com.qmth.stmms.biz.exam.model.Exam;
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamQuestion;
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamQuestion;
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
|
|
import cn.com.qmth.stmms.biz.exam.service.CheckStudentService;
|
|
import cn.com.qmth.stmms.biz.exam.service.CheckStudentService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
|
|
import cn.com.qmth.stmms.biz.lock.LockService;
|
|
import cn.com.qmth.stmms.biz.lock.LockService;
|
|
import cn.com.qmth.stmms.biz.mark.service.MarkService;
|
|
import cn.com.qmth.stmms.biz.mark.service.MarkService;
|
|
import cn.com.qmth.stmms.biz.report.service.ReportService;
|
|
import cn.com.qmth.stmms.biz.report.service.ReportService;
|
|
@@ -43,15 +45,19 @@ public class ScoreCalculateThread implements Runnable {
|
|
private Map<String, List<ExamQuestion>> objectiveMap;
|
|
private Map<String, List<ExamQuestion>> objectiveMap;
|
|
|
|
|
|
private Map<String, List<ExamQuestion>> subjectiveMap;
|
|
private Map<String, List<ExamQuestion>> subjectiveMap;
|
|
|
|
+
|
|
|
|
+ private Map<String, ExamSubject> subjectMap;
|
|
|
|
|
|
private CheckStudentService checkStudentService;
|
|
private CheckStudentService checkStudentService;
|
|
|
|
|
|
|
|
+ private ExamSubjectService subjectService;
|
|
|
|
+
|
|
private ExamService examService;
|
|
private ExamService examService;
|
|
|
|
|
|
public ScoreCalculateThread(int examId, LockService lockService, ExamStudentService studentService,
|
|
public ScoreCalculateThread(int examId, LockService lockService, ExamStudentService studentService,
|
|
ExamQuestionService questionService,
|
|
ExamQuestionService questionService,
|
|
MarkService markService, CheckStudentService checkStudentService,
|
|
MarkService markService, CheckStudentService checkStudentService,
|
|
- ReportService reportService,ExamService examService) {
|
|
|
|
|
|
+ ReportService reportService,ExamService examService,ExamSubjectService subjectService) {
|
|
this.examId = examId;
|
|
this.examId = examId;
|
|
this.lockService = lockService;
|
|
this.lockService = lockService;
|
|
this.studentService = studentService;
|
|
this.studentService = studentService;
|
|
@@ -60,8 +66,10 @@ public class ScoreCalculateThread implements Runnable {
|
|
this.checkStudentService = checkStudentService;
|
|
this.checkStudentService = checkStudentService;
|
|
this.reportService = reportService;
|
|
this.reportService = reportService;
|
|
this.examService = examService;
|
|
this.examService = examService;
|
|
|
|
+ this.subjectService = subjectService;
|
|
this.objectiveMap = new HashMap<String, List<ExamQuestion>>();
|
|
this.objectiveMap = new HashMap<String, List<ExamQuestion>>();
|
|
this.subjectiveMap = new HashMap<String, List<ExamQuestion>>();
|
|
this.subjectiveMap = new HashMap<String, List<ExamQuestion>>();
|
|
|
|
+ this.subjectMap = new HashMap<String, ExamSubject>();
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -108,8 +116,7 @@ public class ScoreCalculateThread implements Runnable {
|
|
private void calculate(ExamStudent student) {
|
|
private void calculate(ExamStudent student) {
|
|
try {
|
|
try {
|
|
ScoreCalculateUtil util = ScoreCalculateUtil.instance(student);
|
|
ScoreCalculateUtil util = ScoreCalculateUtil.instance(student);
|
|
- ScoreInfo info = util.calculate(findQuestionList(student.getSubjectCode(), student.getPaperType(), true),
|
|
|
|
- null);
|
|
|
|
|
|
+ ScoreInfo info = util.calculate(findQuestionList(student.getSubjectCode(), student.getPaperType(), true),null);
|
|
|
|
|
|
student.setObjectiveScore(info.getObjectiveScore());
|
|
student.setObjectiveScore(info.getObjectiveScore());
|
|
student.setScoreList(info.getScoreList(), true);
|
|
student.setScoreList(info.getScoreList(), true);
|
|
@@ -120,7 +127,8 @@ public class ScoreCalculateThread implements Runnable {
|
|
markService.scoreCalculate(student.getExamId(), student.getSubjectCode(), student.getId());
|
|
markService.scoreCalculate(student.getExamId(), student.getSubjectCode(), student.getId());
|
|
|
|
|
|
// 客观题0分主观题有分的考生
|
|
// 客观题0分主观题有分的考生
|
|
- if (student.getObjectiveScore() == 0 && student.getSubjectiveScore() != 0) {
|
|
|
|
|
|
+ ExamSubject subject = findExamSubject(student.getSubjectCode()) ;
|
|
|
|
+ if (subject.getObjectiveScore()>0 && student.getObjectiveScore() == 0 && student.getSubjectiveScore() != 0) {
|
|
CheckStudent cs = new CheckStudent(student.getId(), examId, student.getSubjectCode(),
|
|
CheckStudent cs = new CheckStudent(student.getId(), examId, student.getSubjectCode(),
|
|
CheckType.EXCEPTION);
|
|
CheckType.EXCEPTION);
|
|
checkStudentService.save(cs);
|
|
checkStudentService.save(cs);
|
|
@@ -149,4 +157,13 @@ public class ScoreCalculateThread implements Runnable {
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private ExamSubject findExamSubject(String subjectCode){
|
|
|
|
+ ExamSubject subject = subjectMap.get(subjectCode);
|
|
|
|
+ if(subject==null){
|
|
|
|
+ subject = subjectService.find(examId, subjectCode);
|
|
|
|
+ subjectMap.put(subjectCode, subject);
|
|
|
|
+ }
|
|
|
|
+ return subject;
|
|
|
|
+ }
|
|
}
|
|
}
|