mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
judge: fix objective
This commit is contained in:
1 parent
660fa1a957
commit
7a164483ba
1 file changed
+2
-2
@@ -51,7 +51,7 @@ export async function judge({
|
||||
},
|
||||
});
|
||||
};
|
||||
const usrAns = answers[key].toString();
|
||||
const usrAns = (answers[key]?.toString() || '').trim();
|
||||
if (ansInfo instanceof Array) {
|
||||
const fullScore = (+ansInfo[1]) || 0;
|
||||
const stdAns = ansInfo[0];
|
||||
@@ -60,7 +60,7 @@ export async function judge({
|
||||
if (stdAns.length === ans.size && Set.isSuperset(ans, stdAns)) report(STATUS.STATUS_ACCEPTED, fullScore, 'Correct');
|
||||
else if (ans.size && Set.isSuperset(ans, stdAns)) report(STATUS.STATUS_WRONG_ANSWER, Math.floor(fullScore / 2), 'Partially Correct');
|
||||
else report(STATUS.STATUS_WRONG_ANSWER, 0, 'Incorrect');
|
||||
} else if (stdAns.toString() === usrAns.trim()) report(STATUS.STATUS_ACCEPTED, fullScore, 'Correct ');
|
||||
} else if (stdAns.toString() === usrAns) report(STATUS.STATUS_ACCEPTED, fullScore, 'Correct');
|
||||
else report(STATUS.STATUS_WRONG_ANSWER, 0, 'Incorrect');
|
||||
} else if (!ansInfo[usrAns]) report(STATUS.STATUS_WRONG_ANSWER, 0, 'Incorrect');
|
||||
else report(STATUS.STATUS_ACCEPTED, +ansInfo[usrAns] || 0, 'Correct');
|
||||
|
||||
Reference in new issue
Block a user