ui: add submission language not available warning

pull/588/head
undefined 1 year ago
parent baac092cd8
commit e88220c424
No known key found for this signature in database

@ -340,7 +340,8 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler {
let baseLangs; let baseLangs;
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 = [p, ...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);
baseLangs = dl; baseLangs = dl;
} else { } else {
baseLangs = Object.keys(setting.langs).filter((i) => !setting.langs[i].remote); baseLangs = Object.keys(setting.langs).filter((i) => !setting.langs[i].remote);
@ -478,6 +479,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
async prepare(domainId: string, tid?: ObjectId) { async prepare(domainId: string, tid?: ObjectId) {
if (tid && !contest.isOngoing(this.tdoc, this.tsdoc)) throw new ContestNotLiveError(this.tdoc.docId); if (tid && !contest.isOngoing(this.tdoc, this.tsdoc)) throw new ContestNotLiveError(this.tdoc.docId);
if (typeof this.pdoc.config === 'string') throw new ProblemConfigError(); if (typeof this.pdoc.config === 'string') throw new ProblemConfigError();
if (this.pdoc.config.langs && !this.pdoc.config.langs.length) throw new ProblemConfigError();
} }
async get() { async get() {

@ -560,6 +560,7 @@ No Permission to Create a Discussion: 您没有权限创建讨论
No Permission to Submit: 您没有权限递交 No Permission to Submit: 您没有权限递交
No problem.: 没有题目。 No problem.: 没有题目。
No solutions so far...: 目前还没有题解... No solutions so far...: 目前还没有题解...
No submission language available for this problem.: 本题没有可用的提交语言。
No Submissions: 没有递交 No Submissions: 没有递交
No target available: 无可用目标 No target available: 无可用目标
No testcase here: 此处没有测试点 No testcase here: 此处没有测试点
@ -577,9 +578,9 @@ objective: 客观题
Oh, the user doesn't have any contributions!: 啊哦,这个用户还没贡献过题目~ Oh, the user doesn't have any contributions!: 啊哦,这个用户还没贡献过题目~
Oh, the user hasn't created any discussions yet!: 这个用户还没有发布过讨论 Oh, the user hasn't created any discussions yet!: 这个用户还没有发布过讨论
Oh, the user hasn't submitted yet!: 这个用户还没有交过题 _(:зゝ∠)_ Oh, the user hasn't submitted yet!: 这个用户还没有交过题 _(:зゝ∠)_
Oh, there are no tasks that match the filter!: 喔,目前没有符合过滤条件的任务。
Oh, there is no submission!: 喔,还没有评测记录呢! Oh, there is no submission!: 喔,还没有评测记录呢!
Oh, there is no task in the queue!: 喔,队列中目前没有任务。 Oh, there is no task in the queue!: 喔,队列中目前没有任务。
Oh, there are no tasks that match the filter!: 喔,目前没有符合过滤条件的任务。
Ok: 确定 Ok: 确定
Only A-Z, a-z, 0-9 and _ are accepted: 只接受 A-Z, a-z, 0-9 和 _ Only A-Z, a-z, 0-9 and _ are accepted: 只接受 A-Z, a-z, 0-9 和 _
Oops, there are no results.: 呀,没有结果。 Oops, there are no results.: 呀,没有结果。

@ -9,6 +9,11 @@
<p>{{ pdoc.config }}</p> <p>{{ pdoc.config }}</p>
</blockquote> </blockquote>
{% endif %} {% endif %}
{% if pdoc.config.langs and not pdoc.config.langs|length %}
<blockquote class="warn">
<p>{{ _('No submission language available for this problem.') }}</p>
</blockquote>
{% endif %}
{% if tdoc and tdoc.docType == model.document.TYPE_CONTEST and model.contest.isDone(tdoc) %} {% if tdoc and tdoc.docType == model.document.TYPE_CONTEST and model.contest.isDone(tdoc) %}
<blockquote class="note"> <blockquote class="note">
<p>{{ _('You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.') }}</p> <p>{{ _('You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.') }}</p>

Loading…
Cancel
Save