core: fix submit_answer

This commit is contained in:
undefined committed 2023-02-03 19:37:58 +08:00
1 parent 66dff28330
commit 726d684ef2
1 file changed
+1 -1
+1 -1
View File
@@ -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();