reloaded %!s(int64=4) %!d(string=hai) anos
pai
achega
7c09b4c6cb
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  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() {