|
@@ -92,7 +92,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
|
|
|
}
|
|
|
|
|
|
// 校验题号不能重复
|
|
|
- Map<String, Long> longMap = questions.stream().collect(Collectors.groupingBy(m -> String.valueOf(m.getMainNumber()) + m.getSubNumber(), Collectors.counting()));
|
|
|
+ Map<String, Long> longMap = questions.stream().collect(Collectors.groupingBy(m -> m.getMainNumber() + SystemConstant.HYPHEN + m.getSubNumber(), Collectors.counting()));
|
|
|
long count = longMap.entrySet().stream().filter(m -> m.getValue().intValue() > 1).count();
|
|
|
if (count > 0) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("大题号-小题号有重复数据");
|
|
@@ -136,7 +136,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
|
|
|
throw ExceptionResultEnum.ERROR.exception("大题号" + markQuestion.getMainNumber() + "小题号" + markQuestion.getSubNumber() + "已分组,不能修改小题满分");
|
|
|
}
|
|
|
// 主观题改客观题
|
|
|
- if(!markQuestion.getObjective() && question.getObjective()){
|
|
|
+ if (!markQuestion.getObjective() && question.getObjective()) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("大题号" + markQuestion.getMainNumber() + "小题号" + markQuestion.getSubNumber() + "已分组,不能修改为客观题题型");
|
|
|
}
|
|
|
}
|
|
@@ -147,7 +147,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
|
|
|
throw ExceptionResultEnum.ERROR.exception("间隔分必须大于0");
|
|
|
}
|
|
|
// 客观题变主观题
|
|
|
- if(markQuestion.getObjective() && !question.getObjective()){
|
|
|
+ if (markQuestion.getObjective() && !question.getObjective()) {
|
|
|
// 清除判分策略
|
|
|
markQuestion.setObjectivePolicy(null);
|
|
|
markQuestion.setObjectivePolicyScore(null);
|
|
@@ -155,9 +155,9 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
|
|
|
markQuestion.setOptionCount(0);
|
|
|
}
|
|
|
// 客观题
|
|
|
- if(question.getObjective()){
|
|
|
+ if (question.getObjective()) {
|
|
|
markQuestion.setOptionCount(question.getOptionCount());
|
|
|
- if(!markQuestion.getQuestionType().equals(question.getQuestionType())){
|
|
|
+ if (!markQuestion.getQuestionType().equals(question.getQuestionType())) {
|
|
|
// 清除判分策略
|
|
|
markQuestion.setObjectivePolicy(null);
|
|
|
markQuestion.setObjectivePolicyScore(null);
|
|
@@ -226,12 +226,12 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
|
|
|
// 主观题结构有变动
|
|
|
List<MarkQuestion> subjectiveQuestions = questions.stream().filter(m -> m.getObjective()).collect(Collectors.toList());
|
|
|
List<MarkQuestion> subjectiveMarkQuestionList = markQuestionList.stream().filter(m -> m.getObjective()).collect(Collectors.toList());
|
|
|
- if(!CollectionUtils.isEqualCollection(subjectiveQuestions, subjectiveMarkQuestionList)){
|
|
|
+ if (!CollectionUtils.isEqualCollection(subjectiveQuestions, subjectiveMarkQuestionList)) {
|
|
|
// 未分组的题目
|
|
|
long unGroupQuestionCount = this.countByExamIdAndPaperNumberAndObjectiveAndGroupNumberIsNull(examId, paperNumber, false);
|
|
|
long groupCount = CollectionUtils.size(markGroupService.listGroupByExamIdAndPaperNumber(examId, paperNumber));
|
|
|
// 考生主观题重新统分
|
|
|
- markService.checkStudentSubjectiveScore(examId, markPaper.getCoursePaperId(),groupCount, unGroupQuestionCount);
|
|
|
+ markService.checkStudentSubjectiveScore(examId, markPaper.getCoursePaperId(), groupCount, unGroupQuestionCount);
|
|
|
}
|
|
|
|
|
|
// 更新分组状态
|
|
@@ -453,7 +453,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
|
|
|
|
|
|
@Override
|
|
|
public List<MarkQuestion> listByExamIdAndPaperNumberAndPaperIndexAndPageIndex(Long examId, String paperNumber,
|
|
|
- Integer paperIndex, Integer pageIndex,boolean isObjective) {
|
|
|
+ Integer paperIndex, Integer pageIndex, boolean isObjective) {
|
|
|
QueryWrapper<MarkQuestion> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.lambda().eq(MarkQuestion::getExamId, examId)
|
|
|
.eq(MarkQuestion::getPaperNumber, paperNumber)
|