xiaofei 1 yıl önce
ebeveyn
işleme
0bab2c110a

+ 2 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkArchiveController.java

@@ -60,7 +60,7 @@ public class MarkArchiveController {
 	
 	@ApiOperation(value = "成绩报告")
 	@RequestMapping(value = "score/report", method = RequestMethod.POST)
-	public ScoreReportVo scoreReport(@RequestParam Long examId,@RequestParam String paperNumber) {
-		return markStudentService.scoreReport(examId, paperNumber);
+	public Result scoreReport(@RequestParam Long examId,@RequestParam String paperNumber) {
+		return ResultUtil.ok(markStudentService.scoreReport(examId, paperNumber));
 	}
 }

+ 28 - 0
distributed-print/src/test/java/com/qmth/distributed/print/MarkCalcObjectiveScoreTest.java

@@ -0,0 +1,28 @@
+package com.qmth.distributed.print;
+
+import com.qmth.teachcloud.mark.entity.MarkStudent;
+import com.qmth.teachcloud.mark.service.MarkStudentService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * 客观题统分
+ */
+@SpringBootTest
+@RunWith(SpringRunner.class)
+public class MarkCalcObjectiveScoreTest {
+    @Autowired
+    private MarkStudentService markStudentService;
+
+
+    @Test
+    public void calcObjectiveScore() {
+        Long studentId = 457618481244798976l;
+        MarkStudent markStudent = markStudentService.getById(studentId);
+        markStudentService.calculateObjectiveScore(markStudent);
+    }
+
+}

+ 2 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkPaper.java

@@ -142,6 +142,8 @@ public class MarkPaper implements Serializable {
         this.groupStatus = false;
         this.openMarkClass = false;
         this.status = MarkPaperStatus.FORMAL;
+        this.passScore = 60D;
+        this.excellentScore = 80D;
     }
 
     public Long getId() {

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkStudent.java

@@ -146,7 +146,7 @@ public class MarkStudent implements Serializable {
     private Double subjectiveScore;
 
     @ApiModelProperty(value = "主观得分明细")
-    @TableField(value = "objective_score_list", updateStrategy = FieldStrategy.IGNORED)
+    @TableField(value = "subjective_score_list", updateStrategy = FieldStrategy.IGNORED)
     private String subjectiveScoreList;
 
     @ApiModelProperty(value = "学院")

+ 2 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/MarkGroupService.java

@@ -50,4 +50,6 @@ public interface MarkGroupService extends IService<MarkGroup> {
     void deleteByExamIdAndPaperNumberAndGroupNumber(Long examId, String paperNumber, Integer groupNumber);
 
     long countByExamIdAndPaperNumber(Long examId, String paperNumber);
+
+    void updateTotalScore(Long examId, String paperNumber, Integer groupNumber, Double totalScore);
 }

+ 10 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkGroupServiceImpl.java

@@ -438,4 +438,14 @@ public class MarkGroupServiceImpl extends MppServiceImpl<MarkGroupMapper, MarkGr
                 .eq(MarkGroup::getPaperNumber, paperNumber);
         return this.count(queryWrapper);
     }
+
+    @Override
+    public void updateTotalScore(Long examId, String paperNumber, Integer groupNumber, Double totalScore) {
+        UpdateWrapper<MarkGroup> markGroupUpdateWrapper = new UpdateWrapper<>();
+        markGroupUpdateWrapper.lambda().set(MarkGroup::getTotalScore, totalScore)
+                .eq(MarkGroup::getExamId, examId)
+                .eq(MarkGroup::getPaperNumber, paperNumber)
+                .eq(MarkGroup::getNumber, groupNumber);
+        this.update(markGroupUpdateWrapper);
+    }
 }

+ 34 - 12
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkQuestionServiceImpl.java

@@ -14,9 +14,11 @@ import com.qmth.teachcloud.common.entity.MarkQuestion;
 import com.qmth.teachcloud.mark.mapper.MarkQuestionMapper;
 import com.qmth.teachcloud.mark.params.MarkObjectiveQuestionParams;
 import com.qmth.teachcloud.mark.params.MarkQuestionParams;
+import com.qmth.teachcloud.mark.service.MarkGroupService;
 import com.qmth.teachcloud.mark.service.MarkPaperService;
 import com.qmth.teachcloud.mark.service.MarkQuestionService;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -39,10 +41,10 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
 
     @Resource
     private TeachcloudCommonService teachcloudCommonService;
-
     @Resource
     private MarkPaperService markPaperService;
-
+    @Resource
+    private MarkGroupService markGroupService;
     @Resource
     private FileStoreUtil fileStoreUtil;
 
@@ -66,6 +68,7 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
     public void saveQuestions(MarkQuestionParams markQuestionParams) {
         Long examId = markQuestionParams.getExamId();
         String paperNumber = markQuestionParams.getPaperNumber();
+
         List<MarkQuestion> questions = markQuestionParams.getQuestions();
         if (CollectionUtils.isEmpty(questions)) {
             throw ExceptionResultEnum.ERROR.exception("没有可保存的结构数据");
@@ -126,7 +129,26 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
             }
             this.saveOrUpdateBatch(saveOrUpdateList);
         }
+        // 更新客观题满分、主观题满分、总分
+        List<MarkQuestion> markQuestions = this.listQuestionByExamIdAndPaperNumber(examId, paperNumber);
+        Double objectiveScore = markQuestions.stream().filter(m -> m.getObjective()).collect(Collectors.summingDouble(m -> m.getTotalScore()));
+        Double subjectiveScore = markQuestions.stream().filter(m -> !m.getObjective()).collect(Collectors.summingDouble(m -> m.getTotalScore()));
+        Double totalScore = markQuestions.stream().collect(Collectors.summingDouble(m -> m.getTotalScore()));
+        UpdateWrapper<MarkPaper> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.lambda().set(MarkPaper::getObjectiveScore, objectiveScore)
+                .set(MarkPaper::getSubjectiveScore, subjectiveScore)
+                .set(MarkPaper::getTotalScore, totalScore)
+                .eq(MarkPaper::getExamId, examId)
+                .eq(MarkPaper::getPaperNumber, paperNumber);
+        markPaperService.update(updateWrapper);
 
+        // 修改分组题目总分
+        Map<Integer, Double> collectGroupScoreMap = markQuestions.stream().filter(m -> m.getGroupNumber() != null).collect(Collectors.groupingBy(m -> m.getGroupNumber(), Collectors.summingDouble(m -> m.getTotalScore())));
+        if(MapUtils.isNotEmpty(collectGroupScoreMap)){
+            for (Map.Entry<Integer, Double> entry : collectGroupScoreMap.entrySet()) {
+                markGroupService.updateTotalScore(examId, paperNumber, entry.getKey(), entry.getValue());
+            }
+        }
     }
 
     @Override
