reloaded 4 years ago
parent
commit
7c09b4c6cb
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/views/task/stutask.vue

+ 3 - 2
src/views/task/stutask.vue

@@ -89,7 +89,9 @@ export default {
         const task = await this.taskInfo(item.taskid);
         for (const question of task.data.question) {
           const answer = item.answers.find(item => item.questionid === question._id);
-          question.stuanswer = answer.answer;
+          if (answer) {
+            question.stuanswer = answer.answer;
+          }
         }
         this.$set(this, `task`, task.data);
         console.log(task.data);
@@ -108,7 +110,6 @@ export default {
         this.$toast('提交学生成绩成功');
         this.display = 'list';
       }
-      console.log(this.uploadtask);
     },
   },
   mounted() {