core: contest: oi: fix effective check

This commit is contained in:
undefined committed 2022-02-08 17:36:18 +08:00
1 parent 913658d144
commit 1acd2ff0bb
2 files changed
+3 -5

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.4.7",
"version": "3.4.8",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+2 -4
View File
@@ -193,7 +193,7 @@ const oi = buildContestRule({
const detail = {};
let score = 0;
for (const j of journal.filter((i) => tdoc.pids.includes(i.pid))) {
if (detail[j.pid]?.status === STATUS.STATUS_ACCEPTED && !this.submitAfterAccept) detail[j.pid] = j;
if (detail[j.pid]?.status !== STATUS.STATUS_ACCEPTED || !this.submitAfterAccept) detail[j.pid] = j;
}
for (const i in detail) score += detail[i].score;
return { score, detail };
@@ -311,9 +311,7 @@ const homework = buildContestRule({
stat: (tdoc, journal) => {
const effective = {};
for (const j of journal) {
if (tdoc.pids.includes(j.pid)) {
effective[j.pid] = j;
}
if (tdoc.pids.includes(j.pid)) effective[j.pid] = j;
}
function time(jdoc) {
const real = jdoc.rid.generationTime - tdoc.beginAt.getTime() / 1000;