fix(判题): 题目缺测试数据时学生看到「编译错误」和一句英文「Test case not found」,以为是自己写错了
Deploy / deploy (push) Canceled after 0s
Deploy / deploy (push) Canceled after 0s
判题机的 err 只有 CompileError 是学生的错,别的(JudgeClientError 之类)原来也一律 记成编译错误,全库 337 条,最近一条在 2026-09。改记系统错误,学生那边说「判题出了 问题,不是你的代码写错了,告诉老师」,不再贴英文原文。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
96ce9725b2
commit
e118d80057
2 files changed
+17
-4
No files matched your search
@@ -538,10 +538,19 @@ export async function judgeSubmission(job: JudgeJobData) {
|
|||||||
if (response.err) {
|
if (response.err) {
|
||||||
const errInfo =
|
const errInfo =
|
||||||
typeof response.data === "string" ? response.data : JSON.stringify(response.data)
|
typeof response.data === "string" ? response.data : JSON.stringify(response.data)
|
||||||
result = JudgeStatus.COMPILE_ERROR
|
// 只有 CompileError 是学生的错。别的(JudgeClientError 的「Test case not found」
|
||||||
statisticInfo = {
|
// 这类)是题目或判题机的问题:原来一律记成编译错误,学生看到一句英文、以为自己写错了,
|
||||||
err_info: shiftCompileLines(errInfo, template ? template.prepend.split("\n").length : 0),
|
// 全库 337 条,最近一条就在 2026-09。
|
||||||
score: 0,
|
if (response.err === "CompileError") {
|
||||||
|
result = JudgeStatus.COMPILE_ERROR
|
||||||
|
statisticInfo = {
|
||||||
|
err_info: shiftCompileLines(errInfo, template ? template.prepend.split("\n").length : 0),
|
||||||
|
score: 0,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.warn(`[judge] 判题机报错 ${row.submission.id}: ${response.err} ${errInfo}`)
|
||||||
|
result = JudgeStatus.SYSTEM_ERROR
|
||||||
|
statisticInfo = { err_info: errInfo, score: 0 }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!Array.isArray(response.data)) {
|
if (!Array.isArray(response.data)) {
|
||||||
|
|||||||
@@ -146,6 +146,10 @@ const msg = computed(() => {
|
|||||||
"程序占的内存太多了。通常是列表、数组开得太大,或者在循环里不停地往里加东西、停不下来。\n\n"
|
"程序占的内存太多了。通常是列表、数组开得太大,或者在循环里不停地往里加东西、停不下来。\n\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 判题机的原文是英文(多半是「Test case not found」,题目缺测试数据),学生看了只会以为自己错了
|
||||||
|
if (result === SubmissionStatus.system_error)
|
||||||
|
return "判题出了问题,不是你的代码写错了。告诉老师看一下这道题。"
|
||||||
|
|
||||||
if (result !== SubmissionStatus.ast_check_failed && props.submission.statisticInfo?.err_info) {
|
if (result !== SubmissionStatus.ast_check_failed && props.submission.statisticInfo?.err_info) {
|
||||||
msg += stripJudgePath(props.submission.statisticInfo.err_info)
|
msg += stripJudgePath(props.submission.statisticInfo.err_info)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user