Michael Wang преди 6 години
родител
ревизия
a08fa05d31
променени са 2 файла, в които са добавени 9 реда и са изтрити 8 реда
  1. 4 3
      src/features/OnlineExam/Examing/ExamingHome.vue
  2. 5 5
      src/features/OnlineExam/Examing/QuestionView.vue

+ 4 - 3
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -165,16 +165,17 @@ export default {
 
     this.submitInterval = setInterval(
       () => this.answerAllQuestions(),
-      10 * 1000 // 10秒检查是否有更改需要提交答案
+      5 * 1000 // 10秒检查是否有更改需要提交答案
     );
   },
   mounted() {
     // iview bug: https://github.com/iview/iview/issues/4061
     // document.body.style = "";
   },
-  // FIXME: 在上线前删除
   beforeRouteUpdate(from, to, next) {
-    console.log(this.$route.fullPath);
+    if (process.env.NODE_ENV === "development") {
+      console.log("beforeRouteUpdate from: " + this.$route.fullPath);
+    }
     this.answerAllQuestions();
     next();
   },

+ 5 - 5
src/features/OnlineExam/Examing/QuestionView.vue

@@ -37,35 +37,35 @@
         :key="examQuestion.order"
       >
         <div style="margin-bottom: -45px;">{{examQuestion.groupOrder}}、</div>
-        <template v-if="question && examQuestion.questionType === 'SINGLE_CHOICE'">
+        <template v-if="question && question.questionType === 'SINGLE_CHOICE' && examQuestion.questionType === 'SINGLE_CHOICE'">
           <single-question-view
             :question="question"
             :examQuestion="examQuestion"
             :key="examQuestion.order"
           />
         </template>
-        <template v-if="question && examQuestion.questionType === 'MULTIPLE_CHOICE'">
+        <template v-if="question && question.questionType === 'MULTIPLE_CHOICE' && examQuestion.questionType === 'MULTIPLE_CHOICE'">
           <multiple-question-view
             :question="question"
             :examQuestion="examQuestion"
             :key="examQuestion.order"
           />
         </template>
-        <template v-if="question && examQuestion.questionType === 'TRUE_OR_FALSE'">
+        <template v-if="question && question.questionType === 'TRUE_OR_FALSE' && examQuestion.questionType === 'TRUE_OR_FALSE'">
           <boolean-question-view
             :question="question"
             :examQuestion="examQuestion"
             :key="examQuestion.order"
           />
         </template>
-        <template v-if="question && examQuestion.questionType === 'FILL_UP'">
+        <template v-if="question && question.questionType === 'FILL_UP' && examQuestion.questionType === 'FILL_UP'">
           <fill-blank-question-view
             :question="question"
             :examQuestion="examQuestion"
             :key="examQuestion.order"
           />
         </template>
-        <template v-if="question && examQuestion.questionType === 'ESSAY'">
+        <template v-if="question && question.questionType === 'ESSAY' && examQuestion.questionType === 'ESSAY'">
           <text-question-view
             :question="question"
             :examQuestion="examQuestion"