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) {
|
||||
const errInfo =
|
||||
typeof response.data === "string" ? response.data : JSON.stringify(response.data)
|
||||
result = JudgeStatus.COMPILE_ERROR
|
||||
statisticInfo = {
|
||||
err_info: shiftCompileLines(errInfo, template ? template.prepend.split("\n").length : 0),
|
||||
score: 0,
|
||||
// 只有 CompileError 是学生的错。别的(JudgeClientError 的「Test case not found」
|
||||
// 这类)是题目或判题机的问题:原来一律记成编译错误,学生看到一句英文、以为自己写错了,
|
||||
// 全库 337 条,最近一条就在 2026-09。
|
||||
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 {
|
||||
if (!Array.isArray(response.data)) {
|
||||
|
||||
Reference in new issue
Block a user