|
@@ -2,8 +2,10 @@ package cn.com.qmth.stmms.admin.exam;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -300,13 +302,15 @@ public class MarkGroupController extends BaseExamController {
|
|
|
model.addAttribute("exam", examService.findById(examId));
|
|
|
List<ExamQuestion> questions = questionService.findByExamAndSubjectAndObjective(examId, subjectCode, false);
|
|
|
List<SelectiveGroup> list = selectiveGroupService.findByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
- Set<Integer> mainNumbers = new HashSet<Integer>();
|
|
|
+ Map<Integer, SelectiveGroup> map = new HashMap<Integer, SelectiveGroup>();
|
|
|
for (SelectiveGroup selectiveGroup : list) {
|
|
|
- mainNumbers.add(selectiveGroup.getMainNumber());
|
|
|
+ map.put(selectiveGroup.getMainNumber(), selectiveGroup);
|
|
|
}
|
|
|
for (ExamQuestion examQuestion : questions) {
|
|
|
- if (mainNumbers.contains(examQuestion.getMainNumber())) {
|
|
|
+ if (map.containsKey(examQuestion.getMainNumber())) {
|
|
|
examQuestion.setSelective(true);
|
|
|
+ examQuestion.setSelectiveIndex(map.get(examQuestion.getMainNumber()).getSelectiveIndex());
|
|
|
+ examQuestion.setSelectivePart(map.get(examQuestion.getMainNumber()).getSelectivePart());
|
|
|
}
|
|
|
}
|
|
|
model.addAttribute("questionList", questions);
|
|
@@ -352,13 +356,15 @@ public class MarkGroupController extends BaseExamController {
|
|
|
group.setPicList(buildPictureConfig(group));
|
|
|
List<ExamQuestion> questions = questionService.findByExamAndSubjectAndObjective(examId, subjectCode, false);
|
|
|
List<SelectiveGroup> list = selectiveGroupService.findByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
- Set<Integer> mainNumbers = new HashSet<Integer>();
|
|
|
+ Map<Integer, SelectiveGroup> map = new HashMap<Integer, SelectiveGroup>();
|
|
|
for (SelectiveGroup selectiveGroup : list) {
|
|
|
- mainNumbers.add(selectiveGroup.getMainNumber());
|
|
|
+ map.put(selectiveGroup.getMainNumber(), selectiveGroup);
|
|
|
}
|
|
|
for (ExamQuestion examQuestion : questions) {
|
|
|
- if (mainNumbers.contains(examQuestion.getMainNumber())) {
|
|
|
+ if (map.containsKey(examQuestion.getMainNumber())) {
|
|
|
examQuestion.setSelective(true);
|
|
|
+ examQuestion.setSelectiveIndex(map.get(examQuestion.getMainNumber()).getSelectiveIndex());
|
|
|
+ examQuestion.setSelectivePart(map.get(examQuestion.getMainNumber()).getSelectivePart());
|
|
|
}
|
|
|
}
|
|
|
model.addAttribute("group", group);
|