优化rating计算速度

This commit is contained in:
masnn committed 2020-06-09 13:22:04 +08:00
1 parent 45f1184d68
commit 55912b087d
22 files changed
+309 -178

No files matched your search

+2 -2
View File
@@ -197,7 +197,7 @@ class HomeworkCreateHandler extends HomeworkHandler {
async post({
domainId, title, content, beginAtDate, beginAtTime,
penaltySinceDate, penaltySinceTime, extensionDays,
penaltyRules, pids,
penaltyRules, pids, rated = false,
}) {
let beginAt;
let penaltySince;
@@ -216,7 +216,7 @@ class HomeworkCreateHandler extends HomeworkHandler {
if (penaltySince > endAt) throw new ValidationError('extensionDays');
await this.verifyProblems(domainId, pids);
const tid = await contest.add(domainId, title, content, this.user._id,
'homework', beginAt, endAt, pids, { penaltySince, penaltyRules }, document.TYPE_HOMEWORK);
'homework', beginAt, endAt, pids, rated, { penaltySince, penaltyRules }, document.TYPE_HOMEWORK);
this.response.body = { tid };
this.response.redirect = `/homework/${tid}`;
}