Переглянути джерело

考试结束后就应该重置考试信息,以免影响断点续考状态

Michael Wang 6 роки тому
батько
коміт
4e7e6c8dcd

+ 10 - 9
src/features/OnlineExam/Examing/ExamingEnd.vue

@@ -33,11 +33,12 @@
 <script>
 import { mapState as globalMapState } from "vuex";
 import { createNamespacedHelpers } from "vuex";
-const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
+const { mapMutations } = createNamespacedHelpers("examingHomeModule");
 
 export default {
   data() {
     return {
+      exam: null,
       afterExamRemark: null,
       showObjectScore: null,
       cheatingRemark: null,
@@ -68,15 +69,15 @@ export default {
     await f();
 
     try {
-      if (!this.exam) {
-        this.exam = (await this.$http.get(
-          "/api/ecs_exam_work/exam/" + examId
-        )).data;
-      }
+      // if (!this.exam) {
+      this.exam = (await this.$http.get(
+        "/api/ecs_exam_work/exam/" + examId
+      )).data;
+      // }
 
       if (this.exam.examType === "PRACTICE") {
         this.$router.replace(
-          `/online-practice/exam/${examId}/detail?examRecordDataId=${examRecordDataId}`
+          `/online-practice/exam/${examId}/detail?examRecordDataId=${examRecordDataId}&disableGoBack=true`
         );
         return;
       }
@@ -116,8 +117,8 @@ export default {
     });
   },
   computed: {
-    ...globalMapState(["user"]),
-    ...mapState(["exam"])
+    ...globalMapState(["user"])
+    // ...mapState(["exam"])
   },
   methods: {
     ...mapMutations(["updateExamState"])

+ 5 - 0
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -139,6 +139,11 @@ export default {
     clearInterval(this.snapInterval);
     clearTimeout(this.faceIdMsgTimeout);
     clearTimeout(this.faceIdDivTimeout);
+    this.updateExamState({
+      exam: null,
+      paperStruct: null,
+      examQuestionList: null
+    });
   },
   // beforeRouteUpdate(to, from, next) {
   //   this.updateQuestion(next);