mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix submit_answer
This commit is contained in:
1 parent
66dff28330
commit
726d684ef2
1 file changed
+1
-1
@@ -504,7 +504,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
|
|||||||
async post(domainId: string, lang: string, code: string, pretest = false, input = '', tid?: ObjectID) {
|
async post(domainId: string, lang: string, code: string, pretest = false, input = '', tid?: ObjectID) {
|
||||||
const config = this.pdoc.config;
|
const config = this.pdoc.config;
|
||||||
if (typeof config === 'string' || config === null) throw new ProblemConfigError();
|
if (typeof config === 'string' || config === null) throw new ProblemConfigError();
|
||||||
if (config.type === 'objective') {
|
if (['submit_answer', 'objective'].includes(config.type)) {
|
||||||
lang = '_';
|
lang = '_';
|
||||||
} else if ((config.langs && !config.langs.includes(lang)) || !setting.langs[lang] || setting.langs[lang].disabled) {
|
} else if ((config.langs && !config.langs.includes(lang)) || !setting.langs[lang] || setting.langs[lang].disabled) {
|
||||||
throw new ProblemNotAllowLanguageError();
|
throw new ProblemNotAllowLanguageError();
|
||||||
|
|||||||
Reference in new issue
Block a user