Przeglądaj źródła

3.4.6 20250612 bug修复,填空题评卷区合并问题

xiaofei 1 tydzień temu
rodzic
commit
d06731068b

+ 74 - 0
distributed-print/src/test/java/com/qmth/distributed/print/UpdateObjectiveOmrResultTest.java

@@ -0,0 +1,74 @@
+package com.qmth.distributed.print;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.qmth.boot.core.ai.model.llm.score.AutoScoreModel;
+import com.qmth.boot.core.ai.model.llm.score.AutoScoreRequest;
+import com.qmth.boot.core.ai.model.llm.score.AutoScoreResult;
+import com.qmth.boot.core.ai.model.llm.score.StandardAnswer;
+import com.qmth.boot.core.ai.service.AiService;
+import com.qmth.teachcloud.common.config.DictionaryConfig;
+import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.MarkQuestion;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
+import com.qmth.teachcloud.mark.dto.mark.score.StudentPaperDetailDto;
+import com.qmth.teachcloud.mark.entity.*;
+import com.qmth.teachcloud.mark.enums.AiQuestionParamModeStatus;
+import com.qmth.teachcloud.mark.service.*;
+import com.qmth.teachcloud.mark.utils.AiUtil;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 更新题卡扫描原始结果中的大题号、小题号
+ * 原因:轨迹图中客观题答案未还原,因为扫描卡格式和试卷结构设置题号不一致
+ */
+@SpringBootTest
+@RunWith(SpringRunner.class)
+public class UpdateObjectiveOmrResultTest {
+
+    @Resource
+    private MarkStudentService markStudentService;
+    @Resource
+    private ScanPaperService scanPaperService;
+
+    private Long examId = 1l;
+
+    @Test
+    public void test() throws Exception {
+        String[] paperNumbers = {"", ""};
+        for (String paperNumber : paperNumbers) {
+            List<MarkStudent> markStudentList = listMarkStudentByPaperNumber(paperNumber);
+            if (CollectionUtils.isEmpty(markStudentList)) {
+                continue;
+            }
+
+            for (MarkStudent markStudent : markStudentList) {
+                List<StudentPaperDetailDto> studentPaperDetailDtoList = scanPaperService.listStudentPaperDetail(markStudent.getId());
+                for (StudentPaperDetailDto studentPaperDetailDto : studentPaperDetailDtoList) {
+                    if (studentPaperDetailDto.getPageIndex() ==1){
+                        String recogData = studentPaperDetailDto.getRecogData();
+
+                    }
+                }
+            }
+        }
+    }
+
+    private List<MarkStudent> listMarkStudentByPaperNumber(String paperNumber) {
+        QueryWrapper<MarkStudent> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(MarkStudent::getExamId, examId)
+                .eq(MarkStudent::getPaperNumber, paperNumber);
+        return markStudentService.list(queryWrapper);
+    }
+
+}

+ 4 - 4
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/TaskServiceImpl.java

@@ -6,7 +6,6 @@ import com.qmth.teachcloud.common.bean.marking.MarkConfigItem;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.common.entity.SysUser;
-import com.qmth.teachcloud.common.enums.mark.MarkMode;
 import com.qmth.teachcloud.common.enums.mark.MarkProblemStatus;
 import com.qmth.teachcloud.common.service.SysUserService;
 import com.qmth.teachcloud.common.service.TeachcloudCommonService;
@@ -222,7 +221,7 @@ public class TaskServiceImpl implements TaskService {
         task.setStudentCode(student.getStudentCode());
         task.setPaperType(student.getPaperType());
         task.setSheetUrls(teachcloudCommonService.fileMarkPreview(student.getSheetPathList()));
-        task.setSliceConfig(buildPic(markTaskList));
+        task.setSliceConfig(buildPic(student.getExamId(), student.getPaperNumber(), markTaskList));
         MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(student.getExamId(), student.getPaperNumber());
         task.setObjectiveScore(markPaper.getShowObjectScore() ? student.getObjectiveScore() : null);
         // 题目数据
@@ -241,12 +240,13 @@ public class TaskServiceImpl implements TaskService {
         return questionList.stream().filter(m -> m.getMarkerScore() != null && MarkTaskStatus.MARKED.equals(m.getStatus())).mapToDouble(m -> m.getMarkerScore()).sum();
     }
 
-    private List<MarkConfigItem> buildPic(List<MarkTask> markTaskList) {
+    private List<MarkConfigItem> buildPic(Long examId, String paperNumber, List<MarkTask> markTaskList) {
+        MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
         List<MarkConfigItem> markConfigItems = new ArrayList<>();
         Integer mainNumber = null;
         for (MarkTask t : markTaskList) {
             MarkQuestion markQuestion = markQuestionService.getById(t.getQuestionId());
-            if (markQuestion.getQuestionType() == 4) {
+            if (markQuestion.getQuestionType() == 4 && markPaper.getMergeMarker()) {
                 // 填空题,只显示一次
                 if (mainNumber == null || !markQuestion.getMainNumber().equals(mainNumber)) {
                     markConfigItems.addAll(markQuestion.getPictureConfigList());