@@ -266,14 +288,14 @@ public class MarkQuestionServiceImpl extends ServiceImpl<MarkQuestionMapper, Mar
         return this.list(queryWrapper);
     }
 
-	@Override
-	public List<MarkQuestion> listQuestionByExamIdAndPaperNumber(Long examId, String paperNumber, Boolean isObjective) {
-		 QueryWrapper<MarkQuestion> queryWrapper = new QueryWrapper<>();
-	        queryWrapper.lambda().eq(MarkQuestion::getExamId, examId)
-	                .eq(MarkQuestion::getPaperNumber, paperNumber)
-	                .eq(MarkQuestion::getObjective, isObjective)
-	                .orderByAsc(MarkQuestion::getMainNumber)
-	                .orderByAsc(MarkQuestion::getSubNumber);
-	        return this.list(queryWrapper);
-	}
+    @Override
+    public List<MarkQuestion> listQuestionByExamIdAndPaperNumber(Long examId, String paperNumber, Boolean isObjective) {
+        QueryWrapper<MarkQuestion> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(MarkQuestion::getExamId, examId)
+                .eq(MarkQuestion::getPaperNumber, paperNumber)
+                .eq(MarkQuestion::getObjective, isObjective)
+                .orderByAsc(MarkQuestion::getMainNumber)
+                .orderByAsc(MarkQuestion::getSubNumber);
+        return this.list(queryWrapper);
+    }
 }

