mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: remote judge api
This commit is contained in:
1 parent
939584ec5e
commit
680e3ccd32
11 files changed
+54
-13
No files matched your search
@@ -295,7 +295,8 @@ export class ContestProblemHandler extends Handler {
|
||||
// Navigate to current additional file download
|
||||
// e.g.  will navigate to 
|
||||
this.response.body.pdoc.content = this.response.body.pdoc.content
|
||||
.replace(/\(file:\/\//g, `(./${args[2]}/file/`);
|
||||
.replace(/\(file:\/\//g, `(./${args[2]}/file/`)
|
||||
.replace(/="file:\/\//g, `="./${args[2]}/file/`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,6 +345,9 @@ export class ContestDetailProblemSubmitHandler extends ContestProblemHandler {
|
||||
if (this.response.body.pdoc.config?.langs && !this.response.body.pdoc.config.langs.includes(lang)) {
|
||||
throw new BadRequestError('Language not allowed.');
|
||||
}
|
||||
if (this.domain.langs && !this.domain.langs.includes(lang)) {
|
||||
throw new BadRequestError('Language not allowed');
|
||||
}
|
||||
await this.limitRate('add_record', 60, 10);
|
||||
const rid = await record.add(domainId, pid, this.user._id, lang, code, true, pretest ? input : {
|
||||
type: document.TYPE_CONTEST,
|
||||
|
||||
Reference in new issue
Block a user