|
@@ -10,7 +10,7 @@
|
|
|
<td style="max-width: 200px">操作</td>
|
|
|
</tr>
|
|
|
|
|
|
- <tr v-for="(course) in courses" :key="course.examId">
|
|
|
+ <tr v-for="course in courses" :key="course.examId">
|
|
|
<td>{{ course.courseName }}</td>
|
|
|
<td>{{ course.specialtyName }}</td>
|
|
|
<td>{{ course.startTime }} <br> ~ <br> {{ course.endTime }}</td>
|
|
@@ -18,7 +18,7 @@
|
|
|
<td style="min-width: 180px">
|
|
|
<template v-if="!course.isvalid">
|
|
|
<div style="display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px">
|
|
|
- <i-button class="qm-primary-button" @click="previewPaper(course)">进入考试</i-button>
|
|
|
+ <i-button class="qm-primary-button" :disabled="!courseInBetween(course)" @click="enterExam(course)">进入考试</i-button>
|
|
|
|
|
|
<i-poptip trigger="hover" placement="left" class="online-exam-list-override-poptip">
|
|
|
<i-button class="qm-primary-button" style="width: 100%">客观分</i-button>
|
|
@@ -35,21 +35,43 @@
|
|
|
|
|
|
<script>
|
|
|
import OnlineExamResultList from "./OnlineExamResultList.vue";
|
|
|
+import moment from "moment";
|
|
|
|
|
|
export default {
|
|
|
name: "EcsOnlineList",
|
|
|
data() {
|
|
|
- return {};
|
|
|
+ return { now: new Date() };
|
|
|
},
|
|
|
props: {
|
|
|
courses: Array
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getNow();
|
|
|
+ this.intervalID = setInterval(this.getNow, 1000);
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+ clearInterval(this.intervalID);
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ getNow() {
|
|
|
+ this.now = new Date();
|
|
|
+ },
|
|
|
+ courseInBetween(course) {
|
|
|
+ return moment(this.now).isBetween(
|
|
|
+ moment(course.startTime),
|
|
|
+ moment(course.endTime)
|
|
|
+ );
|
|
|
+ },
|
|
|
async enterExam(course) {
|
|
|
- await this.$http.get("/api/offline_exam/start", {
|
|
|
- params: { examStudentId: course.examStudentId }
|
|
|
- });
|
|
|
- this.$emit("reloadList");
|
|
|
+ // TODO: 待确认. 前端控制展示“是否进入考试”。后端控制不在有效期内不准访问。
|
|
|
+ if (course.faceEnable) {
|
|
|
+ // open face check modal, then
|
|
|
+ // if 人脸识别失败 && 考试开启强制人脸识别 return
|
|
|
+ // if 人脸识别失败 && 考试未开启强制人脸识别
|
|
|
+ // 让学生手动确认进入考试,若取消,则返回
|
|
|
+ }
|
|
|
+
|
|
|
+ // this.$router.push("/online-exam/exam/:id/overview")
|
|
|
},
|
|
|
previewPaper(course) {
|
|
|
var user = {
|