core: fix homework scoreboard display

This commit is contained in:
undefined committed 2022-10-20 15:44:30 +08:00
1 parent c2ad7df336
commit bbbb3cc84a
3 files changed
+10 -6

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "4.2.7",
"version": "4.2.8",
"bin": "bin/hydrooj.js",
"main": "src/plugin-api",
"module": "src/plugin-api",
+3 -5
View File
@@ -375,11 +375,9 @@ const homework = buildContestRule({
}
const detail = [];
for (const j in effective) {
detail.push({
...effective[j],
penaltyScore: penaltyScore(effective[j]),
time: time(effective[j]),
});
effective[j].penaltyScore = penaltyScore(effective[j]);
effective[j].time = time(effective[j]);
detail.push(effective[j]);
}
return {
score: sumBy(detail, 'score'),
+6
View File
@@ -579,6 +579,12 @@ const scripts: UpgradeScript[] = [
});
return true;
},
async function _71_72() {
await iterateAllContest(async (tdoc) => {
if (tdoc.rule === 'homework') await contest.recalcStatus(tdoc.domainId, tdoc.docId);
});
return true;
},
];
export default scripts;