Explorar o código

练习:主观题答案的展示

Michael Wang %!s(int64=6) %!d(string=hai) anos
pai
achega
2817003856
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/features/OnlineExam/Examing/ExamPaper.vue

+ 3 - 1
src/features/OnlineExam/Examing/ExamPaper.vue

@@ -250,7 +250,9 @@ export default {
         }
         return { true: "正确", false: "错误" }[studentAnswer.join("")];
       }
-      return studentAnswer.join("");
+      return typeof studentAnswer === "string"
+        ? studentAnswer
+        : studentAnswer.join("");
     }
   },
   computed: {},