重测整题功能

This commit is contained in:
undefined committed 2020-09-08 23:14:26 +08:00
1 parent 7a4d5209b8
commit 76b001305d
6 files changed
+31 -4

No files matched your search

+11
View File
@@ -217,6 +217,17 @@ class ProblemDetailHandler extends ProblemHandler {
}
this.response.redirect = this.url('problem_settings', { domainId: destDomainId, pid });
}
@param('pid', Types.UnsignedInt)
async postRejudge(domainId: string, pid: number) {
this.checkPerm(PERM.PERM_REJUDGE_PROBLEM);
// TODO maybe async?
await record.getMulti(domainId, { pid }).forEach(async (doc) => {
await record.reset(domainId, doc._id, true);
await record.judge(domainId, doc._id);
});
this.back();
}
}
class ProblemSubmitHandler extends ProblemDetailHandler {