|
@@ -14,6 +14,7 @@ import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
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.service.ExamQuestionService;
|
|
import cn.com.qmth.stmms.biz.report.model.ReportSubject;
|
|
import cn.com.qmth.stmms.biz.report.model.ReportSubject;
|
|
import cn.com.qmth.stmms.biz.report.model.ReportSubjectGroup;
|
|
import cn.com.qmth.stmms.biz.report.model.ReportSubjectGroup;
|
|
import cn.com.qmth.stmms.biz.report.service.ReportSubjectGroupService;
|
|
import cn.com.qmth.stmms.biz.report.service.ReportSubjectGroupService;
|
|
@@ -57,6 +58,9 @@ public class SubjectQuestionLevelModule implements Module {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void process(ExamStudent student) {
|
|
public void process(ExamStudent student) {
|
|
|
|
+ if (!student.isUpload() || student.isAbsent()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
String key = student.getSubjectCode() + "\t" + StringUtils.trimToEmpty(student.getPaperType());
|
|
String key = student.getSubjectCode() + "\t" + StringUtils.trimToEmpty(student.getPaperType());
|
|
List<ExamQuestion> olist = objectiveQuestions.get(key);
|
|
List<ExamQuestion> olist = objectiveQuestions.get(key);
|
|
if (olist == null) {
|
|
if (olist == null) {
|
|
@@ -77,6 +81,7 @@ public class SubjectQuestionLevelModule implements Module {
|
|
beforeSave();
|
|
beforeSave();
|
|
ReportSubjectService subjectService = SpringContextHolder.getBean(ReportSubjectService.class);
|
|
ReportSubjectService subjectService = SpringContextHolder.getBean(ReportSubjectService.class);
|
|
ReportSubjectGroupService groupService = SpringContextHolder.getBean(ReportSubjectGroupService.class);
|
|
ReportSubjectGroupService groupService = SpringContextHolder.getBean(ReportSubjectGroupService.class);
|
|
|
|
+ ExamQuestionService questionService = SpringContextHolder.getBean(ExamQuestionService.class);
|
|
for (String key : this.difficulityLevels.keySet()) {
|
|
for (String key : this.difficulityLevels.keySet()) {
|
|
String s[] = key.split("\t");
|
|
String s[] = key.split("\t");
|
|
String subjectCode = s[0];
|
|
String subjectCode = s[0];
|
|
@@ -128,12 +133,19 @@ public class SubjectQuestionLevelModule implements Module {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (s.length == 1 || s.length == 2) {
|
|
if (s.length == 1 || s.length == 2) {
|
|
|
|
+ if (s.length == 2) {
|
|
|
|
+ String paperType = StringUtils.trimToNull(s[1]);
|
|
|
|
+ List<String> paperTypes = questionService.getPaperTypeWitnNull(context.getExamId(), subjectCode);
|
|
|
|
+ if(!contains(paperTypes,paperType)){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
ReportSubject r = subjectService.findOne(context.getExamId(), subjectCode);
|
|
ReportSubject r = subjectService.findOne(context.getExamId(), subjectCode);
|
|
r.setDifficulityLevel(difficulityLevel.toString());
|
|
r.setDifficulityLevel(difficulityLevel.toString());
|
|
r.setDiscriminationLevel(discriminationLevel.toString());
|
|
r.setDiscriminationLevel(discriminationLevel.toString());
|
|
subjectService.save(r);
|
|
subjectService.save(r);
|
|
}
|
|
}
|
|
- if (s.length >= 4 ) {
|
|
|
|
|
|
+ if (s.length >= 4) {
|
|
Boolean objective = Boolean.parseBoolean(s[1]);
|
|
Boolean objective = Boolean.parseBoolean(s[1]);
|
|
String paperType = StringUtils.trimToNull(s[2]);
|
|
String paperType = StringUtils.trimToNull(s[2]);
|
|
Integer mainNumber = Integer.parseInt(s[3]);
|
|
Integer mainNumber = Integer.parseInt(s[3]);
|
|
@@ -146,6 +158,24 @@ public class SubjectQuestionLevelModule implements Module {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private boolean contains(List<String> paperTypes, String paperType) {
|
|
|
|
+ if (paperType == null) {
|
|
|
|
+ if (paperTypes.contains(paperType)) {
|
|
|
|
+ // null卷型
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ paperTypes.remove(null);
|
|
|
|
+ for (String s : paperTypes) {
|
|
|
|
+ if (paperType.equalsIgnoreCase(s)) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
protected void beforeSave() {
|
|
protected void beforeSave() {
|
|
// paperType集合
|
|
// paperType集合
|
|
Map<String, Set<String>> paperTypes = new HashMap<String, Set<String>>();
|
|
Map<String, Set<String>> paperTypes = new HashMap<String, Set<String>>();
|