core: fix naccept on error (#565)

pull/562/head
panda 1 year ago committed by GitHub
parent facbd7fc55
commit 67f0d1d596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -66,14 +66,14 @@ const acm = buildContestRule({
const lockAt = isLocked(tdoc) ? tdoc.lockAt : null; const lockAt = isLocked(tdoc) ? tdoc.lockAt : null;
for (const j of journal) { for (const j of journal) {
if (!this.submitAfterAccept && display[j.pid]?.status === STATUS.STATUS_ACCEPTED) continue; if (!this.submitAfterAccept && display[j.pid]?.status === STATUS.STATUS_ACCEPTED) continue;
if (![STATUS.STATUS_ACCEPTED, STATUS.STATUS_COMPILE_ERROR, STATUS.STATUS_FORMAT_ERROR].includes(j.status)) {
naccept[j.pid]++;
}
const real = Math.floor((j.rid.getTimestamp().getTime() - tdoc.beginAt.getTime()) / 1000); const real = Math.floor((j.rid.getTimestamp().getTime() - tdoc.beginAt.getTime()) / 1000);
const penalty = 20 * 60 * naccept[j.pid]; const penalty = 20 * 60 * naccept[j.pid];
detail[j.pid] = { detail[j.pid] = {
...j, naccept: naccept[j.pid], time: real + penalty, real, penalty, ...j, naccept: naccept[j.pid], time: real + penalty, real, penalty,
}; };
if (![STATUS.STATUS_ACCEPTED, STATUS.STATUS_COMPILE_ERROR, STATUS.STATUS_FORMAT_ERROR].includes(j.status)) {
naccept[j.pid]++;
}
if (lockAt && j.rid.getTimestamp() > lockAt) { if (lockAt && j.rid.getTimestamp() > lockAt) {
npending[j.pid]++; npending[j.pid]++;
// FIXME this is tricky // FIXME this is tricky

Loading…
Cancel
Save