原来答案错误只有四个字。6901 条历史答案错误在公开样例上重跑过:73% 在样例上就错了,
其中约三分之一只差格式(没输出、input() 提示文字、空格换行、中英文标点、小数位数)。
- judge/run.ts 的 checkSamples:判出答案错误后以内联测试点重跑题目样例(output: true),
记下第一个没过的样例和学生在它上面的输出,写进 statistic_info.sample_check;
样例全过则只记 passed。全是公开信息,不碰隐藏测试点;比赛不跑(有期末考试)
- 前端按差异归类(数字先于「多了内容」判,免得 007 被当成多打了文字),
并排显示输入 / 正确输出 / 你的输出,标出第一处不同的行;只差空白时把空格、换行画出来,
末尾空白不画(判题本来就忽略)
- 提示给具体值(「正确输出是 84.10,你输出的是 84.1」),input("…") 单独提示
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
db70ab62e8
commit
7e964fdbdd
6 files changed
+446
-2
No files matched your search
@@ -101,6 +101,26 @@ export const statisticInfoSchema = z.looseObject({
|
||||
exit_code: z.number().int().optional(),
|
||||
})
|
||||
.optional(),
|
||||
/**
|
||||
* 答案错误时拿题目的**公开样例**重跑的结果,judge/run.ts 的 checkSamples 写。
|
||||
* 只在非比赛提交上有。
|
||||
*
|
||||
* 这里的东西全是学生本来就看得到的:样例写在题面上,output 是他自己的程序在
|
||||
* 公开输入上的输出。隐藏测试点的内容一概不碰。三段文本都截断过(见 SAMPLE_TEXT_LIMIT)。
|
||||
*/
|
||||
sample_check: z
|
||||
.object({
|
||||
/** 所有样例都过了(错在隐藏测试点上) */
|
||||
passed: z.boolean(),
|
||||
/** 第一个没过的样例,0 起;passed 为 true 时没有下面这些 */
|
||||
index: z.number().int().optional(),
|
||||
input: z.string().optional(),
|
||||
expected: z.string().optional(),
|
||||
output: z.string().optional(),
|
||||
/** 样例上的判题结果:多数是答案错误,也可能在样例上就超时、运行出错 */
|
||||
result: z.number().int().optional(),
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user