فهرست منبع

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

ChenYangfan 6 سال پیش
والد
کامیت
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 () {
     handleFormSubmit () {
       const { quizId } = this.$route.params
       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 = {}
       const answers = {}
       let uncompleted = false
       let uncompleted = false
       this.questions.map(question => {
       this.questions.map(question => {
@@ -152,9 +152,7 @@ export default {
       if (isEmpty(record)) {
       if (isEmpty(record)) {
         this.records[questionId] = { startAt, endAt }
         this.records[questionId] = { startAt, endAt }
       } else {
       } else {
-        console.log(record.endAt, startAt, endAt)
-        record.endAt = record.endAt + endAt - startAt
-        console.log(record)
+        record.endAt = record.endAt + (endAt - startAt)
       }
       }
     },
     },
     momentFromNow,
     momentFromNow,