+ 5 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -730,7 +730,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         IPage<ArchiveStudentVo> ret = baseMapper.studentList(page, query);
         for (ArchiveStudentVo record : ret.getRecords()) {
             List<String> list = new ArrayList<String>();
-            List<FilePathVo> vos = JSON.parseArray(StringUtils.trimToNull(record.getSheetPath()),FilePathVo.class);
+            List<FilePathVo> vos = JSON.parseArray(StringUtils.trimToNull(record.getSheetPath()), FilePathVo.class);
             for (FilePathVo filePathVo : vos) {
                 list.add(JSON.toJSONString(filePathVo));
             }
@@ -760,6 +760,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                     Calculator.divide2String(Calculator.multiply(ret.getOverview().getPassCount(), 100), total, 2));
             ret.getOverview().setExcellentRate(
                     Calculator.divide2String(Calculator.multiply(ret.getOverview().getExcellentCount(), 100), total, 2));
+            ret.getOverview().setAvgScore(Calculator.round(ret.getOverview().getAvgScore(), 2));
         }
 
         fillScoreRange(ret, examId, paperNumber);
@@ -791,6 +792,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                 vo.setPassRate(Calculator.divide2String(Calculator.multiply(vo.getPassCount(), 100), total, 2));
                 vo.setExcellentRate(
                         Calculator.divide2String(Calculator.multiply(vo.getExcellentCount(), 100), total, 2));
+                vo.setAvgScore(Calculator.round(vo.getAvgScore(), 2));
             }
         }
 
@@ -801,6 +803,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                 vo.setPassRate(Calculator.divide2String(Calculator.multiply(vo.getPassCount(), 100), total, 2));
                 vo.setExcellentRate(
                         Calculator.divide2String(Calculator.multiply(vo.getExcellentCount(), 100), total, 2));
+                vo.setAvgScore(Calculator.round(vo.getAvgScore(), 2));
             }
         }
 
@@ -812,6 +815,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                 double total = vo.getStudentCount();
                 vo.setScoreRate(Calculator.divide(vo.getScoreCount(), total, 2));
                 vo.setFullScoreRate(Calculator.divide(vo.getFullScoreCount(), total, 2));
+                vo.setAvgScore(Calculator.round(vo.getAvgScore(), 2));
             }
         }
         return ret;

+ 36 - 22
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/utils/Calculator.java

@@ -1,6 +1,7 @@
 package com.qmth.teachcloud.mark.utils;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.List;
 
 import org.apache.commons.collections4.CollectionUtils;
