فهرست منبع

修改计算显示模式下显示的分数问题

dusenyao 1 سال پیش
والد
کامیت
400257c2d3
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      src/views/exercise_questions/answer/index.vue

+ 3 - 3
src/views/exercise_questions/answer/index.vue

@@ -729,12 +729,12 @@ export default {
           GetQuestionInfo({ question_id: id }).then(({ question: { content } }) => JSON.parse(content)),
         );
         Promise.all(promises).then((list) => {
-          let score = list.reduce((acc, { property }) => {
+          let score = list.reduce((acc, { property, option_list }) => {
             return (
               acc +
               (property.score_type === scoreTypeList[0].value
                 ? property.score
-                : property.score * (property?.option_number ?? 1))
+                : property.score * (option_list?.length ?? 1))
             );
           }, 0);
           this.showScore = score;
@@ -743,7 +743,7 @@ export default {
         this.showScore =
           curQuestion.property.score_type === scoreTypeList[0].value
             ? curQuestion.property.score
-            : curQuestion.property.score * (curQuestion.property?.option_number ?? 1);
+            : curQuestion.property.score * (curQuestion?.option_list.length ?? 1);
       }
     },
   },