|
@@ -192,6 +192,7 @@ public class MarkGroupController extends BaseExamController {
|
|
|
obj.accumulate("number", group.getNumber());
|
|
|
obj.accumulate("title", group.getTitle());
|
|
|
obj.accumulate("score", group.getTotalScore());
|
|
|
+ obj.accumulate("status", group.getStatus());
|
|
|
array.add(obj);
|
|
|
}
|
|
|
return array;
|
|
@@ -274,7 +275,8 @@ public class MarkGroupController extends BaseExamController {
|
|
|
allow = true;
|
|
|
} else if (markGroup.getStatus() == MarkStatus.FORMAL && status == MarkStatus.FINISH
|
|
|
&& markGroup.getLeftCount() == 0
|
|
|
- && selectiveStudentDao.countByExamIdAndSubjectCodeAndLessSelectiveOrNotSelective(markGroup.getExamId(),markGroup.getSubjectCode(),true,true)== 0) {
|
|
|
+ && selectiveStudentDao.countByExamIdAndSubjectCodeAndLessSelectiveOrNotSelective(markGroup.getExamId(),
|
|
|
+ markGroup.getSubjectCode(), true, true) == 0) {
|
|
|
allow = true;
|
|
|
} else if (markGroup.getStatus() == MarkStatus.FINISH && status == MarkStatus.FORMAL) {
|
|
|
allow = true;
|
|
@@ -302,7 +304,7 @@ public class MarkGroupController extends BaseExamController {
|
|
|
lockService.waitlock(LockType.GROUP, group.getExamId(), group.getSubjectCode(), group.getNumber());
|
|
|
if (groupService.updateStatus(group.getExamId(), group.getSubjectCode(), group.getNumber(), status,
|
|
|
group.getStatus())) {
|
|
|
- if(status == MarkStatus.FORMAL){
|
|
|
+ if (status == MarkStatus.FORMAL) {
|
|
|
// 切换到正评成功后刷新任务数量
|
|
|
group.setStatus(status);
|
|
|
markService.updateLibraryCount(group);
|
|
@@ -310,16 +312,18 @@ public class MarkGroupController extends BaseExamController {
|
|
|
markerService.logoutByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
group.getNumber());
|
|
|
} else if (status == MarkStatus.FINISH) {
|
|
|
- //结束时判断是否全部完成统分
|
|
|
- long unGroupQuestionCount = questionService.countByExamIdAndSubjectAndObjectiveAndGroupNumberIsNull(group.getExamId(), group.getSubjectCode(), false);
|
|
|
+ // 结束时判断是否全部完成统分
|
|
|
+ long unGroupQuestionCount = questionService.countByExamIdAndSubjectAndObjectiveAndGroupNumberIsNull(
|
|
|
+ group.getExamId(), group.getSubjectCode(), false);
|
|
|
// 考生整体状态与总分更新
|
|
|
- long groupCount = groupService.countByExamAndSubjectAndStatus(group.getExamId(), group.getSubjectCode(),MarkStatus.TRIAL,MarkStatus.FORMAL);
|
|
|
- if(unGroupQuestionCount>0 ||groupCount>0){
|
|
|
+ long groupCount = groupService.countByExamAndSubjectAndStatus(group.getExamId(),
|
|
|
+ group.getSubjectCode(), MarkStatus.TRIAL, MarkStatus.FORMAL);
|
|
|
+ if (unGroupQuestionCount > 0 || groupCount > 0) {
|
|
|
return;
|
|
|
}
|
|
|
groupCount = groupService.countByExamAndSubject(group.getExamId(), group.getSubjectCode());
|
|
|
- List<Integer> studentList = studentService.findIdByExamIdAndSubjectCodeAndSubjectiveStatus(group.getExamId(), group.getSubjectCode(),
|
|
|
- SubjectiveStatus.UNMARK);
|
|
|
+ List<Integer> studentList = studentService.findIdByExamIdAndSubjectCodeAndSubjectiveStatus(
|
|
|
+ group.getExamId(), group.getSubjectCode(), SubjectiveStatus.UNMARK);
|
|
|
for (Integer studentId : studentList) {
|
|
|
lockService.waitlock(LockType.STUDENT, studentId);
|
|
|
markService.checkStudentSubjective(studentId, groupCount, unGroupQuestionCount);
|
|
@@ -327,7 +331,7 @@ public class MarkGroupController extends BaseExamController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
} finally {
|
|
|
lockService.unlock(LockType.GROUP, group.getExamId(), group.getSubjectCode(), group.getNumber());
|
|
|
}
|
|
@@ -528,12 +532,14 @@ 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;
|
|
@@ -626,43 +632,45 @@ 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")
|
|
@@ -689,10 +697,11 @@ 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
|
|
@@ -834,7 +843,8 @@ public class MarkGroupController extends BaseExamController {
|
|
|
try {
|
|
|
lockService.waitlock(LockType.GROUP, group.getExamId(), group.getSubjectCode(), group.getNumber());
|
|
|
if (group.getStatus() == MarkStatus.FORMAL && group.getLeftCount() == 0
|
|
|
- && selectiveStudentDao.countByExamIdAndSubjectCodeAndLessSelectiveOrNotSelective(group.getExamId(), group.getSubjectCode(),true,true)==0) {
|
|
|
+ && selectiveStudentDao.countByExamIdAndSubjectCodeAndLessSelectiveOrNotSelective(
|
|
|
+ group.getExamId(), group.getSubjectCode(), true, true) == 0) {
|
|
|
groupService.updateStatus(examId, subjectCode, number, MarkStatus.FINISH, group.getStatus());
|
|
|
}
|
|
|
} finally {
|