|
@@ -1727,6 +1727,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
int examId = list.get(0).getExamId();
|
|
|
String subjectCode = list.get(0).getSubjectCode();
|
|
|
+ Boolean containObjective = false;
|
|
|
+ Boolean containSubjective = false;
|
|
|
for (ExamQuestion question : list) {
|
|
|
SelectiveGroup selectiveGroup = selectiveGroupService.findOne(question.getExamId(),
|
|
|
question.getSubjectCode(), question.getMainNumber());
|
|
@@ -1739,33 +1741,37 @@ public class MarkServiceImpl implements MarkService {
|
|
|
boolean objective = question.isObjective();
|
|
|
questionService.deleteById(question.getId());
|
|
|
if (objective) {
|
|
|
- examService.updateObjectiveStatus(examId, ObjectiveStatus.WAITING);
|
|
|
+ containObjective = true;
|
|
|
} else {
|
|
|
- // 未分组的题目
|
|
|
- long unGroupQuestionCount = questionService
|
|
|
- .countByExamIdAndSubjectAndObjectiveAndGroupNumberIsNull(examId, subjectCode, false);
|
|
|
- // 考生整体状态与总分更新
|
|
|
- long groupCount = groupDao.countByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
- if (groupCount == 0 || unGroupQuestionCount > 0) {
|
|
|
- studentService.updateSubjectiveStatusAndScoreAndInspectorId(examId, subjectCode,
|
|
|
- SubjectiveStatus.UNMARK, 0, null, null, null);
|
|
|
- // studentService.resetSubjectiveStatusAndScoreWithoutTrial(examId,
|
|
|
- // subjectCode);
|
|
|
- inspectHistoryService.deleteByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
- } else {
|
|
|
- List<Integer> studentList = studentService.findIdByExamIdAndSubjectCodeAndSubjectiveStatus(
|
|
|
- examId, subjectCode, SubjectiveStatus.UNMARK, SubjectiveStatus.MARKED);
|
|
|
- for (Integer studentId : studentList) {
|
|
|
- checkStudentSubjective(studentId, groupCount, unGroupQuestionCount);
|
|
|
- }
|
|
|
- }
|
|
|
+ containSubjective = true;
|
|
|
}
|
|
|
}
|
|
|
- subjectService.updateScore(examId, subjectCode, false,
|
|
|
- questionService.sumTotalScore(examId, subjectCode, false));
|
|
|
+ }
|
|
|
+ if (containObjective) {
|
|
|
+ examService.updateObjectiveStatus(examId, ObjectiveStatus.WAITING);
|
|
|
subjectService.updateScore(examId, subjectCode, true,
|
|
|
questionService.sumTotalScore(examId, subjectCode, true));
|
|
|
}
|
|
|
+ if (containSubjective) {
|
|
|
+ // 未分组的题目
|
|
|
+ long unGroupQuestionCount = questionService.countByExamIdAndSubjectAndObjectiveAndGroupNumberIsNull(examId,
|
|
|
+ subjectCode, false);
|
|
|
+ // 考生整体状态与总分更新
|
|
|
+ long groupCount = groupDao.countByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
+ if (groupCount == 0 || unGroupQuestionCount > 0) {
|
|
|
+ studentService.updateSubjectiveStatusAndScoreAndInspectorId(examId, subjectCode,
|
|
|
+ SubjectiveStatus.UNMARK, 0, null, null, null);
|
|
|
+ inspectHistoryService.deleteByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
+ } else {
|
|
|
+ List<Integer> studentList = studentService.findIdByExamIdAndSubjectCodeAndSubjectiveStatus(examId,
|
|
|
+ subjectCode, SubjectiveStatus.UNMARK, SubjectiveStatus.MARKED);
|
|
|
+ for (Integer studentId : studentList) {
|
|
|
+ checkStudentSubjective(studentId, groupCount, unGroupQuestionCount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ subjectService.updateScore(examId, subjectCode, false,
|
|
|
+ questionService.sumTotalScore(examId, subjectCode, false));
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|