|
@@ -14,7 +14,7 @@ import { httpApp } from "@/plugins/axiosApp";
|
|
|
import { useTimers } from "@/setups/useTimers";
|
|
|
import { checkMainExe } from "@/utils/nativeMethods";
|
|
|
import { showLogout } from "@/utils/utils";
|
|
|
-import { onBeforeUpdate, onMounted, onUnmounted, watch } from "vue";
|
|
|
+import { onBeforeUpdate, onMounted, onUnmounted, watch, reactive } from "vue";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import { store } from "@/store/store";
|
|
|
import { useRemoteAppChecker } from "@/features/UserLogin/useRemoteAppChecker";
|
|
@@ -35,6 +35,7 @@ store.exam.compareResultMap = new Map();
|
|
|
const { addTimeout, addInterval } = useTimers();
|
|
|
|
|
|
let loading = $ref(true);
|
|
|
+let usedExamTimes = reactive({ usedExamSeconds: 0, startTimestamp: Date.now() });
|
|
|
const route = useRoute();
|
|
|
const examId = +route.params.examId;
|
|
|
const examRecordDataId = +route.params.examRecordDataId;
|
|
@@ -50,7 +51,7 @@ const { userSubmitPaper, realSubmitPaper } = useRealSubmitPaper(
|
|
|
|
|
|
async function userClickSubmit() {
|
|
|
store.increaseGlobalMaskCount("userClickSubmit");
|
|
|
- void userSubmitPaper();
|
|
|
+ void userSubmitPaper(usedExamTimes);
|
|
|
// 一定要在这里等待,不然用户快速双击就会点两次
|
|
|
await new Promise((res) => setTimeout(res, 1000));
|
|
|
store.decreaseGlobalMaskCount("userClickSubmit");
|
|
@@ -115,6 +116,16 @@ onMounted(async () => {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+/** 开始作答 */
|
|
|
+function onStartAnswer({
|
|
|
+ usedExamSeconds: n = 0,
|
|
|
+}: {
|
|
|
+ usedExamSeconds: number;
|
|
|
+}) {
|
|
|
+ usedExamTimes.usedExamSeconds = n
|
|
|
+ usedExamTimes.startTimestamp = Date.now()
|
|
|
+}
|
|
|
+
|
|
|
//#region 人脸抓拍与活体检测
|
|
|
let { snapId, doSnap, showSnapResult } = useFaceCompare();
|
|
|
let { showFaceId } = useFaceLive(doSnap);
|
|
@@ -208,7 +219,10 @@ const userInfo = $computed(
|
|
|
<template>
|
|
|
<div v-if="!loading" class="container">
|
|
|
<div class="header">
|
|
|
- <RemainTime @onEndtime="shouldSubmitPaper"></RemainTime>
|
|
|
+ <RemainTime
|
|
|
+ @onEndtime="shouldSubmitPaper"
|
|
|
+ @onStartAnswer="onStartAnswer"
|
|
|
+ ></RemainTime>
|
|
|
<div class="tw-flex tw-flex-wrap tw-justify-between">
|
|
|
<div>{{ store.exam.courseName }}</div>
|
|
|
<OverallProgress></OverallProgress>
|