Skip to content
Snippets Groups Projects
Commit 803bd6fb authored by Jan Prachař's avatar Jan Prachař
Browse files

Tabulka řešení: sloupec se součtem bodů až v poslední iteraci

parent a7191386
No related branches found
No related tags found
No related merge requests found
......@@ -39,14 +39,19 @@ Odkazem v záhlaví se lze dostat na podrobný výpis odevzdání všech účast
{{ edit_form.csrf_token }}
{% endif %}
{% set sum_points = {} %}
{% for i in range((tasks|length)//4 + (1 if (tasks|length)%4 > 0 else 0)) %}
<div class="table-responsive">
<table class="table table-bordered table-hover table-condensed">
<colgroup style="border-right: 2px #aaa solid;"><col span="2"></colgroup>
<colgroup><col span="2"></colgroup>
{% for task in tasks[4*i:4*(i+1)] %}
<colgroup style="border-right: 2px #aaa solid;"><col span="4"></colgroup>
<colgroup style="border-left: 2px #aaa solid;"><col span="4"></colgroup>
{% endfor %}
<colgroup><col></colgroup>
{% if loop.last %}
{% set last_loop = True %}
<colgroup style="border-left: 2px #aaa solid;"><col></colgroup>
{% endif %}
<thead>
<tr>
<th rowspan=2>Účastník
......@@ -60,7 +65,9 @@ Odkazem v záhlaví se lze dostat na podrobný výpis odevzdání všech účast
</a>
{% endif %}
{% endfor %}
{% if last_loop %}
<th rowspan=2>Body celkem
{% endif %}
</tr>
<tr>
{% for task in tasks[4*i:4*(i+1)] %}<th title="Řešení">Ř<th title="Oprava">O<th title="Body">B<th title="Detail"><span class="icon">🔍</span>{% endfor %}
......@@ -68,10 +75,10 @@ Odkazem v záhlaví se lze dostat na podrobný výpis odevzdání všech účast
</thead>
{% for pion in pions %}
{% set u = pion.user %}
{% do sum_points.setdefault(pion, []) %}
<tr class="state-{{ pion.state.name }}">
<th>{{ u|pion_link(contest.contest_id) }}
<td>{{ pion.state.friendly_name() }}
{% set sum_points = [] %}
{% for task in tasks[4*i:4*(i+1)] %}
{% if u.user_id in tasks_sols[task.task_id] %}
{% set sol = tasks_sols[task.task_id][u.user_id] %}
......@@ -101,7 +108,7 @@ Odkazem v záhlaví se lze dostat na podrobný výpis odevzdání všech účast
<td class="success">
{% if sol.points is not none %}
{{ sol.points|decimal }}
{% if sum_points.append(sol.points) %}{% endif %}
{% do sum_points[pion].append(sol.points) %}
{% else %}
<span class="unknown">?</span>
{% endif %}
......@@ -118,7 +125,9 @@ Odkazem v záhlaví se lze dostat na podrobný výpis odevzdání všech účast
{% endif %}
<a class="btn btn-xs btn-link icon" title="Detail řešení" href="{{ ctx.url_for('org_submit_list', user_id=u.user_id, task_id=task.task_id) }}">🔍</a>
{% endfor %}
<th>{{ sum_points|sum|decimal }}</th>
{% if last_loop %}
<th>{{ sum_points[pion]|sum|decimal }}</th>
{% endif %}
</tr>
{% endfor %}
<tfoot>
......@@ -137,7 +146,9 @@ Odkazem v záhlaví se lze dostat na podrobný výpis odevzdání všech účast
<td>
<a class="btn btn-xs btn-primary" href="{{ ctx.url_for('org_contest_task', task_id=task.task_id) }}" title="Podrobný výpis odevzdaných řešení k úloze {{ task.code }}"><span class="glyphicon glyphicon-search"></span></a>
{% endfor %}
{% if last_loop %}
<td>
{% endif %}
</tfoot>
</table>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment