增加判卷时的数值比较
This commit is contained in:
parent
e55476133f
commit
2ce39b142d
@ -1107,6 +1107,12 @@ export async function checkPaperAnswers(paperId) {
|
|||||||
const index = correctAnswersCopy.indexOf(answer);
|
const index = correctAnswersCopy.indexOf(answer);
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
isCorrect = false;
|
isCorrect = false;
|
||||||
|
for (const correct of correctAnswersCopy) {
|
||||||
|
if (Number(answer) === Number(correct)) {
|
||||||
|
isCorrect = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// 移除已匹配的答案,避免重复匹配
|
// 移除已匹配的答案,避免重复匹配
|
||||||
@ -1146,7 +1152,7 @@ export async function checkPaperAnswers(paperId) {
|
|||||||
const updatedPaper = await getPaper(paperId);
|
const updatedPaper = await getPaper(paperId);
|
||||||
console.log(updatedPaper);
|
console.log(updatedPaper);
|
||||||
// 关闭数据库连接
|
// 关闭数据库连接
|
||||||
await closeAllConnections();
|
// await closeAllConnections();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
@ -1155,7 +1161,7 @@ export async function checkPaperAnswers(paperId) {
|
|||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('判卷过程中发生错误:', error);
|
console.error('判卷过程中发生错误:', error);
|
||||||
await closeAllConnections();
|
// await closeAllConnections();
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
message: `判卷失败: ${error.message}`,
|
message: `判卷失败: ${error.message}`,
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
"electron:build": "vite build && electron-builder",
|
"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: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: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": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user