core: add judge priority system

This commit is contained in:
undefined committed 2021-04-21 22:19:04 +08:00
1 parent c43663a1d1
commit faae0805c1
5 files changed
+20 -8

No files matched your search

+4 -2
View File
@@ -33,8 +33,10 @@ async function _postJudge(rdoc: Rdoc) {
: await problem.get(rdoc.domainId, rdoc.pid);
const difficulty = difficultyAlgorithm(pdoc.nSubmit, pdoc.nAccept);
if (!updated) await record.updateMulti(rdoc.domainId, { uid: rdoc.uid, status: builtin.STATUS.STATUS_ACCEPTED }, { effective: false });
await record.update(rdoc.domainId, rdoc._id, { effective: true });
await problem.edit(pdoc.domainId, pdoc.docId, { difficulty });
await Promise.all([
record.update(rdoc.domainId, rdoc._id, { effective: true }),
problem.edit(pdoc.domainId, pdoc.docId, { difficulty }),
]);
await bus.serial('record/judge', rdoc, updated);
}