|
@@ -127,19 +127,24 @@ public class FixExamScoreServiceImpl implements FixExamScoreService {
|
|
|
examRecordData.getId(), examRecordData.getPaperStructId(), examRecordData.getBasePaperId(),
|
|
|
examRecordData.getPaperScore());
|
|
|
|
|
|
+ boolean needUpdate = false;
|
|
|
// 需要更新试题分值,则优先执行
|
|
|
if (req.getUpdateObjectiveScore() || req.getUpdateSubjectiveScore()) {
|
|
|
this.changeQuestionScore(req, examRecordData, examQuestions);
|
|
|
+ needUpdate = true;
|
|
|
}
|
|
|
|
|
|
// 更新试题正确答案
|
|
|
if (req.getUpdateObjectiveAnswer()) {
|
|
|
this.changeQuestionRightAnswer(examQuestions);
|
|
|
+ needUpdate = true;
|
|
|
}
|
|
|
|
|
|
- // 保存考生作答记录
|
|
|
- examRecordQuestionsRepo.save(examRecordQuestion);
|
|
|
- log.warn("【重算成绩】考生作答记录-已更新! examRecordDataId:{} ", examRecordData.getId());
|
|
|
+ if (needUpdate) {
|
|
|
+ // 保存考生作答记录
|
|
|
+ examRecordQuestionsRepo.save(examRecordQuestion);
|
|
|
+ log.warn("【重算成绩】考生作答记录-已更新! examRecordDataId:{} ", examRecordData.getId());
|
|
|
+ }
|
|
|
|
|
|
// 计算成绩
|
|
|
this.calcExamScore(examRecordData.getId(), examQuestions);
|
|
@@ -246,15 +251,25 @@ public class FixExamScoreServiceImpl implements FixExamScoreService {
|
|
|
if (CollectionUtils.isNotEmpty(baseQuestionUnits)) {
|
|
|
double questionScore = 0d;//小题总分;
|
|
|
for (int n = 0; n < question.getQuestionUnitWrapperList().size(); n++) {
|
|
|
- DefaultQuestionUnitWrapper questionUnit = question.getQuestionUnitWrapperList().get(n);
|
|
|
DefaultQuestionUnitWrapper baseQuestionUnit = baseQuestionUnits.get(n);
|
|
|
-
|
|
|
if (baseQuestionUnit.getQuestionScore() == null) {
|
|
|
baseQuestionUnit.setQuestionScore(0d);
|
|
|
}
|
|
|
|
|
|
- questionUnit.setQuestionScore(baseQuestionUnit.getQuestionScore());// 修改小题分值
|
|
|
- questionScore += baseQuestionUnit.getQuestionScore();
|
|
|
+ DefaultQuestionUnitWrapper questionUnit = question.getQuestionUnitWrapperList().get(n);
|
|
|
+ if (QuestionType.isObjective(questionUnit.getQuestionType())) {
|
|
|
+ if (req.getUpdateObjectiveScore()) {
|
|
|
+ // 只更新客观题分值
|
|
|
+ questionUnit.setQuestionScore(baseQuestionUnit.getQuestionScore());// 修改小题分值
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (req.getUpdateSubjectiveScore()) {
|
|
|
+ // 只更新主观题分值
|
|
|
+ questionUnit.setQuestionScore(baseQuestionUnit.getQuestionScore());// 修改小题分值
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ questionScore += questionUnit.getQuestionScore();
|
|
|
}
|
|
|
question.setQuestionScore(questionScore);// 修改小题分值
|
|
|
groupScore += questionScore;
|
|
@@ -284,7 +299,17 @@ public class FixExamScoreServiceImpl implements FixExamScoreService {
|
|
|
}
|
|
|
|
|
|
ExamQuestionEntity questionUnit = curQuestionUnits.get(n);
|
|
|
- questionUnit.setQuestionScore(baseQuestionUnit.getQuestionScore());// 修改小题分值
|
|
|
+ if (QuestionType.isObjective(questionUnit.getQuestionType())) {
|
|
|
+ if (req.getUpdateObjectiveScore()) {
|
|
|
+ // 只更新客观题分值
|
|
|
+ questionUnit.setQuestionScore(baseQuestionUnit.getQuestionScore());// 修改小题分值
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (req.getUpdateSubjectiveScore()) {
|
|
|
+ // 只更新主观题分值
|
|
|
+ questionUnit.setQuestionScore(baseQuestionUnit.getQuestionScore());// 修改小题分值
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|