mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: auto-convert contest problem id
This commit is contained in:
1 parent
1f15d78fe6
commit
bd9840cc45
4 files changed
+14
-13
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.29.28",
|
"version": "2.29.29",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -225,6 +225,7 @@ export class ContestEditHandler extends Handler {
|
|||||||
const pids = _pids.replace(/,/g, ',').split(',').map((i) => {
|
const pids = _pids.replace(/,/g, ',').split(',').map((i) => {
|
||||||
i = i.trim();
|
i = i.trim();
|
||||||
if ((+i).toString() === i) return +i;
|
if ((+i).toString() === i) return +i;
|
||||||
|
if (i.split(':')[0] === domainId) return +i.split(':')[1];
|
||||||
return i;
|
return i;
|
||||||
}).filter((i) => i);
|
}).filter((i) => i);
|
||||||
const beginAtMoment = moment.tz(`${beginAtDate} ${beginAtTime}`, this.user.timeZone);
|
const beginAtMoment = moment.tz(`${beginAtDate} ${beginAtTime}`, this.user.timeZone);
|
||||||
|
|||||||
@@ -312,6 +312,7 @@ class HomeworkEditHandler extends Handler {
|
|||||||
const pids = _pids.replace(/,/g, ',').split(',').map((i) => {
|
const pids = _pids.replace(/,/g, ',').split(',').map((i) => {
|
||||||
i = i.trim();
|
i = i.trim();
|
||||||
if ((+i).toString() === i) return +i;
|
if ((+i).toString() === i) return +i;
|
||||||
|
if (i.split(':')[0] === domainId) return +i.split(':')[1];
|
||||||
return i;
|
return i;
|
||||||
}).filter((i) => i);
|
}).filter((i) => i);
|
||||||
const tdoc = tid
|
const tdoc = tid
|
||||||
|
|||||||
@@ -41,22 +41,21 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{%- for pid in tdoc.pids -%}
|
{%- for pid in tdoc.pids -%}
|
||||||
<tr>
|
<tr>
|
||||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||||
{% if psdict[pid] and psdict[pid]['rid'] %}
|
{% if psdict[pid] and psdict[pid].rid %}
|
||||||
{% set rdoc = rdict[psdict[pid]['rid']] %}
|
{% set rdoc = rdict[psdict[pid].rid] %}
|
||||||
{% if model.contest.canShowRecord.call(handler, tdoc) %}
|
{% if model.contest.canShowRecord.call(handler, tdoc) %}
|
||||||
{{ record.render_status_td(rdoc) }}
|
{{ record.render_status_td(rdoc) }}
|
||||||
|
{% 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>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td class="col--status record-status--border"><a href="{{ url('record_detail', rid=rdoc._id) }}">{{ _('Submitted') }}</a></td>
|
<td class="col--status record-status--border">{{ _('No Submissions') }}</td>
|
||||||
|
<td class="col--submit-at">-</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td class="col--submit-at">{{ datetimeSpan(rdoc['_id'])|safe }}</td>
|
|
||||||
{% else %}
|
|
||||||
<td class="col--status record-status--border">{{ _('No Submissions') }}</td>
|
|
||||||
<td class="col--submit-at">-</td>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
<td class="col--problem col--problem-name">
|
<td class="col--problem col--problem-name">
|
||||||
#{{ loop.index }}:
|
|
||||||
{{ problem.render_problem_title(pdict[pid], tdoc=tdoc, show_invisible_flag=false, show_tags=false) }}
|
{{ problem.render_problem_title(pdict[pid], tdoc=tdoc, show_invisible_flag=false, show_tags=false) }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in new issue
Block a user