Browse Source

处理判题null的情况

shmily1213 1 tháng trước cách đây
mục cha
commit
a118e58f85
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/composables/useExam.ts

+ 1 - 1
src/composables/useExam.ts

@@ -482,7 +482,7 @@ export const useExam = () => {
     answer1 = answer1 || '';
     answer2 = answer2 || '';
     if ([EnumQuestionType.SINGLE_CHOICE, EnumQuestionType.JUDGMENT].includes(typeId)) {
-      return answer1.trim() === answers[0];
+      return answer1?.trim() === answers[0];
     } else if ([EnumQuestionType.MULTIPLE_CHOICE].includes(typeId)) {
       return answers.length === answer1.length && answers.every(item => answer1.includes(item));
     } else {