mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: add contest ongoing check
This commit is contained in:
1 parent
c07bf9a845
commit
44bc0185be
2 files changed
+6
-2
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.1.38",
|
"version": "3.1.39",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -380,8 +380,12 @@ export class ProblemDetailHandler extends ProblemHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ProblemSubmitHandler extends ProblemDetailHandler {
|
export class ProblemSubmitHandler extends ProblemDetailHandler {
|
||||||
async get(domainId: string, tid?: ObjectID) {
|
@param('tid', Types.ObjectID, true)
|
||||||
|
async prepare(domainId: string, tid?: ObjectID) {
|
||||||
if (tid && !contest.isOngoing(this.tdoc)) throw new ContestNotLiveError(this.tdoc.docId);
|
if (tid && !contest.isOngoing(this.tdoc)) throw new ContestNotLiveError(this.tdoc.docId);
|
||||||
|
}
|
||||||
|
|
||||||
|
async get() {
|
||||||
this.response.template = 'problem_submit.html';
|
this.response.template = 'problem_submit.html';
|
||||||
this.response.body = {
|
this.response.body = {
|
||||||
pdoc: this.pdoc,
|
pdoc: this.pdoc,
|
||||||
|
|||||||
Reference in new issue
Block a user