core: fix stats handle for non-integer score

This commit is contained in:
undefined committed 2022-09-14 21:56:03 +08:00
1 parent 7b112817c6
commit a648d51969
4 files changed
+13 -4

No files matched your search

+1 -1
View File
@@ -78,7 +78,7 @@ export async function postJudge(rdoc: RecordDoc) {
if (isNormalSubmission) {
await Promise.all([
problem.inc(pdoc.domainId, pdoc.docId, `stats.${builtin.STATUS_SHORT_TEXTS[rdoc.status]}`, 1),
problem.inc(pdoc.domainId, pdoc.docId, `stats.s${rdoc.score}`, 1),
problem.inc(pdoc.domainId, pdoc.docId, `stats.s${Math.floor(rdoc.score)}`, 1),
]);
}
if (rdoc.status === STATUS.STATUS_HACK_SUCCESSFUL) {