From 2ce39b142d3c6a08cd76c1f17d53d07539fe233b Mon Sep 17 00:00:00 2001 From: chenqiang Date: Wed, 13 Aug 2025 11:32:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A4=E5=8D=B7=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E5=80=BC=E6=AF=94=E8=BE=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/db/examing.js | 10 ++++++++-- package.json | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/electron/db/examing.js b/electron/db/examing.js index 4b014aa..b663a50 100644 --- a/electron/db/examing.js +++ b/electron/db/examing.js @@ -1107,6 +1107,12 @@ export async function checkPaperAnswers(paperId) { const index = correctAnswersCopy.indexOf(answer); if (index === -1) { isCorrect = false; + for (const correct of correctAnswersCopy) { + if (Number(answer) === Number(correct)) { + isCorrect = true; + break; + } + } break; } // 移除已匹配的答案,避免重复匹配 @@ -1146,7 +1152,7 @@ export async function checkPaperAnswers(paperId) { const updatedPaper = await getPaper(paperId); console.log(updatedPaper); // 关闭数据库连接 - await closeAllConnections(); + // await closeAllConnections(); return { success: true, @@ -1155,7 +1161,7 @@ export async function checkPaperAnswers(paperId) { }; } catch (error) { console.error('判卷过程中发生错误:', error); - await closeAllConnections(); + // await closeAllConnections(); return { success: false, message: `判卷失败: ${error.message}`, diff --git a/package.json b/package.json index 168f701..46406d1 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "electron:build": "vite build && electron-builder", "electron:build:win": "vite build && set WIN_CODE_SIGN_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ && electron-builder --win --x64", "electron:build:win32": "vite build && set WIN_CODE_SIGN_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ && electron-builder --win --ia32", - "electron:build:portable": "vite build && set WIN_CODE_SIGN_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ && electron-builder --win --x64" + "electron:build:portable": "vite build && set WIN_CODE_SIGN_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ && electron-builder --win --x64", + "electron:build:portable32": "vite build && set WIN_CODE_SIGN_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ && electron-builder --win --ia32" }, "dependencies": { "@element-plus/icons-vue": "^2.3.1",