Просмотр исходного кода

fix: 修正直接再次提交时-1

ChenYangfan 6 лет назад
Родитель
Сommit
ff8ef78cbb
1 измененных файлов с 2 добавлено и 4 удалено
  1. 2 4
      src/views/quiz/StudentDoQuiz.vue

+ 2 - 4
src/views/quiz/StudentDoQuiz.vue

@@ -98,7 +98,7 @@ export default {
     },
     handleFormSubmit () {
       const { quizId } = this.$route.params
-      this.pushRecord({ questionId: this.questionPointer, startAt: this.lastDate, endAt: this.choiceDate })
+      this.questionPointer !== -1 && this.pushRecord({ questionId: this.questionPointer, startAt: this.lastDate, endAt: this.choiceDate })
       const answers = {}
       let uncompleted = false
       this.questions.map(question => {
@@ -152,9 +152,7 @@ export default {
       if (isEmpty(record)) {
         this.records[questionId] = { startAt, endAt }
       } else {
-        console.log(record.endAt, startAt, endAt)
-        record.endAt = record.endAt + endAt - startAt
-        console.log(record)
+        record.endAt = record.endAt + (endAt - startAt)
       }
     },
     momentFromNow,