mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
core&ui: contest correction mode
This commit is contained in:
10 files changed
+56
-16
No files matched your search
@@ -5,6 +5,7 @@
|
||||
{% block content %}
|
||||
{{ set(UiContext, 'tdoc', tdoc) }}
|
||||
{{ set(UiContext, 'tsdoc', tsdoc) }}
|
||||
{% set hasCorrection = correction and Object.keys(correction).length %}
|
||||
<div class="row" data-sticky-parent>
|
||||
<div class="medium-9 columns">
|
||||
<div class="section">
|
||||
@@ -27,7 +28,11 @@
|
||||
<tr>
|
||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<th class="col--status record-status--border">{{ _('Status') }}</th>
|
||||
<th class="col--submit-at">{{ _('Last Submit At') }}</th>
|
||||
{% if hasCorrection %}
|
||||
<th class="col--correction">{{ _('Correction') }}</th>
|
||||
{% else %}
|
||||
<th class="col--submit-at">{{ _('Last Submit At') }}</th>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if showScore %}
|
||||
<th class="col--score">{{ _('Score') }}</th>
|
||||
@@ -47,10 +52,21 @@
|
||||
{% else %}
|
||||
<td class="col--status record-status--border"><a href="{{ url('record_detail', rid=rdoc._id) }}">{{ _('Submitted') }}</a></td>
|
||||
{% endif %}
|
||||
<td class="col--submit-at">{{ datetimeSpan(rdoc._id)|safe }}</td>
|
||||
{% if not hasCorrection %}
|
||||
<td class="col--submit-at">{{ datetimeSpan(rdoc._id)|safe }}</td>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<td class="col--status record-status--border">{{ _('No Submissions') }}</td>
|
||||
<td class="col--submit-at">-</td>
|
||||
{% if not hasCorrection %}
|
||||
<td class="col--submit-at">-</td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if hasCorrection %}
|
||||
{% if correction[pid] %}
|
||||
{{ record.render_status_td(rdict[correction[pid].rid], class="col--correction") }}
|
||||
{% else %}
|
||||
<td class="col--correction">-</td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if showScore %}
|
||||
|
||||
@@ -14,10 +14,16 @@
|
||||
<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 %}
|
||||
{% if mode == 'view' %}
|
||||
<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>
|
||||
</blockquote>
|
||||
{% elif mode == 'correction' %}
|
||||
<blockquote class="note">
|
||||
<p>{{ _('The contest is ended. New submissions will be treated as correction submissions and will not be counted in the contest.') }}</p>
|
||||
</blockquote>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not renderredContent %}
|
||||
{% set preferredLang = handler.request.query.lang or handler.user.viewLang or handler.session.viewLang %}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{% endif %}
|
||||
<div>
|
||||
<ol class="menu">
|
||||
{% if model.contest.isOngoing(tdoc, tsdoc) %}
|
||||
{% if mode == 'contest' or mode == 'correction' %}
|
||||
{% if page_name == 'contest_detail_problem' %}
|
||||
<li class="menu__item scratchpad--hide nojs--hide"><a class="menu__link highlight" name="problem-sidebar__open-scratchpad" href="javascript:;" data-global-hotkey="alt+e">
|
||||
<span class="icon icon-enlarge"></span> {{ _('Open Scratchpad') }} (Alt+E)
|
||||
@@ -20,10 +20,11 @@
|
||||
<span class="icon icon-flag"></span> {{ _('View Problem') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link{% if page_name == 'contest_detail_problem_submit' %} active{% endif %}" href="{{ url('problem_submit', pid=pdoc.pid|default(pdoc.docId), query={tid:tdoc.docId}) }}">
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link{% if page_name == 'contest_detail_problem_submit' %} active{% endif %}" href="{{ url('problem_submit', pid=pdoc.pid|default(pdoc.docId), query={tid:tdoc.docId} if mode=='contest' else {}) }}">
|
||||
<span class="icon icon-send"></span> {{ _('Submit') }}
|
||||
</a></li>
|
||||
{% elif model.contest.isDone(tdoc) %}
|
||||
{% endif %}
|
||||
{% if mode != 'none' and model.contest.isDone(tdoc) %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('problem_detail', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-send"></span> {{ _('Open in Problem Set') }}
|
||||
</a></li>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<li class="menu__seperator"></li>
|
||||
{% endif %}
|
||||
{% if page_name == 'problem_detail' %}
|
||||
{% if handler.user.hasPerm(perm.PERM_SUBMIT_PROBLEM) %}
|
||||
{% if handler.user.hasPerm(perm.PERM_SUBMIT_PROBLEM) and handler.ctx.setting.get('ui-default.enableScratchpad') %}
|
||||
<li class="menu__item scratchpad--hide nojs--hide"><a class="menu__link highlight" name="problem-sidebar__open-scratchpad" href="javascript:;" data-global-hotkey="alt+e">
|
||||
<span class="icon icon-enlarge"></span> {{ _('Open Scratchpad') }} (Alt+E)
|
||||
</a></li>
|
||||
|
||||
@@ -9,13 +9,15 @@
|
||||
pdoc: pdoc
|
||||
}) }}
|
||||
{% if tdoc %}
|
||||
{{ set(UiContext, 'tdoc', tdoc) }}
|
||||
{{ set(UiContext, 'tsdoc', tsdoc) }}
|
||||
{% endif %}
|
||||
{% if tdoc and mode == 'contest' %}
|
||||
{{ set(UiContext, 'canViewRecord', model.contest.canShowSelfRecord.call(handler, tdoc)) }}
|
||||
{{ set(UiContext, 'postSubmitUrl', url('problem_submit', pid=pdoc.docId, query={tid:tdoc.docId})) }}
|
||||
{{ set(UiContext, 'getSubmissionsUrl', url('record_main', query={fullStatus:'true', pid:pdoc.docId, tid:tdoc.docId})) }}
|
||||
{{ set(UiContext, 'getRecordDetailUrl', url('record_detail', rid='{rid}', query={tid:tdoc.docId})) }}
|
||||
{{ set(UiContext, 'pretestConnUrl', "record-conn?pretest=1&uidOrName=" + handler.user._id + "&pid=" + pdoc.docId + "&domainId=" + handler.args.domainId + "&tid=" + tdoc.docId) }}
|
||||
{{ set(UiContext, 'tdoc', tdoc) }}
|
||||
{{ set(UiContext, 'tsdoc', tsdoc) }}
|
||||
{% else %}
|
||||
{{ set(UiContext, 'canViewRecord', true) }}
|
||||
{{ set(UiContext, 'postSubmitUrl', url('problem_submit', pid=pdoc.docId)) }}
|
||||
|
||||
Reference in new issue
Block a user