mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: contest: oi: fix effective check
This commit is contained in:
1 parent
913658d144
commit
1acd2ff0bb
2 files changed
+3
-5
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.4.7",
|
"version": "3.4.8",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ const oi = buildContestRule({
|
|||||||
const detail = {};
|
const detail = {};
|
||||||
let score = 0;
|
let score = 0;
|
||||||
for (const j of journal.filter((i) => tdoc.pids.includes(i.pid))) {
|
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;
|
for (const i in detail) score += detail[i].score;
|
||||||
return { score, detail };
|
return { score, detail };
|
||||||
@@ -311,9 +311,7 @@ const homework = buildContestRule({
|
|||||||
stat: (tdoc, journal) => {
|
stat: (tdoc, journal) => {
|
||||||
const effective = {};
|
const effective = {};
|
||||||
for (const j of journal) {
|
for (const j of journal) {
|
||||||
if (tdoc.pids.includes(j.pid)) {
|
if (tdoc.pids.includes(j.pid)) effective[j.pid] = j;
|
||||||
effective[j.pid] = j;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
function time(jdoc) {
|
function time(jdoc) {
|
||||||
const real = jdoc.rid.generationTime - tdoc.beginAt.getTime() / 1000;
|
const real = jdoc.rid.generationTime - tdoc.beginAt.getTime() / 1000;
|
||||||
|
|||||||
Reference in new issue
Block a user