mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: enhance problem_files page
This commit is contained in:
1 parent
1acd2ff0bb
commit
9158550139
5 files changed
+25
-23
No files matched your search
@@ -291,11 +291,14 @@ export class ProblemDetailHandler extends ProblemHandler {
|
||||
this.tdoc = await contest.get(domainId, tid);
|
||||
if (!this.tdoc) throw new ContestNotFoundError(domainId, tid);
|
||||
this.tsdoc = await contest.getStatus(domainId, tid, this.user._id);
|
||||
this.pdoc.tag.length = 0;
|
||||
const showAccept = contest.canShowScoreboard.call(this, this.tdoc, true);
|
||||
if (!showAccept) this.pdoc.nAccept = 0;
|
||||
if (contest.isNotStarted(this.tdoc)) throw new ContestNotLiveError(tid);
|
||||
if (!contest.isDone(this.tdoc) && !this.tsdoc?.attend) throw new ContestNotAttendedError(tid);
|
||||
this.pdoc.tag.length = 0;
|
||||
if (!contest.canShowScoreboard(this.tdoc) || !contest.isLocked(this.tdoc)) {
|
||||
delete this.pdoc.nAccept;
|
||||
delete this.pdoc.nSubmit;
|
||||
delete this.pdoc.stats;
|
||||
}
|
||||
} else if (!problem.canViewBy(this.pdoc, this.user)) {
|
||||
throw new PermissionError(PERM.PERM_VIEW_PROBLEM_HIDDEN);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user