Sfoglia il codice sorgente

错题,分值显示等调整

mingfu 1 settimana fa
parent
commit
74b2b362de

+ 1 - 1
ie-admin/src/main/java/com/ruoyi/web/domain/VoluntaryDto.java

@@ -506,7 +506,7 @@ public class VoluntaryDto {
             for (Triple<Double, Double, Double> t : itemList) {
                 oriTotal += Math.min(t.getMiddle() - t.getLeft(), missRateScore * t.getMiddle() / statTotal / t.getRight());
             }
-            return oriTotal;
+            return Math.round(oriTotal * 10) / 10.0;
         }
         private void merge(Map<String, MutablePair<Double, Double>> pairMap, String key, Double value, Double oriValue) {
             MutablePair<Double, Double> exist = pairMap.get(key);

+ 5 - 3
ie-admin/src/main/java/com/ruoyi/web/service/CommService.java

@@ -81,10 +81,9 @@ public class CommService {
         for(LearnKnowledgeTree kt : ktList) {
             LearnTeacherService.TreeNode tn;
             if(null != knowCountMap && null != (counts = knowCountMap.get(kt.getId()))) {
-                Double rate = counts[2] > 0 ? Math.max(Math.round(counts[2] * 1000.0 / counts[1]) / 10.0, 0.1) : 0.0;
-                tn = new LearnTeacherService.TreeNode(kt.getId(), kt.getName(),  counts, rate);
+                tn = new LearnTeacherService.TreeNode(kt.getId(), kt.getName(),  counts);
             } else {
-                tn = new LearnTeacherService.TreeNode(kt.getId(), kt.getName(),  null, null);
+                tn = new LearnTeacherService.TreeNode(kt.getId(), kt.getName(),  null);
             }
             teMap.put(kt.getId(), tn);
         }
@@ -97,6 +96,9 @@ public class CommService {
             LearnTeacherService.TreeNode node = teMap.get(kt.getId());
             if(null != node.getQuestionCount()) {
                 parent.setQuestionCount(parent.getQuestionCount() + node.getQuestionCount());
+                parent.setFinishedCount(parent.getFinishedCount() + node.getFinishedCount());
+                parent.setRightCount(parent.getRightCount() + node.getRightCount());
+                parent.calcRatio();
             }
             parent.getChildren().add(node);
         }

+ 8 - 2
ie-admin/src/main/java/com/ruoyi/web/service/LearnTeacherService.java

@@ -421,16 +421,22 @@ public class LearnTeacherService {
         private Integer status;
         private Integer questionCount;
         private Integer finishedCount;
+        private Integer rightCount;
         private Double finishedRatio;
 
         List<TreeNode> children = Lists.newArrayList();
-        public TreeNode(Long id, String name, Integer[] counts, Double finishedRatio) {
+        public TreeNode(Long id, String name, Integer[] counts) {
             this.id = id;
             this.name = name;
             this.status = 0;
             this.questionCount = null != counts ? counts[0] : 0;
             this.finishedCount = null != counts ? counts[1] : 0;
-            this.finishedRatio = finishedRatio;
+            this.rightCount = null != counts ? counts[2] : 0;
+            calcRatio();
+        }
+
+        public void calcRatio() {
+            this.finishedRatio = finishedCount > 0 ? Math.max(Math.round(rightCount * 1000.0 / finishedCount) / 10.0, 0.1) : 0.0;
         }
 
         public boolean setChecked(Set<Long> idSet) {

+ 1 - 1
ie-admin/src/main/java/com/ruoyi/web/service/VoluntaryService.java

@@ -673,7 +673,7 @@ public class VoluntaryService {
                         EnrollRateCalculator.RateLevel rl;
                         if (null != lastSubmit.getScore() && currTotal != null && null != (rl = enrollRateCalculator.satisfy(validScoreTotal, lastSubmit.getScore(), currTotal / currScoreRate))) { // 按去年标准算概率
                             Double skillRate = Double.parseDouble(skillEnrollScore.getValueRule());
-                            mr.setValue(String.valueOf(Math.round(Math.round(lastSubmit.getScore() * currScoreRate) - currTotal) / skillRate));
+                            mr.setValue(String.valueOf(Math.round((lastSubmit.getScore() * currScoreRate - currTotal) * 10 / skillRate) / 10.0));
                             mr.setValid(true);
                         } else {
                             mr.setFailedMessage("没有对应计算条件");

+ 1 - 1
ie-system/src/main/resources/mapper/learn/LearnWrongBookMapper.xml

@@ -172,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             wb.`student_id` = #{studentId} AND q.`qtpye` IN ('判断题', '单选题', '选择题','单项选择','单项选择题','多选题')
             <if test="subjectId != null "> and wb.`subject_id` = #{subjectId}</if>
             <if test="start != null "> and date(wb.`created_time`) &gt;= date(#{start})</if>
-            <if test="end != null "> and date(wb.`created_time` &lt;= date(#{end})</if>
+            <if test="end != null "> and date(wb.`created_time`) &lt;= date(#{end})</if>
         </where>
         order by wb.`created_time` desc
     </select>