浏览代码

在准备进入新的考试或练习时,先检查断点续考

Michael Wang 6 年之前
父节点
当前提交
6ceb93cc5e
共有 2 个文件被更改,包括 62 次插入0 次删除
  1. 31 0
      src/features/OnlineExam/OnlineExamList.vue
  2. 31 0
      src/features/OnlinePractice/OnlinePracticeList.vue

+ 31 - 0
src/features/OnlineExam/OnlineExamList.vue

@@ -74,7 +74,38 @@ export default {
         moment(course.endTime)
       );
     },
+    async checkExamInProgress() {
+      try {
+        // 断点续考
+        const examingRes = (await this.$http.get(
+          "/api/ecs_oe_student/examControl/checkExamInProgress"
+        )).data;
+        if (examingRes) {
+          this.$Spin.show({
+            render: () => {
+              return <div style="font-size: 24px">正在进入断点续考...</div>;
+            }
+          });
+          this.$router.push(
+            `/online-exam/exam/${examingRes.examId}/examRecordData/${
+              examingRes.examRecordDataId
+            }/order/1` +
+              (examingRes.faceVerifyMinute
+                ? `?faceVerifyMinute=${examingRes.faceVerifyMinute}`
+                : "")
+          );
+          setTimeout(() => this.$Spin.hide(), 1000);
+          return;
+        }
+        this.$router.push("/online-exam");
+      } catch (error) {
+        this.$Message.error("获取断点续考信息异常,退出登录");
+        this.logout();
+        return;
+      }
+    },
     async enterExam(course) {
+      await this.checkExamInProgress();
       this.spinShow = true;
       this.processingMessage = "正在检测IP合法性...";
       try {

+ 31 - 0
src/features/OnlinePractice/OnlinePracticeList.vue

@@ -65,7 +65,38 @@ export default {
         moment(course.endTime)
       );
     },
+    async checkExamInProgress() {
+      try {
+        // 断点续考
+        const examingRes = (await this.$http.get(
+          "/api/ecs_oe_student/examControl/checkExamInProgress"
+        )).data;
+        if (examingRes) {
+          this.$Spin.show({
+            render: () => {
+              return <div style="font-size: 24px">正在进入断点续考...</div>;
+            }
+          });
+          this.$router.push(
+            `/online-exam/exam/${examingRes.examId}/examRecordData/${
+              examingRes.examRecordDataId
+            }/order/1` +
+              (examingRes.faceVerifyMinute
+                ? `?faceVerifyMinute=${examingRes.faceVerifyMinute}`
+                : "")
+          );
+          setTimeout(() => this.$Spin.hide(), 1000);
+          return;
+        }
+        this.$router.push("/online-exam");
+      } catch (error) {
+        this.$Message.error("获取断点续考信息异常,退出登录");
+        this.logout();
+        return;
+      }
+    },
     async enterPractice(course) {
+      await this.checkExamInProgress();
       this.$router.push(
         `/online-exam/exam/${course.examId}/overview?examStudentId=${
           course.examStudentId