mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 09:38:19 +08:00
core: 比赛题目页面添加scratchpad
This commit is contained in:
1 parent
5dd5dca675
commit
16613a6970
3 files changed
+6
-4
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.14.5",
|
||||
"version": "2.14.6",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -271,11 +271,12 @@ class ContestProblemHandler extends ContestHandler {
|
||||
udoc: this.udoc,
|
||||
attended: this.attended,
|
||||
path,
|
||||
page_name: 'contest_detail_problem',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class ContestProblemSubmitHandler extends ContestProblemHandler {
|
||||
class ContestDetailProblemSubmitHandler extends ContestProblemHandler {
|
||||
@param('tid', Types.ObjectID)
|
||||
@param('pid', Types.UnsignedInt)
|
||||
async prepare(domainId: string, tid: ObjectID, pid: number) {
|
||||
@@ -298,11 +299,11 @@ class ContestProblemSubmitHandler extends ContestProblemHandler {
|
||||
this.response.body = {
|
||||
tdoc: this.tdoc,
|
||||
pdoc: this.pdoc,
|
||||
tsdoc: this.tsdoc,
|
||||
udoc: this.udoc,
|
||||
attended: this.attend,
|
||||
path,
|
||||
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_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_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);
|
||||
}
|
||||
|
||||
|
||||
@@ -509,6 +509,7 @@ export const ContestHandlerMixin = (c) => class extends c {
|
||||
async getRawStatus(domainId: string, tid: ObjectID, docType: 30 | 60 = document.TYPE_CONTEST) {
|
||||
const tdoc = await get(domainId, tid, docType);
|
||||
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 uids = tsdocs.map((tsdoc) => tsdoc.uid);
|
||||
const [udict, pdict] = await Promise.all([
|
||||
|
||||
Reference in new issue
Block a user