From 809966fed36672c600431d15006b4c069c3ed84a Mon Sep 17 00:00:00 2001 From: panda Date: Fri, 24 Feb 2023 19:47:14 +0800 Subject: [PATCH] core: force set lang to _ to avoid ask questions (#520) --- packages/hydrooj/src/handler/problem.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index 9329dbf2c..e97b1fd94 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -339,8 +339,6 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler { const p = this.pdoc.config.subType; const dl = [p, ...Object.keys(setting.langs).filter((i) => i.startsWith(`${p}.`))]; baseLangs = dl; - } else if (['objective', 'submit_answer'].includes(this.pdoc.config.type)) { - baseLangs = ['_']; } else { baseLangs = Object.keys(setting.langs).filter((i) => !setting.langs[i].remote); } @@ -348,7 +346,7 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler { if (this.pdoc.config.langs) t.push(this.pdoc.config.langs); if (ddoc.langs) t.push(ddoc.langs.split(',').map((i) => i.trim()).filter((i) => i)); if (this.domain.langs) t.push(this.domain.langs.split(',').map((i) => i.trim()).filter((i) => i)); - this.pdoc.config.langs = intersection(baseLangs, ...t); + this.pdoc.config.langs = ['objective', 'submit_answer'].includes(this.pdoc.config.type) ? ['_'] : intersection(baseLangs, ...t); } await this.ctx.parallel('problem/get', this.pdoc, this); [this.psdoc, this.udoc] = await Promise.all([