mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: 优化AC量计算
- 比赛中不计入nAccept - script.problemStat添加用户AC量统计
This commit is contained in:
1 parent
0ceb095314
commit
fa1392fa4b
4 files changed
+56
-13
No files matched your search
@@ -19,6 +19,10 @@ async function _postJudge(rdoc: Rdoc) {
|
||||
if (typeof rdoc.input === 'string') return;
|
||||
const accept = rdoc.status === builtin.STATUS.STATUS_ACCEPTED;
|
||||
const tasks = [];
|
||||
tasks.push(
|
||||
problem.inc(rdoc.domainId, rdoc.pid, 'nAccept', 1),
|
||||
problem.updateStatus(rdoc.domainId, rdoc.pid, rdoc.uid, rdoc._id, rdoc.status),
|
||||
);
|
||||
if (rdoc.contest) {
|
||||
tasks.push(
|
||||
contest.updateStatus(
|
||||
@@ -26,14 +30,8 @@ async function _postJudge(rdoc: Rdoc) {
|
||||
rdoc._id, rdoc.pid, accept, rdoc.score, rdoc.contest.type,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (await problem.updateStatus(rdoc.domainId, rdoc.pid, rdoc.uid, rdoc._id, rdoc.status)) {
|
||||
if (accept && !rdoc.rejudged) {
|
||||
tasks.push(
|
||||
problem.inc(rdoc.domainId, rdoc.pid, 'nAccept', 1),
|
||||
domain.incUserInDomain(rdoc.domainId, rdoc.uid, 'nAccept', 1),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
tasks.push(domain.incUserInDomain(rdoc.domainId, rdoc.uid, 'nAccept', 1));
|
||||
}
|
||||
await Promise.all(tasks);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user