Skip to content
Snippets Groups Projects
Commit f5e6d5ef authored by Jiří Setnička's avatar Jiří Setnička
Browse files

Odlišujeme 0 a NULL bodů

Při nezadaných bodech zobrazujeme červený otazník.
parent 55c6eb5a
No related branches found
No related tags found
1 merge request!16Zadávání bodů a zobrazení výsledků
...@@ -95,11 +95,9 @@ def org_score(round_id: Optional[int] = None, contest_id: Optional[int] = None): ...@@ -95,11 +95,9 @@ def org_score(round_id: Optional[int] = None, contest_id: Optional[int] = None):
results_map[user.user_id] = Result(user, pion.contest, pant.school_place) results_map[user.user_id] = Result(user, pion.contest, pant.school_place)
for sol in sols: for sol in sols:
if sol.points:
results_map[sol.user_id].points[sol.task_id] = sol.points results_map[sol.user_id].points[sol.task_id] = sol.points
if sol.points:
results_map[sol.user_id].total_points += sol.points results_map[sol.user_id].total_points += sol.points
else:
results_map[sol.user_id].points[sol.task_id] = 0
results = list(results_map.values()) results = list(results_map.values())
......
...@@ -76,7 +76,8 @@ naleznete v detailu řešení. ...@@ -76,7 +76,8 @@ naleznete v detailu řešení.
<b title="Celkem {{ paper_counts[key]|inflected('verze', 'verze', 'verzí') }}">+</b> <b title="Celkem {{ paper_counts[key]|inflected('verze', 'verze', 'verzí') }}">+</b>
{% endif %} {% endif %}
{% else %}–{% endif %} {% else %}–{% endif %}
<td>{{ sol.points if sol.points != None else '–' }} <td>
{% if sol.points is not none %}{{ sol.points}}{% else %}<span class="unknown">?</span>{% endif %}
{% else %} {% else %}
<td><td><td> <td><td><td>
{% endif %} {% endif %}
......
...@@ -46,7 +46,7 @@ uživatelé jsou skryti. Rozkliknutím bodů se lze dostat na detail daného ře ...@@ -46,7 +46,7 @@ uživatelé jsou skryti. Rozkliknutím bodů se lze dostat na detail daného ře
{% for task in tasks %} {% for task in tasks %}
<td>{% if task.task_id in result.points %} <td>{% if task.task_id in result.points %}
<a title="Detail řešení" href="{{ url_for('org_submit_list', contest_id=result.contest.contest_id, user_id=result.user.user_id, task_id=task.task_id) }}"> <a title="Detail řešení" href="{{ url_for('org_submit_list', contest_id=result.contest.contest_id, user_id=result.user.user_id, task_id=task.task_id) }}">
{{ result.points[task.task_id] }} {% if result.points[task.task_id] is not none %}{{ result.points[task.task_id] }}{% else %}<span class="unknown">?</span>{% endif %}
</a> </a>
{% else %}–{% endif %} {% else %}–{% endif %}
{% endfor %} {% endfor %}
......
...@@ -14,11 +14,15 @@ ...@@ -14,11 +14,15 @@
<table class="data"> <table class="data">
<tr><th>Účastník<td>{{ sc.user|user_link }} <tr><th>Účastník<td>{{ sc.user|user_link }}
<tr><th>Úloha<td><a href='{{ url_for('org_contest_task_submits', contest_id=sc.contest.contest_id, site_id=site_id, task_id=sc.task.task_id) }}'>{{ sc.task.code }} {{ sc.task.name }}</a> <tr><th>Úloha<td><a href='{{ url_for('org_contest_task_submits', contest_id=sc.contest.contest_id, site_id=site_id, task_id=sc.task.task_id) }}'>{{ sc.task.code }} {{ sc.task.name }}</a>
<tr><th>Body<td>{% if solution and solution.points %}{{solution.points}}{% else %}–{% endif %} {% if solution %}
<tr><th>Body<td>{% if solution.points is not none %}{{solution.points}}{% else %}<span class="unknown">?</span>{% endif %}
{% endif %}
</table> </table>
{% include "parts/org_submit_warning.html" %} {% include "parts/org_submit_warning.html" %}
{% if solution %}
<h3>Odevzdaná řešení</h3> <h3>Odevzdaná řešení</h3>
{% if sol_papers %} {% if sol_papers %}
...@@ -104,6 +108,10 @@ ...@@ -104,6 +108,10 @@
</table> </table>
{% endif %} {% endif %}
{% else %}
<p>Žádné odevzdané řešení. {% if form %}Můžete ho přidat pomocí formuláře níže.{% endif %}
{% endif %}
{% if form %} {% if form %}
<h3>Odevzdávání</h3> <h3>Odevzdávání</h3>
......
...@@ -61,6 +61,11 @@ footer { ...@@ -61,6 +61,11 @@ footer {
font-weight: bold; font-weight: bold;
} }
span.unknown {
font-weight: bold;
color: red;
}
table.data { table.data {
border-collapse: collapse; border-collapse: collapse;
margin-top: 2ex; margin-top: 2ex;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment