|
@@ -304,7 +304,8 @@ public class MarkGroupController extends BaseExamController {
|
|
|
model.addAttribute("group", group);
|
|
|
model.addAttribute("subject", subject);
|
|
|
model.addAttribute("markModeList", MarkMode.values());
|
|
|
- model.addAttribute("scorePolicyList", ScorePolicy.values());
|
|
|
+
|
|
|
+ model.addAttribute("scorePolicyList", ScorePolicy.getList());
|
|
|
model.addAttribute("arbitrateTypeList", ArbitrateType.values());
|
|
|
model.addAttribute("thirdPolicyList", ThirdPolicy.values());
|
|
|
model.addAttribute("exam", examService.findById(examId));
|
|
@@ -342,7 +343,7 @@ public class MarkGroupController extends BaseExamController {
|
|
|
group.getExamId(), group.getSubjectCode(), false, group.getNumber()));
|
|
|
model.addAttribute("pictureConfig", pictureConfig);
|
|
|
model.addAttribute("markModeList", MarkMode.values());
|
|
|
- model.addAttribute("scorePolicyList", ScorePolicy.values());
|
|
|
+ model.addAttribute("scorePolicyList", ScorePolicy.getList());
|
|
|
model.addAttribute("thirdPolicyList", ThirdPolicy.values());
|
|
|
model.addAttribute("exam", examService.findById(examId));
|
|
|
return "modules/exam/groupEditSimple";
|
|
@@ -386,7 +387,7 @@ public class MarkGroupController extends BaseExamController {
|
|
|
model.addAttribute("questionList", questions);
|
|
|
model.addAttribute("pictureConfig", group.getPicList());
|
|
|
model.addAttribute("markModeList", MarkMode.values());
|
|
|
- model.addAttribute("scorePolicyList", ScorePolicy.values());
|
|
|
+ model.addAttribute("scorePolicyList", ScorePolicy.getList());
|
|
|
model.addAttribute("arbitrateTypeList", ArbitrateType.values());
|
|
|
model.addAttribute("thirdPolicyList", ThirdPolicy.values());
|
|
|
model.addAttribute("subject", subjectService.find(examId, subjectCode));
|
|
@@ -483,12 +484,12 @@ public class MarkGroupController extends BaseExamController {
|
|
|
redirectAttributes.addAttribute("number", number);
|
|
|
return "redirect:/admin/exam/group/edit-simple";
|
|
|
}
|
|
|
- if (!checkSelective(examId, subjectCode, questionIds)) {
|
|
|
- addMessage(redirectAttributes, "选做题不合法!选做题和非选做题不能在一组,选做题不能跨组或跨区设置");
|
|
|
- redirectAttributes.addAttribute("subjectCode", subjectCode);
|
|
|
- redirectAttributes.addAttribute("number", number);
|
|
|
- return "redirect:/admin/exam/group/edit-simple";
|
|
|
- }
|
|
|
+// if (!checkSelective(examId, subjectCode, questionIds)) {
|
|
|
+// addMessage(redirectAttributes, "选做题不合法!选做题和非选做题不能在一组,选做题不能跨组或跨区设置");
|
|
|
+// redirectAttributes.addAttribute("subjectCode", subjectCode);
|
|
|
+// redirectAttributes.addAttribute("number", number);
|
|
|
+// return "redirect:/admin/exam/group/edit-simple";
|
|
|
+// }
|
|
|
List<ExamQuestion> questionList = new ArrayList<ExamQuestion>();
|
|
|
ArbitrateType at = arbitrateType != null ? ArbitrateType.findByValue(arbitrateType)
|
|
|
: ArbitrateType.GROUP;
|
|
@@ -580,43 +581,43 @@ public class MarkGroupController extends BaseExamController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private boolean checkSelective(Integer examId, String subjectCode, Integer[] questionIds) {
|
|
|
- // 无选做题分组
|
|
|
- List<SelectiveGroup> list = selectiveGroupService.findByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
- if (list.size() == 0) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- List<ExamQuestion> selectives = new ArrayList<ExamQuestion>();
|
|
|
- Set<Integer> selectiveIndexs = new HashSet<Integer>();
|
|
|
- Set<Integer> selectiveParts = new HashSet<Integer>();
|
|
|
- for (Integer questionId : questionIds) {
|
|
|
- ExamQuestion question = questionService.findById(questionId);
|
|
|
- for (SelectiveGroup selectiveGroup : list) {
|
|
|
- if (selectiveGroup.getMainNumber().equals(question.getMainNumber())) {
|
|
|
- selectives.add(question);
|
|
|
- selectiveIndexs.add(selectiveGroup.getSelectiveIndex());
|
|
|
- selectiveParts.add(selectiveGroup.getSelectivePart());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 无选做题
|
|
|
- if (selectives.size() == 0) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- // 选做题和非选做题一组
|
|
|
- if (selectives.size() != questionIds.length) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- // 一个评卷分组内只能有一个选做题分组的题
|
|
|
- if (selectiveIndexs.size() > 1) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- // 一个评卷分组内只能有一个选做题分区的题
|
|
|
- if (selectiveParts.size() > 1) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
+// private boolean checkSelective(Integer examId, String subjectCode, Integer[] questionIds) {
|
|
|
+// // 无选做题分组
|
|
|
+// List<SelectiveGroup> list = selectiveGroupService.findByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
+// if (list.size() == 0) {
|
|
|
+// return true;
|
|
|
+// }
|
|
|
+// List<ExamQuestion> selectives = new ArrayList<ExamQuestion>();
|
|
|
+// Set<Integer> selectiveIndexs = new HashSet<Integer>();
|
|
|
+// Set<Integer> selectiveParts = new HashSet<Integer>();
|
|
|
+// for (Integer questionId : questionIds) {
|
|
|
+// ExamQuestion question = questionService.findById(questionId);
|
|
|
+// for (SelectiveGroup selectiveGroup : list) {
|
|
|
+// if (selectiveGroup.getMainNumber().equals(question.getMainNumber())) {
|
|
|
+// selectives.add(question);
|
|
|
+// selectiveIndexs.add(selectiveGroup.getSelectiveIndex());
|
|
|
+// selectiveParts.add(selectiveGroup.getSelectivePart());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// // 无选做题
|
|
|
+// if (selectives.size() == 0) {
|
|
|
+// return true;
|
|
|
+// }
|
|
|
+// // 选做题和非选做题一组
|
|
|
+// if (selectives.size() != questionIds.length) {
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+// // 一个评卷分组内只能有一个选做题分组的题
|
|
|
+// if (selectiveIndexs.size() > 1) {
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+// // 一个评卷分组内只能有一个选做题分区的题
|
|
|
+// if (selectiveParts.size() > 1) {
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+// return true;
|
|
|
+// }
|
|
|
|
|
|
@Logging(menu = "新增大题", type = LogType.ADD)
|
|
|
@RequestMapping("/insert")
|
|
@@ -643,10 +644,10 @@ public class MarkGroupController extends BaseExamController {
|
|
|
addMessage(redirectAttributes, "题目不能为空");
|
|
|
redirectAttributes.addAttribute("subjectCode", subjectCode);
|
|
|
return "redirect:/admin/exam/group/add";
|
|
|
- } else if (!checkSelective(examId, subjectCode, questionIds)) {
|
|
|
- addMessage(redirectAttributes, "选做题不合法!选做题和非选做题不能在一组,选做题不能跨组或跨区设置");
|
|
|
- redirectAttributes.addAttribute("subjectCode", subjectCode);
|
|
|
- return "redirect:/admin/exam/group/add";
|
|
|
+// } else if (!checkSelective(examId, subjectCode, questionIds)) {
|
|
|
+// addMessage(redirectAttributes, "选做题不合法!选做题和非选做题不能在一组,选做题不能跨组或跨区设置");
|
|
|
+// redirectAttributes.addAttribute("subjectCode", subjectCode);
|
|
|
+// return "redirect:/admin/exam/group/add";
|
|
|
} else {
|
|
|
try {
|
|
|
// create group
|