ソースを参照

bug-5270 考试只有一道填空题,无法交卷

tianxinyu 8 ヶ月 前
コミット
bf778b1368
1 ファイル変更2 行追加2 行削除
  1. 2 2
      src/views/platform/examination/questionBank/test.vue

+ 2 - 2
src/views/platform/examination/questionBank/test.vue

@@ -406,7 +406,7 @@ export default {
             const finished = []
             this.questionList.forEach(item => {
                 if (item.questionType === '填空题') {
-                    finished.push(item.answer && !item.answer.some(i => i === '' || i === null))
+                    finished.push(item.options && !item.options.some((i) => i.answer === '' || i.answer === null))
                 } else if (item.questionType === '多选题') {
                     finished.push(item.answer.some(i => i) && true)
                 } else {
@@ -496,7 +496,7 @@ export default {
                 let incompleteList = []
                 this.questionList.forEach((item, index) => {
                     if (item.questionType === '填空题') {
-                        const t = item.answer && !item.answer.some(i => i === '' || i === null)
+                        const t = item.options && !item.options.some((i) => i.answer === '' || i.answer === null)
                         incompleteList.push(!t ? index + 1 : '')
                     } else if (item.questionType === '多选题') {
                         const t = item.answer && item.answer.length