@@ -18,7 +19,7 @@ public class Calculator {
 
     /**
      * 加法 保留两位小数
-     * 
+     *
      * @param v1
      * @param v2
      * @return
@@ -30,7 +31,7 @@ public class Calculator {
 
     /**
      * 加法 保留指定位小数
-     * 
+     *
      * @param v1
      * @param v2
      * @param len
@@ -42,22 +43,24 @@ public class Calculator {
         return b1.add(b2).setScale(len, BigDecimal.ROUND_HALF_UP).doubleValue();
 
     }
-    
-    /** 加法 保留指定位小数
+
+    /**
+     * 加法 保留指定位小数
+     *
      * @param ds
      * @param len
      * @return
      */
     public static double add(List<Double> ds, int len) {
-        if(CollectionUtils.isEmpty(ds)) {
+        if (CollectionUtils.isEmpty(ds)) {
             throw new StatusException("数组为空");
         }
         BigDecimal ret = new BigDecimal(0.0);
-        for(Double d:ds) {
-            if(d==null) {
+        for (Double d : ds) {
+            if (d == null) {
                 throw new StatusException("数组元素为空");
             }
-            ret=ret.add(new BigDecimal(d));
+            ret = ret.add(new BigDecimal(d));
         }
         return ret.setScale(len, BigDecimal.ROUND_HALF_UP).doubleValue();
 
@@ -65,7 +68,7 @@ public class Calculator {
 
     /**
      * 减法 保留两位小数
-     * 
+     *
      * @param v1
      * @param v2
      * @return
@@ -77,7 +80,7 @@ public class Calculator {
 
     /**
      * 减法 保留指定位小数
-     * 
+     *
      * @param v1
      * @param v2
      * @param len
@@ -89,7 +92,10 @@ public class Calculator {
         return b1.subtract(b2).setScale(len, BigDecimal.ROUND_HALF_UP).doubleValue();
 
     }
-    /**差值绝对值
+
+    /**
+     * 差值绝对值
+     *
      * @param v1
      * @param v2
      * @param len
@@ -98,29 +104,30 @@ public class Calculator {
     public static double absoluteDiff(double v1, double v2, int len) {
         BigDecimal b1 = new BigDecimal(v1);
         BigDecimal b2 = new BigDecimal(v2);
-        if(v1>v2) {
+        if (v1 > v2) {
             return b1.subtract(b2).setScale(len, BigDecimal.ROUND_HALF_UP).doubleValue();
-        }else {
+        } else {
             return b2.subtract(b1).setScale(len, BigDecimal.ROUND_HALF_UP).doubleValue();
         }
 
     }
+
     /**
-     * 乘法 
-     * 
+     * 乘法
+     *
      * @param v1
      * @param v2
      * @return
      */
     public static double multiply(double v1, double v2) {
-    	BigDecimal b1 = new BigDecimal(v1);
+        BigDecimal b1 = new BigDecimal(v1);
         BigDecimal b2 = new BigDecimal(v2);
         return b1.multiply(b2).doubleValue();
     }
 
     /**
      * 乘法 保留指定位小数
-     * 
+     *
      * @param v1
      * @param v2
      * @param len
@@ -132,11 +139,11 @@ public class Calculator {
         return b1.multiply(b2).setScale(len, BigDecimal.ROUND_HALF_UP).doubleValue();
 
     }
-    
-    
+
+
     /**
      * 除法 保留两位小数
-     * 
+     *
      * @param v1
      * @param v2
      * @param len
@@ -148,7 +155,7 @@ public class Calculator {
 
     /**
      * 除法 保留指定位小数
-     * 
+     *
      * @param v1
      * @param v2
      * @param len
@@ -161,11 +168,18 @@ public class Calculator {
     }
 
     public static String divide2String(Double v1, Double v2, int len) {
-        if(v1==null||v2==null||v2==0) {
+        if (v1 == null || v2 == null || v2 == 0) {
             return "-";
         }
         BigDecimal b1 = new BigDecimal(v1);
         BigDecimal b2 = new BigDecimal(v2);
         return String.valueOf(b1.divide(b2, len, BigDecimal.ROUND_HALF_UP).doubleValue());
     }
+
+    public static Double round(Double value, int length) {
+        if (value == null) {
+            return null;
+        }
+        return new BigDecimal(value).setScale(length, RoundingMode.HALF_UP).doubleValue();
+    }
 }

+ 19 - 18
teachcloud-mark/src/main/resources/mapper/MarkArbitrateHistoryMapper.xml

@@ -43,24 +43,25 @@
             <if test="status != null and status != ''">
                 AND status = #{status}
             </if>
-        <if test="className != null and className != ''">
-            AND EXISTS( SELECT
-                        1
-                    FROM
-                        mark_user_class muc
-                    WHERE
-                        mah.exam_id = muc.exam_id
-                        AND mah.paper_number = muc.paper_number
-                        AND mah.group_number = muc.group_number
-                        AND muc.class_name = #{className}
-                        AND EXISTS( SELECT
-                                1
-                            FROM
-                                mark_student ms
-                            WHERE
-                                mah.student_id = ms.id
-                                AND muc.class_name = ms.class_name))
-        </if>
+            <if test="className != null and className != ''">
+                AND EXISTS( SELECT
+                            1
+                        FROM
+                            mark_user_class muc
+                        WHERE
+                            mah.exam_id = muc.exam_id
+                            AND mah.paper_number = muc.paper_number
+                            AND mah.group_number = muc.group_number
+                            AND muc.class_name = #{className}
+                            AND EXISTS( SELECT
+                                    1
+                                FROM
+                                    mark_student ms
+                                WHERE
+                                    mah.student_id = ms.id
+                                    AND muc.class_name = ms.class_name))
+            </if>
+            ORDER BY mah.status desc, mah.create_time asc
     </select>
     <select id="getArbitrateWaitingOne" resultType="com.qmth.teachcloud.mark.entity.MarkArbitrateHistory">
         SELECT

+ 1 - 1
teachcloud-mark/src/main/resources/mapper/MarkProblemHistoryMapper.xml

@@ -52,7 +52,7 @@
             <if test="secretNumber != null and secretNumber != ''">
                 AND secret_number = #{secretNumber}
             </if>
-        ORDER BY
+        ORDER BY status desc, create_time asc
     </select>
 
 </mapper>

+ 30 - 15
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -265,9 +265,12 @@
         avg(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) avgScore,
         max(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) maxScore,
         min(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) minScore,
-        sum(case when s.objective_score+s.subjective_score >=t.pass_score then 1 else 0 end) passCount,
-        sum(case when s.objective_score+s.subjective_score >=t.excellent_score then 1 else 0 end) excellentCount
-        FROM mark_student s 
+        sum(case when s.objective_score+s.subjective_score >=t.total_score * t.pass_score/100 then 1 else 0 end) passCount,
+        sum(case when s.objective_score+s.subjective_score >=t.total_score * t.excellent_score/100 then 1 else 0 end) excellentCount
+        FROM mark_student s
+            left join mark_paper t on s.exam_id = t.exam_id
+                and s.paper_number = t.paper_number
+                and s.paper_type = t.paper_type
         WHERE
             s.exam_id = #{examId} and s.paper_number = #{paperNumber}
     </select>
@@ -288,11 +291,14 @@
         avg(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) avgScore,
         max(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) maxScore,
         min(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) minScore,
-        sum(case when s.objective_score+s.subjective_score >=t.pass_score then 1 else 0 end) passCount,
-        sum(case when s.objective_score+s.subjective_score >=t.excellent_score then 1 else 0 end) excellentCount
+        sum(case when s.objective_score+s.subjective_score >=t.total_score * t.pass_score/100 then 1 else 0 end) passCount,
+        sum(case when s.objective_score+s.subjective_score >=t.total_score * t.excellent_score/100 then 1 else 0 end) excellentCount
         FROM mark_student s
+                 left join mark_paper t on s.exam_id = t.exam_id
+            and s.paper_number = t.paper_number
+            and s.paper_type = t.paper_type
         WHERE
-            s.exam_id = #{examId} and s.paper_number = #{paperNumber}
+            s.exam_id = #{examId} and s.paper_number = #{paperNumber} and s.college is not null
         group by s.college
     </select>
     <select id="classData" resultType="com.qmth.teachcloud.mark.bean.archivescore.ClassVo">
@@ -303,11 +309,14 @@
         avg(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) avgScore,
         max(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) maxScore,
         min(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) minScore,
-        sum(case when s.objective_score+s.subjective_score >=t.pass_score then 1 else 0 end) passCount,
-        sum(case when s.objective_score+s.subjective_score >=t.excellent_score then 1 else 0 end) excellentCount
+        sum(case when s.objective_score+s.subjective_score >=t.total_score * t.pass_score/100 then 1 else 0 end) passCount,
+        sum(case when s.objective_score+s.subjective_score >=t.total_score * t.excellent_score/100 then 1 else 0 end) excellentCount
         FROM mark_student s
+                 left join mark_paper t on s.exam_id = t.exam_id
+            and s.paper_number = t.paper_number
+            and s.paper_type = t.paper_type
         WHERE
-            s.exam_id = #{examId} and s.paper_number = #{paperNumber}
+            s.exam_id = #{examId} and s.paper_number = #{paperNumber} and s.class_name is not null
         group by s.class_name
     </select>
     <select id="teacher" resultType="com.qmth.teachcloud.mark.bean.archivescore.TeacherVo">
@@ -318,11 +327,14 @@
         avg(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) avgScore,
         max(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) maxScore,
         min(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) minScore,
-        sum(case when s.objective_score+s.subjective_score >=t.pass_score then 1 else 0 end) passCount,
-        sum(case when s.objective_score+s.subjective_score >=t.excellent_score then 1 else 0 end) excellentCount
+        sum(case when s.objective_score+s.subjective_score >=t.total_score * t.pass_score/100 then 1 else 0 end) passCount,
+        sum(case when s.objective_score+s.subjective_score >=t.total_score * t.excellent_score/100 then 1 else 0 end) excellentCount
         FROM mark_student s
+                 left join mark_paper t on s.exam_id = t.exam_id
+            and s.paper_number = t.paper_number
+            and s.paper_type = t.paper_type
         WHERE
-            s.exam_id = #{examId} and s.paper_number = #{paperNumber}
+            s.exam_id = #{examId} and s.paper_number = #{paperNumber} and s.teacher is not null
         group by s.teacher
     </select>
     <select id="findOne" resultType="com.qmth.teachcloud.mark.bean.student.StudentVo"
@@ -356,11 +368,14 @@
             avg(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) avgScore,
             max(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) maxScore,
             min(case when s.is_absent !=1 then s.objective_score+s.subjective_score else null end) minScore,
-            sum(case when s.objective_score+s.subjective_score >=t.pass_score then 1 else 0 end) passCount,
-            sum(case when s.objective_score+s.subjective_score >=t.excellent_score then 1 else 0 end) excellentCount
+            sum(case when s.objective_score+s.subjective_score >=t.total_score * t.pass_score/100 then 1 else 0 end) passCount,
+            sum(case when s.objective_score+s.subjective_score >=t.total_score * t.excellent_score/100 then 1 else 0 end) excellentCount
         FROM mark_student s
+                 left join mark_paper t on s.exam_id = t.exam_id
+            and s.paper_number = t.paper_number
+            and s.paper_type = t.paper_type
         WHERE
-            s.exam_id = #{examId} and s.paper_number = #{paperNumber}
+            s.exam_id = #{examId} and s.paper_number = #{paperNumber} and s.class_name is not null
         group by s.teacher, s.class_name
     </select>
 </mapper>

+ 3 - 3
teachcloud-mark/src/main/resources/mapper/MarkSubjectiveScoreMapper.xml

@@ -17,17 +17,17 @@
     </resultMap>
     <select id="getSubjectiveVo" resultType="com.qmth.teachcloud.mark.bean.archivescore.QuestionVo">
         SELECT 
-        t.main_title  title,t.main_number,t.sub_number,t.total_score score
+        t.main_title  title,t.main_number,t.sub_number,t.total_score score,
         count(*) studentCount,
         avg(s.score) avgScore,
-        sum(case when s.score>0 then 1 else 0 end) socreCount,
+        sum(case when s.score>0 then 1 else 0 end) scoreCount,
         sum(case when s.score=t.total_score then 1 else 0 end) fullScoreCount
         FROM mark_subjective_score s 
         left join mark_question t on t.exam_id=s.exam_id and t.paper_number=s.paper_number 
         and t.main_number=s.main_number and t.sub_number=s.sub_number
         WHERE
             s.exam_id = #{examId} and s.paper_number = #{paperNumber}
-        group by t.main_title  title,t.main_number,t.sub_number,t.total_score
+        group by t.main_title,t.main_number,t.sub_number,t.total_score
         order by t.main_number,t.sub_number
     </select>
 </mapper>