fix: 过程数据关闭问题修复
This commit is contained in:
parent
06ad18fccb
commit
0f400c7467
@ -174,6 +174,7 @@ export struct JudgePage {
|
||||
builder: ConfirmDialog({
|
||||
text: "确认结束考试?",
|
||||
onConfirm: async () => {
|
||||
dConsole.log(JudgeTag, "点击确认结束")
|
||||
if (this.isErrorMsgEnd) {
|
||||
dConsole.log(JudgeTag, "router back1")
|
||||
router.back()
|
||||
|
||||
@ -282,6 +282,7 @@ export class BaseJudge {
|
||||
if (!judgeUI.singlePlay && that.isManual && !judgeUI.isAllProjectsEnd && judgeUI.totalScore >= judgeUI.passingScore) {
|
||||
that.avPlayer?.playAudio(['voice/empty.mp3'], true, () => {
|
||||
this.isUdpEnd = true
|
||||
dConsole.log(JudgeTag, "考试结束自动退出1")
|
||||
router.back();
|
||||
})
|
||||
return
|
||||
@ -309,13 +310,16 @@ export class BaseJudge {
|
||||
} catch (e) {
|
||||
console.info(JudgeTag, JSON.stringify(e))
|
||||
}
|
||||
if (judgeUI.singlePlay) {
|
||||
// 单机结束
|
||||
await this.endExam(judgeUI, that)
|
||||
} else {
|
||||
TheExamIsOver(judgeUI, that, async (res: WR) => {
|
||||
dConsole.log(JudgeTag, ExamProcessDataTag, "考试结束接口完成", res)
|
||||
const code = res.code!.toString()
|
||||
if (code !== "1") {
|
||||
that?.avPlayer?.playAudio(['voice/监管失败.mp3'])
|
||||
judgeUI.errorMsg = decodeURIComponent(res?.message || "")
|
||||
|
||||
if (code.toString() === "2300028" || code.toString() === "2300007") {
|
||||
judgeUI.errorMsg = '当前的考试过程信息监管审核未通过,程序将退出!'
|
||||
}
|
||||
@ -325,6 +329,8 @@ export class BaseJudge {
|
||||
await this.endExam(judgeUI, that)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@ -412,6 +418,7 @@ export class BaseJudge {
|
||||
if (judgeUI.kfArr.length - 1 === index) {
|
||||
that.avPlayer?.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => {
|
||||
this.isUdpEnd = true
|
||||
dConsole.log(JudgeTag, "考试结束自动退出2")
|
||||
router.back();
|
||||
})
|
||||
throw new Error('End Loop')
|
||||
@ -420,6 +427,7 @@ export class BaseJudge {
|
||||
} else {
|
||||
that.avPlayer?.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => {
|
||||
this.isUdpEnd = true
|
||||
dConsole.log(JudgeTag, "考试结束自动退出3")
|
||||
router.back();
|
||||
})
|
||||
throw new Error('End Loop')
|
||||
@ -433,6 +441,7 @@ export class BaseJudge {
|
||||
that.avPlayer?.playAudio([voiceURL], true, () => {
|
||||
setTimeout(() => {
|
||||
this.isUdpEnd = true
|
||||
dConsole.log(JudgeTag, "考试结束自动退出5")
|
||||
router.back();
|
||||
}, param302 === "8" ? 3000 : 0)
|
||||
})
|
||||
@ -761,9 +770,12 @@ export class BaseJudge {
|
||||
const passingScore = Number(judgeUI.passingScore)
|
||||
const jl = judgeUI.jl
|
||||
if (that.isExamEnd) {
|
||||
dConsole.log("JudgeTag", "已经结束考试")
|
||||
return
|
||||
}
|
||||
if (isManual) {
|
||||
dConsole.log(JudgeTag, '收到远程结束考试消息5')
|
||||
judgeUI.generateExamRecordsDialogController.close()
|
||||
// 考试不合格
|
||||
await examJudgeEndExam()
|
||||
that.isExamEnd = true
|
||||
@ -772,7 +784,7 @@ export class BaseJudge {
|
||||
const param302: number = Reflect.get(judgeConfigObj, '302')
|
||||
const param342: number = Reflect.get(judgeConfigObj, '342')
|
||||
const param512: number[] = (Reflect.get(judgeConfigObj, '512') || '').split(',');
|
||||
|
||||
dConsole.log(JudgeTag, '收到远程结束考试消息4')
|
||||
//单机模式
|
||||
if (singlePlay) {
|
||||
dConsole.info(JudgeTag + ' 单机模式结束 => ', isAllProjectsEnd)
|
||||
|
||||
@ -119,6 +119,7 @@ function CloseProcessData() {
|
||||
fileFdArr.forEach((item: number) => {
|
||||
fs.closeSync(item)
|
||||
})
|
||||
fileFdArr = []
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user