Browse Source

update reFixScore

deason 7 months ago
parent
commit
d15c0e2b52

+ 8 - 6
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/FixExamScoreServiceImpl.java

@@ -180,11 +180,13 @@ public class FixExamScoreServiceImpl implements FixExamScoreService {
             }
 
             if (StringUtils.isNotBlank(questionIds) && questionIds.contains(curQuestion.getQuestionId())) {
-                // 无论考生作答什么,直接给分的试题ID集合,多个英文逗号分隔
-                objectiveScore += curQuestion.getQuestionScore();
-                totalRightObjective++;
-                log.warn("【重算成绩】questionId:{} 直接给分:{}", curQuestion.getQuestionId(),
-                        curQuestion.getQuestionScore());
+                if (StringUtils.isNotEmpty(curQuestion.getStudentAnswer())) {
+                    // 无论考生作答什么(不作答除外),直接给分的试题ID集合,多个英文逗号分隔
+                    objectiveScore += curQuestion.getQuestionScore();
+                    totalRightObjective++;
+                    log.warn("【重算成绩】examRecordDataId:{} questionId:{} 直接给分:{}", examRecordDataId,
+                            curQuestion.getQuestionId(), curQuestion.getQuestionScore());
+                }
             } else {
                 // 匹配正确答案和考生作答,计算得分
                 String correctAnswer = curQuestion.getCorrectAnswer();
@@ -225,7 +227,7 @@ public class FixExamScoreServiceImpl implements FixExamScoreService {
     }
 
     private void changeQuestionScore(ReFixScoreReq req, ExamRecordDataEntity examRecordData,
-            List<ExamQuestionEntity> examQuestions) {
+                                     List<ExamQuestionEntity> examQuestions) {
         // 获取考生考试时实际试卷结构
         Optional<ExamRecordPaperStructEntity> examRecordPaperStructOptional = examRecordPaperStructRepo.findById(
                 examRecordData.getPaperStructId());