mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge&ui: support show single subtask score (#529)
This commit is contained in:
1 parent
8b2a9f0847
commit
69e7f9d107
3 files changed
+8
-6
No files matched your search
@@ -64,6 +64,7 @@ function judgeSubtask(subtask: NormalizedSubtask, sid: string, judgeCase: Task['
|
|||||||
}
|
}
|
||||||
ctx.total_status = Math.max(ctx.total_status, ctxSubtask.status);
|
ctx.total_status = Math.max(ctx.total_status, ctxSubtask.status);
|
||||||
return {
|
return {
|
||||||
|
type: ctxSubtask.subtask.type,
|
||||||
score: ctxSubtask.score,
|
score: ctxSubtask.score,
|
||||||
status: ctxSubtask.status,
|
status: ctxSubtask.status,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -549,6 +549,7 @@ export interface JudgeMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface SubtaskResult {
|
export interface SubtaskResult {
|
||||||
|
type: SubtaskType;
|
||||||
score: number;
|
score: number;
|
||||||
status: number;
|
status: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if rdoc.testCases.length %}
|
{% if rdoc.testCases.length %}
|
||||||
{% set _key = 'id' if rdoc.testCases|groupby('subtaskId')|length == 1 else 'subtaskId' %}
|
|
||||||
<div class="section__body no-padding">
|
<div class="section__body no-padding">
|
||||||
<table class="data-table record_detail__table">
|
<table class="data-table record_detail__table">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
@@ -33,7 +32,7 @@
|
|||||||
<th class="col--case record-status--border">#</th>
|
<th class="col--case record-status--border">#</th>
|
||||||
<th class="col--status">
|
<th class="col--status">
|
||||||
{{ _('Status') }}
|
{{ _('Status') }}
|
||||||
{% if rdoc.subtasks and _key != 'id' %}
|
{% if rdoc.subtasks and (rdoc.subtasks|length > 1 or rdoc.subtasks[Object.keys(rdoc.subtasks)[0]].type == 'sum') %}
|
||||||
<span class="float-right">{{ _('Score') }}</span>
|
<span class="float-right">{{ _('Score') }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</th>
|
</th>
|
||||||
@@ -42,6 +41,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
{% set _key = 'id' if rdoc.testCases|groupby('subtaskId')|length == 1 else 'subtaskId' %}
|
||||||
{%- for subtaskId, rcdocs in rdoc.testCases|sort(false,false,_key)|groupby(_key) -%}
|
{%- for subtaskId, rcdocs in rdoc.testCases|sort(false,false,_key)|groupby(_key) -%}
|
||||||
{% if rcdocs.length > 1 %}
|
{% if rcdocs.length > 1 %}
|
||||||
<tr class="subtask">
|
<tr class="subtask">
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
<td class="col--status">
|
<td class="col--status">
|
||||||
<span class="icon record-status--icon {{ model.builtin.STATUS_CODES[rdoc.subtasks[subtaskId]['status']] }}"></span>
|
<span class="icon record-status--icon {{ model.builtin.STATUS_CODES[rdoc.subtasks[subtaskId]['status']] }}"></span>
|
||||||
<span class="record-status--text {{ model.builtin.STATUS_CODES[rdoc.subtasks[subtaskId]['status']] }}">
|
<span class="record-status--text {{ model.builtin.STATUS_CODES[rdoc.subtasks[subtaskId]['status']] }}">
|
||||||
{{ model.builtin.STATUS_TEXTS[rcdocs[0]['status']] }}
|
{{ model.builtin.STATUS_TEXTS[rdoc.subtasks[subtaskId]['status']] }}
|
||||||
</span>
|
</span>
|
||||||
<span class="float-right record-status--text {{ model.builtin.STATUS_CODES[rdoc.subtasks[subtaskId]['status']] }}">{{ rdoc.subtasks[subtaskId]['score']|default(0) }}</span>
|
<span class="float-right record-status--text {{ model.builtin.STATUS_CODES[rdoc.subtasks[subtaskId]['status']] }}">{{ rdoc.subtasks[subtaskId]['score']|default(0) }}</span>
|
||||||
</td>
|
</td>
|
||||||
@@ -71,9 +71,9 @@
|
|||||||
<span class="record-status--text {{ model.builtin.STATUS_CODES[rcdoc['status']] }}">
|
<span class="record-status--text {{ model.builtin.STATUS_CODES[rcdoc['status']] }}">
|
||||||
{{ model.builtin.STATUS_TEXTS[rcdoc['status']] }}
|
{{ model.builtin.STATUS_TEXTS[rcdoc['status']] }}
|
||||||
</span>
|
</span>
|
||||||
{% if rcdocs.length == 1 and _key != 'id' %}
|
{% if (_key != 'id' and rcdocs.length == 1) or (_key == 'id' and rdoc.subtasks[rcdoc.subtaskId].type == 'sum') %}
|
||||||
<span class="float-right record-status--text {{ model.builtin.STATUS_CODES[rdoc.subtasks[subtaskId]['status']] }}">
|
<span class="float-right record-status--text {{ model.builtin.STATUS_CODES[rdoc.subtasks[subtaskId]['status'] if _key != 'id' else rcdoc.status] }}">
|
||||||
{{ rdoc.subtasks[subtaskId]['score']|default(0) }}
|
{{ (rdoc.subtasks[subtaskId]['score'] if _key != 'id' else rcdoc.score)|default(0) }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span>{{ formatJudgeTexts([rcdoc.message]) if rcdoc.message else '' }}</span>
|
<span>{{ formatJudgeTexts([rcdoc.message]) if rcdoc.message else '' }}</span>
|
||||||
|
|||||||
Reference in new issue
Block a user