mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: 更改nSubmit, nAccept计算逻辑 (#76)
This commit is contained in:
1 parent
4e846a906e
commit
775605f812
15 files changed
+122
-62
No files matched your search
@@ -32,6 +32,8 @@ async function _postJudge(rdoc: Rdoc) {
|
||||
? await problem.inc(rdoc.domainId, rdoc.pid, 'nAccept', 1)
|
||||
: 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 bus.serial('record/judge', rdoc, updated);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user