core: 比赛题目页面添加scratchpad

This commit is contained in:
undefined committed 2020-12-10 01:09:52 +08:00
1 parent 5dd5dca675
commit 16613a6970
3 files changed
+6 -4

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "2.14.5", "version": "2.14.6",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "dist/loader.js", "main": "dist/loader.js",
"typings": "dist/loader.d.ts", "typings": "dist/loader.d.ts",
+4 -3
View File
@@ -271,11 +271,12 @@ class ContestProblemHandler extends ContestHandler {
udoc: this.udoc, udoc: this.udoc,
attended: this.attended, attended: this.attended,
path, path,
page_name: 'contest_detail_problem',
}; };
} }
} }
class ContestProblemSubmitHandler extends ContestProblemHandler { class ContestDetailProblemSubmitHandler extends ContestProblemHandler {
@param('tid', Types.ObjectID) @param('tid', Types.ObjectID)
@param('pid', Types.UnsignedInt) @param('pid', Types.UnsignedInt)
async prepare(domainId: string, tid: ObjectID, pid: number) { async prepare(domainId: string, tid: ObjectID, pid: number) {
@@ -298,11 +299,11 @@ class ContestProblemSubmitHandler extends ContestProblemHandler {
this.response.body = { this.response.body = {
tdoc: this.tdoc, tdoc: this.tdoc,
pdoc: this.pdoc, pdoc: this.pdoc,
tsdoc: this.tsdoc,
udoc: this.udoc, udoc: this.udoc,
attended: this.attend, attended: this.attend,
path, path,
rdocs, rdocs,
page_name: 'contest_detail_problem_submit',
}; };
} }
@@ -424,7 +425,7 @@ export async function apply() {
Route('contest_scoreboard_raw', '/contest/:tid/scoreboard/raw', ContestScoreboardRawHandler, PERM.PERM_VIEW_CONTEST); Route('contest_scoreboard_raw', '/contest/:tid/scoreboard/raw', ContestScoreboardRawHandler, PERM.PERM_VIEW_CONTEST);
Route('contest_scoreboard_download', '/contest/:tid/export/:ext', ContestScoreboardDownloadHandler, PERM.PERM_VIEW_CONTEST); Route('contest_scoreboard_download', '/contest/:tid/export/:ext', ContestScoreboardDownloadHandler, PERM.PERM_VIEW_CONTEST);
Route('contest_detail_problem', '/contest/:tid/p/:pid', ContestProblemHandler, PERM.PERM_VIEW_CONTEST); Route('contest_detail_problem', '/contest/:tid/p/:pid', ContestProblemHandler, PERM.PERM_VIEW_CONTEST);
Route('contest_detail_problem_submit', '/contest/:tid/p/:pid/submit', ContestProblemSubmitHandler, PERM.PERM_VIEW_CONTEST); Route('contest_detail_problem_submit', '/contest/:tid/p/:pid/submit', ContestDetailProblemSubmitHandler, PERM.PERM_VIEW_CONTEST);
Route('contest_code', '/contest/:tid/code', ContestCodeHandler, PERM.PERM_VIEW_CONTEST); Route('contest_code', '/contest/:tid/code', ContestCodeHandler, PERM.PERM_VIEW_CONTEST);
} }
+1
View File
@@ -509,6 +509,7 @@ export const ContestHandlerMixin = (c) => class extends c {
async getRawStatus(domainId: string, tid: ObjectID, docType: 30 | 60 = document.TYPE_CONTEST) { async getRawStatus(domainId: string, tid: ObjectID, docType: 30 | 60 = document.TYPE_CONTEST) {
const tdoc = await get(domainId, tid, docType); const tdoc = await get(domainId, tid, docType);
if (!this.canShowScoreboard(tdoc)) throw new ContestScoreboardHiddenError(tid); if (!this.canShowScoreboard(tdoc)) throw new ContestScoreboardHiddenError(tid);
if (!this.canShowRecord(tdoc)) throw new ContestScoreboardHiddenError(tid);
const tsdocs = await getMultiStatus(domainId, { docId: tid }, docType).sort(RULES[tdoc.rule].statusSort).toArray(); const tsdocs = await getMultiStatus(domainId, { docId: tid }, docType).sort(RULES[tdoc.rule].statusSort).toArray();
const uids = tsdocs.map((tsdoc) => tsdoc.uid); const uids = tsdocs.map((tsdoc) => tsdoc.uid);
const [udict, pdict] = await Promise.all([ const [udict, pdict] = await Promise.all([