diff --git a/src/daemon/judge/judger-base.ts b/src/daemon/judge/judger-base.ts index 1f6c25b..ec94bde 100644 --- a/src/daemon/judge/judger-base.ts +++ b/src/daemon/judge/judger-base.ts @@ -71,7 +71,7 @@ export abstract class JudgerBase { currentTaskResult.errorMessage = err.toString(); winston.warn(`Task runner error: ${err.toString()} (subtask ${subtaskIndex}, case ${index})`); } - if (score === 0 || score === NaN) { + if (score == null || isNaN(score) || score === 0) { winston.debug(`Subtask ${subtaskIndex}, case ${index}: zero, skipping the rest.`); skipped = true; } diff --git a/src/runner/judge.ts b/src/runner/judge.ts index 1c2d954..ca2b31c 100644 --- a/src/runner/judge.ts +++ b/src/runner/judge.ts @@ -46,7 +46,7 @@ async function runSpj(spjBinDir: string, spjLanguage: Language): Promise spjFullScore) { + if ((!scoreString) || isNaN(score) || score < 0 || score > spjFullScore) { return { status: TestcaseResultType.JudgementFailed, message: `Special Judge returned an unrecoginzed score: ${scoreString}.`,