core: 计量尝试人数而非提交量

suggested by @Menci
This commit is contained in:
undefined committed 2021-06-28 19:57:07 +08:00
1 parent e5d715d02b
commit e49ffa9f7b
17 files changed
+102 -138

No files matched your search

@@ -35,16 +35,8 @@
</dd>
<dt>{{ _('# Submissions') }}</dt>
<dd><a href="{{ url('record_main', query={pid:pdoc.docId}) }}">{{ pdoc.nSubmit }}</a></dd>
{% if page_name != 'discussion_node' and page_name != 'discussion_detail' %}
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<dt>{{ _('# My Submissions') }}</dt>
<dd><a href="{{ url('record_main', query={pid:pdoc.docId, uidOrName:handler.user._id}) }}">{{ pdoc['psdoc'].nSubmit|default(0) }}</a></dd>
{% endif %}
{% endif %}
<dt>{{ _('Accepted') }}</dt>
<dd>{{ pdoc.nAccept }}</dd>
<dt>{{ _('Accepted Ratio') }}</dt>
<dd>{% if pdoc.nSubmit > 0 %}{{ (100 * pdoc.nAccept / pdoc.nSubmit)|round|int }}%{% else %}{{ _('?') }}{% endif %}</dd>
<dt>{{ _('Uploaded By') }}</dt>
<dd>{{ user.render_inline(owner_udoc, badge=false) }}</dd>
</dl>
@@ -61,8 +61,8 @@
<td class="col--name col--problem-name">
{{ problem.render_problem_title(pdoc) }}
</td>
<td class="col--submit_n">{{ pdoc['nSubmit'] }}</td>
<td class="col--ac_rate">{{ (100 * pdoc['nAccept'] / pdoc['nSubmit'])|round|int if pdoc['nSubmit'] > 0 else _('?') }}</td>
<td class="col--tried">{{ pdoc.nSubmit }}</td>
<td class="col--ac">{{ pdoc.nAccept }}</td>
<td class="col--difficulty">{{ pdoc['difficulty'] or _('(None)') }}</td>
</tr>
{%- endfor -%}
@@ -44,9 +44,8 @@
<span class="bp3-tag bp3-large bp3-minimal problem__tag-item">{{ _('Time') }}: {{ pdoc.config.timeMax if pdoc.config.timeMax == pdoc.config.timeMin else pdoc.config.timeMin+'~'+pdoc.config.timeMax }}ms</span>
<span class="bp3-tag bp3-large bp3-minimal problem__tag-item">{{ _('Memory') }}: {{ pdoc.config.memoryMax if pdoc.config.memoryMax == pdoc.config.memoryMin else pdoc.config.memoryMin+'~'+pdoc.config.memoryMax }}MiB</span>
{% endif %}
<a class="bp3-tag bp3-large bp3-minimal bp3-interactive problem__tag-item" href="{{ url('record_main', query={pid:pdoc.docId}) }}">{{ _('Submitted') }}: {{ pdoc.nSubmit }}</a>
<a class="bp3-tag bp3-large bp3-minimal bp3-interactive problem__tag-item" href="{{ url('record_main', query={pid:pdoc.docId}) }}">{{ _('Tried') }}: {{ pdoc.nSubmit }}</a>
<a class="bp3-tag bp3-large bp3-minimal bp3-interactive problem__tag-item" href="{{ url('record_main', query={pid:pdoc.docId, status:1}) }}">{{ _('Accepted') }}: {{ pdoc.nAccept }}</a>
<span class="bp3-tag bp3-large bp3-minimal problem__tag-item">{{ _('Accepted Ratio') }}: {% if pdoc.nSubmit > 0 %}{{ (100 * pdoc.nAccept / pdoc.nSubmit)|round|int }}%{% else %}{{ _('?') }}{% endif %}</span>
<span class="bp3-tag bp3-large bp3-minimal problem__tag-item">{{ _('Difficulty') }}: {{ pdoc['difficulty'] or _('(None)') }}</span>
<span class="bp3-tag bp3-large bp3-minimal bp3-interactive problem__tag-item">{{ _('Uploaded By') }}: {{ user.render_inline(udoc, badge=false) }}</span>
{% if pdoc.tag.length %}
@@ -76,82 +76,82 @@
{{ node['content']|markdown|safe }}
</div>
{% endif %}
<div class="section__body no-padding training__problems">
<table class="data-table">
<colgroup>
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<col class="col--status">
{% endif %}
<col class="col--name">
<col class="col--submit_n">
<col class="col--ac_rate">
<col class="col--difficulty">
</colgroup>
<thead>
<tr>
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<th class="col--status record-status--border">{{ _('Status') }}</th>
{% endif %}
<th class="col--name">{{ _('Problem') }}</th>
<th class="col--submit_n">{{ _('Submit') }}</th>
<th class="col--ac_rate">% {{ _('AC') }}</th>
<th class="col--difficulty">{{ _('Difficulty') }}</th>
</tr>
</thead>
<tbody>
{%- for pid in node['pids'] -%}
{% if pid in pdict %}
{% set pdoc=pdict[pid] %}
{% set psdoc=psdict[pid] %}
<tr>
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
{% if psdoc['rid'] %}
{{ record.render_status_td(psdoc, rid_key='rid') }}
{% else %}
<td class="col--status record-status--border"></td>
{% endif %}
{% endif %}
<td class="col--name col--problem-name">
<div class="section__body no-padding training__problems">
<table class="data-table">
<colgroup>
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<form class="form--inline" action="{{ url('problem_main') }}" method="post">
<input type="hidden" name="pid" value="{{ pdoc.docId }}">
<input type="hidden" name="operation" value="{% if not psdoc['star'] %}star{% else %}unstar{% endif %}">
<input type="hidden" name="csrfToken" value="{{ handler.csrfToken }}">
<button class="star{% if psdoc['star'] %} activated{% endif %}" type="submit">
<span class="starred--hide"><span class="icon icon-star--outline" data-tooltip="{{ _('Star') }}"></span></span>
<span class="starred--show"><span class="icon icon-star" data-tooltip="{{ _('Unstar') }}"></span></span>
</button>
</form>
<col class="col--status">
{% endif %}
{{ problem.render_problem_title(
pdoc,
invalid=not tsdoc['enroll'],
show_tags=false
) }}
</td>
<td class="col--submit_n">{{ pdoc.nSubmit }}</td>
<td class="col--ac_rate">{{ (100 * pdoc.nAccept / pdoc.nSubmit)|round|int if pdoc.nSubmit > 0 else _('?') }}</td>
<td class="col--difficulty">{{ pdoc['difficulty'] or _('(None)') }}</td>
</tr>
{% else %}
{% set pdoc = {'_id': pid, 'hidden': true, 'title': '*'} %}
<tr>
<td class="col--status record-status--border">
</td>
<td class="col--name col--problem-name">
{{ problem.render_problem_title(pdoc, invalid=true) }}
</td>
<td class="col--submit_n">*</td>
<td class="col--ac_rate">*</td>
<td class="col--difficulty">*</td>
</tr>
{% endif %}
{%- endfor -%}
</tbody>
</table>
<col class="col--name">
<col class="col--submit_n">
<col class="col--ac_rate">
<col class="col--difficulty">
</colgroup>
<thead>
<tr>
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<th class="col--status record-status--border">{{ _('Status') }}</th>
{% endif %}
<th class="col--name">{{ _('Problem') }}</th>
<th class="col--submit_n">{{ _('Tried') }}</th>
<th class="col--ac_rate">% {{ _('AC') }}</th>
<th class="col--difficulty">{{ _('Difficulty') }}</th>
</tr>
</thead>
<tbody>
{%- for pid in node['pids'] -%}
{% if pid in pdict %}
{% set pdoc=pdict[pid] %}
{% set psdoc=psdict[pid] %}
<tr>
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
{% if psdoc['rid'] %}
{{ record.render_status_td(psdoc, rid_key='rid') }}
{% else %}
<td class="col--status record-status--border"></td>
{% endif %}
{% endif %}
<td class="col--name col--problem-name">
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<form class="form--inline" action="{{ url('problem_main') }}" method="post">
<input type="hidden" name="pid" value="{{ pdoc.docId }}">
<input type="hidden" name="operation" value="{% if not psdoc['star'] %}star{% else %}unstar{% endif %}">
<input type="hidden" name="csrfToken" value="{{ handler.csrfToken }}">
<button class="star{% if psdoc['star'] %} activated{% endif %}" type="submit">
<span class="starred--hide"><span class="icon icon-star--outline" data-tooltip="{{ _('Star') }}"></span></span>
<span class="starred--show"><span class="icon icon-star" data-tooltip="{{ _('Unstar') }}"></span></span>
</button>
</form>
{% endif %}
{{ problem.render_problem_title(
pdoc,
invalid=not tsdoc['enroll'],
show_tags=false
) }}
</td>
<td class="col--tried">{{ pdoc.nSubmit }}</td>
<td class="col--ac">{{ pdoc.nAccept }}</td>
<td class="col--difficulty">{{ pdoc['difficulty'] or _('(None)') }}</td>
</tr>
{% else %}
{% set pdoc = {'_id': pid, 'hidden': true, 'title': '*'} %}
<tr>
<td class="col--status record-status--border">
</td>
<td class="col--name col--problem-name">
{{ problem.render_problem_title(pdoc, invalid=true) }}
</td>
<td class="col--submit_n">*</td>
<td class="col--ac_rate">*</td>
<td class="col--difficulty">*</td>
</tr>
{% endif %}
{%- endfor -%}
</tbody>
</table>
</div>
</div>
</div>
</div>
{%- endfor -%}
<div class="section__body">&nbsp;<!-- space placeholder --></div>
</div>