diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 61b9fd7a4..7c6ea5380 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.15.3", + "version": "2.15.4", "main": "package.json", "author": "undefined ", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/judge/default.ts b/packages/hydrojudge/src/judge/default.ts index 0937d2137..8a7655896 100644 --- a/packages/hydrojudge/src/judge/default.ts +++ b/packages/hydrojudge/src/judge/default.ts @@ -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); }); } diff --git a/packages/hydrojudge/src/judge/run.ts b/packages/hydrojudge/src/judge/run.ts index 628ced224..4de66244a 100644 --- a/packages/hydrojudge/src/judge/run.ts +++ b/packages/hydrojudge/src/judge/run.ts @@ -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); }); }