Files
sport-prog-club/app/templates/assignment.html
T
Кирилл ЯценкоandClaude Opus 5 cd490f6feb Свои задачи видно из портала
Страница загрузки набора была доступна только по прямому адресу — теперь
она карточкой на панели преподавателя, рядом со списками задач.

Своя задача в задании рисовалась как внешняя ссылка: значок «наружу» и
новая вкладка обещали уход на чужой сайт, которого нет. Ссылка на задачу
теперь одна на весь портал и смотрит на площадку.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-24 18:27:25 +05:00

106 lines
5.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% from "_ui.html" import empty %}
{% block title %}{{ assignment.title }} — {{ settings.app_name }}{% endblock %}
{% block content %}
{% set solved = progress.solved_count(user.id) %}
<h1>{{ assignment.title }}</h1>
<p class="sub">
{{ _("Выдано") }} {{ assignment.assigned_at | dt }}
{% if assignment.deadline %}
· {{ _("дедлайн") }} {{ assignment.deadline | dt }}
{% endif %}
{% if assignment.group %} · {{ assignment.group.title }}{% endif %}
</p>
<div class="card">
<div class="bar {{ 'done' if progress.total_problems and solved == progress.total_problems }}">
<span style="width: {{ (100 * solved / progress.total_problems) if progress.total_problems else 0 }}%"></span>
</div>
<div class="progress-line">
<span>{{ (_("Решено <b>%(solved)s</b> из <b>%(total)s</b>") % {"solved": solved, "total": progress.total_problems}) | safe }}</span>
<span>{{ ((100 * solved / progress.total_problems) | round | int) if progress.total_problems else 0 }}%</span>
</div>
</div>
{% if assignment.requires_solution %}
<div class="card callout">
<h3>{{ icon("shield") }} {{ _("К задачам нужно прислать код") }}</h3>
<p class="small" style="margin:0">
{{ _("Кроме посылки на платформе пришли сам код — текстом, прямо на портале.") }}
{{ _("Без кода зачёта по задаче нет, даже если она решена на площадке. Преподаватель код читает; отклонённый снимает зачёт. Прислать можно повторно — тогда проверка начнётся заново.") }}
</p>
</div>
{% endif %}
{% if problems %}
<div class="card table-wrap" style="padding:6px">
<table>
<thead>
<tr><th>#</th><th>{{ _("Задача") }}</th><th>{{ _("Платформа") }}</th><th>{{ _("Сложность") }}</th>
<th>{{ _("Статус") }}</th><th>{{ _("Когда") }}</th>
{% if assignment.requires_solution %}<th>{{ _("Код") }}</th>{% endif %}
<th>{{ _("Первым") }}</th></tr>
</thead>
<tbody>
{% for problem in problems %}
{% set cell = progress.cell(user.id, problem.id) %}
<tr>
<td class="muted num">{{ loop.index }}</td>
<td>{{ problem_link(problem) }}</td>
<td class="small muted">{{ problem.platform.title }} · {{ problem.label }}</td>
<td>
{% if problem.difficulty %}<span class="badge {{ problem.difficulty | lower }}">{{ problem.difficulty }}</span>
{% elif problem.rating %}<span class="badge rating">{{ problem.rating }}</span>
{% else %}<span class="muted">—</span>{% endif %}
</td>
<td>
{% if cell.status == SolveStatus.solved_in_time %}<span class="badge ok">{{ icon("check") }} {{ _("решено") }}</span>
{% elif cell.status == SolveStatus.solved_late %}<span class="badge warn">{{ icon("clock") }} {{ _("после дедлайна, не засчитано") }}</span>
{% elif cell.status == SolveStatus.solved_before %}<span class="badge">{{ _("решено до выдачи") }}</span>
{% else %}<span class="muted">—</span>{% endif %}
</td>
<td class="small muted">
{% if cell.solved_at %}{{ cell.solved_at | ago }}
{% elif cell.first_ever_at %}{{ cell.first_ever_at | ago }}
{% else %}—{% endif %}
</td>
{% if assignment.requires_solution %}
{% set mine = my_solutions.get(problem.id) %}
<td class="small">
{% if mine %}
{% if mine.status.value == "accepted" %}
<a class="badge ok" href="/solutions/{{ mine.id }}">{{ icon("check") }} {{ _("принято") }}</a>
{% elif mine.status.value == "rejected" %}
<a class="badge err" href="/solutions/{{ mine.id }}">{{ icon("alert") }} {{ _("отклонено") }}</a>
{% else %}
<a class="badge warn" href="/solutions/{{ mine.id }}">{{ icon("clock") }} {{ _("на проверке") }}</a>
{% endif %}
<br>
{% endif %}
<a class="btn ghost small" href="/assignments/{{ assignment.id }}/solutions/{{ problem.id }}">
{{ icon("edit") }} {{ _("Заменить") if mine else _("Прислать код") }}
</a>
</td>
{% endif %}
<td class="small">
{% set first = progress.first_solver(problem.id) %}
{% if first %}<a class="badge first" href="/u/{{ first.id }}">{{ icon("flame") }}{{ first.display_name }}</a>
{% else %}<span class="muted">—</span>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="card">{{ empty("inbox", _("В этом задании ещё нет задач.")) }}</div>
{% endif %}
<p class="small muted">
{{ _("В зачёт идёт решённое после выдачи и до дедлайна.") }}
{% if assignment.count_prior_solves %}{{ _("Решённое до выдачи тоже засчитывается.") }}
{% else %}{{ _("Решённое до выдачи не засчитывается.") }}{% endif %}
{{ _("После дедлайна решение видно, но в счёт не идёт.") }}
</p>
{% endblock %}