Browse Source

查看试卷新增主观题得分

zhangjie 2 năm trước cách đây
mục cha
commit
7bd38b7029

+ 16 - 0
src/features/examwork/StudentExamDetail/PreviewPaperDialog.vue

@@ -106,6 +106,9 @@ export default {
       const examStudentAnswerJson = data.examStudentAnswerJson
         ? JSON.parse(data.examStudentAnswerJson)
         : [];
+      const subjectiveScoreDetailJson = data.subjectiveScoreDetailJson
+        ? JSON.parse(data.subjectiveScoreDetailJson)
+        : [];
       const randomPaperStructPath = data.randomPaperStructPath
         ? JSON.parse(data.randomPaperStructPath)
         : { details: [] };
@@ -146,6 +149,19 @@ export default {
           };
         }
       });
+      subjectiveScoreDetailJson.forEach((question) => {
+        let k = `${question.mainNumber}-${question.subNumber}`;
+        if (question.subIndex) {
+          k = `${k}-${question.subIndex}`;
+        }
+        if (studentAnsMap[k]) {
+          studentAnsMap[k].score = question.score;
+        } else {
+          studentAnsMap[k] = {
+            score: question.score,
+          };
+        }
+      });
 
       // detail
       paperStructJson.details.forEach((detail) => {