mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
judge: output length check
This commit is contained in:
1 parent
ab788b3d79
commit
37a6a0365c
3 files changed
+6
-4
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@hydrooj/hydrojudge",
|
||||
"bin": "bin/hydrojudge.js",
|
||||
"version": "2.15.3",
|
||||
"version": "2.15.4",
|
||||
"main": "package.json",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -91,7 +91,7 @@ function judgeCase(c: Case, sid: string) {
|
||||
await runner(ctx, ctxSubtask);
|
||||
return;
|
||||
}
|
||||
if ([STATUS.STATUS_WRONG_ANSWER, STATUS.STATUS_RUNTIME_ERROR].includes(status) && ctx.config.detail) {
|
||||
if ([STATUS.STATUS_WRONG_ANSWER, STATUS.STATUS_RUNTIME_ERROR].includes(status)) {
|
||||
const langConfig = ctx.getLang(ctx.lang);
|
||||
if (langConfig.analysis && !ctx.analysis) {
|
||||
ctx.analysis = true;
|
||||
@@ -106,7 +106,8 @@ function judgeCase(c: Case, sid: string) {
|
||||
time: 5000,
|
||||
memory: 256,
|
||||
}).then((r) => {
|
||||
ctx.next({ compiler_text: r.stdout.toString().substring(0, 1024) });
|
||||
const out = r.stdout.toString();
|
||||
if (out.length) ctx.next({ compiler_text: out.substring(0, 1024) });
|
||||
if (process.env.DEV) console.log(r);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -99,7 +99,8 @@ export const judge = async (ctx: Context) => {
|
||||
time: 5000,
|
||||
memory: 256,
|
||||
}).then((r) => {
|
||||
ctx.next({ compiler_text: r.stdout.toString().substring(0, 1024) });
|
||||
const out = r.stdout.toString();
|
||||
if (out.length) ctx.next({ compiler_text: out.substring(0, 1024) });
|
||||
if (process.env.DEV) console.log(r);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user