core: contest_scoreboard.lock

This commit is contained in:
undefined committed 2022-11-15 16:45:11 +08:00
1 parent 5271a7e590
commit d9fdcc9b7c
5 files changed
+68 -48

No files matched your search

+5 -6
View File
@@ -328,13 +328,12 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler {
if (!this.tdoc?.pids?.includes(this.pdoc.docId)) throw new ContestNotFoundError(domainId, tid);
if (contest.isNotStarted(this.tdoc)) throw new ContestNotLiveError(tid);
if (!contest.isDone(this.tdoc, this.tsdoc) && (!this.tsdoc?.attend || !this.tsdoc.startAt)) throw new ContestNotAttendedError(tid);
// Delete problem-related info in contest mode
this.pdoc.tag.length = 0;
if (!contest.canShowScoreboard.call(this, this.tdoc) || !contest.isLocked(this.tdoc)) {
delete this.pdoc.nAccept;
delete this.pdoc.nSubmit;
delete this.pdoc.difficulty;
delete this.pdoc.stats;
}
delete this.pdoc.nAccept;
delete this.pdoc.nSubmit;
delete this.pdoc.difficulty;
delete this.pdoc.stats;
} else if (!problem.canViewBy(this.pdoc, this.user)) {
throw new PermissionError(PERM.PERM_VIEW_PROBLEM_HIDDEN);
}