judge: fix special judge score

This commit is contained in:
undefined committed 2021-05-19 22:07:36 +08:00
1 parent d87ce5e069
commit b272598685
2 files changed
+5 -4

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@hydrooj/hydrojudge", "name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js", "bin": "bin/hydrojudge.js",
"version": "2.6.5", "version": "2.6.6",
"main": "package.json", "main": "package.json",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git", "repository": "https://github.com/hydro-dev/Hydro.git",
+4 -3
View File
@@ -4,10 +4,11 @@ export function parse(output: string, fullscore: number) {
let status = STATUS.STATUS_WRONG_ANSWER; let status = STATUS.STATUS_WRONG_ANSWER;
let score = 0; let score = 0;
let message = ''; let message = '';
if (output.startsWith('ok ')) status = STATUS.STATUS_ACCEPTED; if (output.startsWith('ok ')) {
else if (output.startsWith('wrong answer ')) { status = STATUS.STATUS_ACCEPTED;
message = output.split('wrong answer ')[1] || '';
score = fullscore; score = fullscore;
} else if (output.startsWith('wrong answer ')) {
message = output.split('wrong answer ')[1] || '';
} else if (output.startsWith('wrong output format ')) { } else if (output.startsWith('wrong output format ')) {
message = `PE ${output.split('wrong output format ')[1] || ''}`; message = `PE ${output.split('wrong output format ')[1] || ''}`;
} else if (output.startsWith('unexpected eof ')) { } else if (output.startsWith('unexpected eof ')) {