mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix problem hidden langs (#928)
This commit is contained in:
1 parent
3f08ade378
commit
ccbaecae8a
1 file changed
+7
-5
@@ -302,18 +302,20 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler {
|
|||||||
}
|
}
|
||||||
if (typeof this.pdoc.config !== 'string') {
|
if (typeof this.pdoc.config !== 'string') {
|
||||||
let baseLangs;
|
let baseLangs;
|
||||||
|
const t = [];
|
||||||
|
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));
|
||||||
if (this.pdoc.config.type === 'remote_judge') {
|
if (this.pdoc.config.type === 'remote_judge') {
|
||||||
const p = this.pdoc.config.subType;
|
const p = this.pdoc.config.subType;
|
||||||
const dl = Object.keys(setting.langs).filter((i) => i.startsWith(`${p}.`) || setting.langs[i].validAs[p]);
|
const dl = Object.keys(setting.langs).filter((i) => i.startsWith(`${p}.`) || setting.langs[i].validAs[p]);
|
||||||
if (setting.langs[p]) dl.push(p);
|
if (setting.langs[p]) dl.push(p);
|
||||||
baseLangs = dl;
|
baseLangs = dl;
|
||||||
} else {
|
} else {
|
||||||
baseLangs = Object.keys(setting.langs).filter((i) => !setting.langs[i].remote && !setting.langs[i].hidden);
|
const needHiddenLangs = flattenDeep(t).length;
|
||||||
|
baseLangs = Object.keys(setting.langs).filter((i) =>
|
||||||
|
(needHiddenLangs ? !setting.langs[i].remote : !setting.langs[i].remote && !setting.langs[i].hidden));
|
||||||
}
|
}
|
||||||
const t = [];
|
|
||||||
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 = ['objective', 'submit_answer'].includes(this.pdoc.config.type) ? ['_'] : 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);
|
await this.ctx.parallel('problem/get', this.pdoc, this);
|
||||||
|
|||||||
Reference in new issue
Block a user