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",
"bin": "bin/hydrojudge.js",
"version": "2.6.5",
"version": "2.6.6",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"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 score = 0;
let message = '';
if (output.startsWith('ok ')) status = STATUS.STATUS_ACCEPTED;
else if (output.startsWith('wrong answer ')) {
message = output.split('wrong answer ')[1] || '';
if (output.startsWith('ok ')) {
status = STATUS.STATUS_ACCEPTED;
score = fullscore;
} else if (output.startsWith('wrong answer ')) {
message = output.split('wrong answer ')[1] || '';
} else if (output.startsWith('wrong output format ')) {
message = `PE ${output.split('wrong output format ')[1] || ''}`;
} else if (output.startsWith('unexpected eof ')) {