Răsfoiți Sursa

disable 方向键选择下一题

Michael Wang 6 ani în urmă
părinte
comite
2af2839a2f

+ 15 - 15
src/features/OnlineExam/Examing/ArrowNavView.vue

@@ -10,7 +10,7 @@
       </template>
     </div>
     <div class="tips">
-      方向键 → 下一题。方向键 ← 上一题。<br>A、B、C、D来勾选选项。Y、N来勾选判断题。
+      A、B、C、D来勾选选项。Y、N来勾选判断题。
     </div>
     <div class="next">
       <template v-if="nextQuestionOrder">
@@ -45,20 +45,20 @@ export default {
     keyup(e) {
       // console.log(e);
       // console.log(document.activeElement.type);
-      if (
-        ["BODY", "A", "BUTTON", "DIV"].includes(
-          document.activeElement.tagName
-        ) ||
-        (["INPUT"].includes(document.activeElement.tagName) &&
-          ["checkbox", "radio"].includes(document.activeElement.type))
-      ) {
-        if (e.code === "ArrowRight" && this.nextQuestionOrder) {
-          this.goToNextQuestion();
-        }
-        if (e.code === "ArrowLeft" && this.previousQuestionOrder) {
-          this.goToPreviousQuestion();
-        }
-      }
+      // if (
+      //   ["BODY", "A", "BUTTON", "DIV"].includes(
+      //     document.activeElement.tagName
+      //   ) ||
+      //   (["INPUT"].includes(document.activeElement.tagName) &&
+      //     ["checkbox", "radio"].includes(document.activeElement.type))
+      // ) {
+      //   if (e.code === "ArrowRight" && this.nextQuestionOrder) {
+      //     this.goToNextQuestion();
+      //   }
+      //   if (e.code === "ArrowLeft" && this.previousQuestionOrder) {
+      //     this.goToPreviousQuestion();
+      //   }
+      // }
     },
     goToNextQuestion() {
       this.$router.push({

+ 4 - 0
src/features/OnlineExam/Examing/BooleanQuestionView.vue

@@ -71,6 +71,10 @@ export default {
       }
     },
     async answerQuestion(studentAnswer) {
+      if (this.isSyncState === false) {
+        console.log("更新答案时,问题与答案的号码不一致。");
+        return;
+      }
       if (studentAnswer !== this.examQuestion.studentAnswer) {
         this.updateExamQuestion({
           order: this.examQuestion.order,

+ 1 - 1
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -287,11 +287,11 @@ export default {
             "/api/ecs_oe_student/examQuestion/submitQuestionAnswer",
             answers
           );
+          this.resetExamQuestionDirty();
         } catch (error) {
           console.log(error);
           this.$Message.error("提交答案失败");
         }
-        this.resetExamQuestionDirty();
       }
     },
     async submitPaper() {

+ 4 - 0
src/features/OnlineExam/Examing/MultipleQuestionView.vue

@@ -103,6 +103,10 @@ export default {
       }
     },
     async answerQuestion(studentAnswer) {
+      if (this.isSyncState === false) {
+        console.log("更新答案时,问题与答案的号码不一致。");
+        return;
+      }
       let realAnswer = studentAnswer;
       if (studentAnswer === "") {
         realAnswer = null;

+ 4 - 0
src/features/OnlineExam/Examing/SingleQuestionView.vue

@@ -80,6 +80,10 @@ export default {
       }
     },
     async answerQuestion(studentAnswer) {
+      if (this.isSyncState === false) {
+        console.log("更新答案时,问题与答案的号码不一致。");
+        return;
+      }
       if (studentAnswer !== this.examQuestion.studentAnswer) {
         this.updateExamQuestion({
           order: this.examQuestion.order,