Skip to content
Snippets Groups Projects
Select Git revision
  • 10098ab695cfb54e67ff3c261c5b3db0d488022b
  • devel default
  • master
  • fo
  • jirka/typing
  • fo-base
  • mj/submit-images
  • jk/issue-96
  • jk/issue-196
  • honza/add-contestant
  • honza/mr7
  • honza/mrf
  • honza/mrd
  • honza/mra
  • honza/mr6
  • honza/submit-images
  • honza/kolo-vs-soutez
  • jh-stress-test-wip
  • shorten-schools
19 results

org_contest_solutions.html

Blame
  • org_contest_solutions.html 6.11 KiB
    {% extends "base.html" %}
    {% import "bootstrap/wtf.html" as wtf %}
    {% set round = contest.round %}
    
    {% set edit_points = not ctx.site and rights.can_edit_points() %}
    {% set edit_create = rights.can_create_solutions() %}
    {% set edit_both = edit_points and edit_create %}
    
    {% block title %}
    {{ "Založení řešení" if edit_form else "Tabulka řešení" }} {% if site %}soutěžního místa {{ site.name }}{% else %}{{ contest.place.name_locative() }}{% endif %}
    {% endblock %}
    {% block breadcrumbs %}
    {{ ctx.breadcrumbs(action="Založení řešení" if edit_form else "Tabulka řešení") }}
    {% endblock %}
    
    {% block pretitle %}
    {% if contest.state in [RoundState.grading, RoundState.graded, RoundState.closed] %}
    <div class="btn-group pull-right">
    	<a class="btn btn-default" href="{{ ctx.url_for('org_score') }}">Výsledky {{ round.get_level().name_genitive() }}</a>
    	<a class="btn btn-default" href="{{ ctx.url_for('org_score', ct_id=None) }}">Výsledky kola</a>
    </div>
    {% endif %}
    {% endblock %}
    {% block body %}
    {% include "parts/org_submit_warning.html" %}
    
    <p><i>
    {% if edit_form %}
    Zaškrtnutím políček u řešení, která dosud neexistují, a odesláním tlačítkem pod tabulkou tato řešení založíte.
    To se hodí, pokud se nechystáte do systému nahrávat soubory řešení, ale jen chcete řešení vytvořit, aby jim
    bylo možné vyplnit body. Pokud nějaké řešení založíte omylem, lze toto prázdné řešení smazat v jeho detailu.
    {% else %}
    Všechna odevzdání od účastníka k úloze můžete vidět po kliknutí na ikonku <span class="icon">🔍</span>.
    Tamtéž můžete nahrávat skeny jednotlivých řešení.
    Odkazem v záhlaví se lze dostat na detailní výpis odevzdání všech uživatelů pro
    konkrétní úlohu. Symbol <span class="icon">🗐</span> značí, že existuje více verzí dostupných v detailu.
    {% endif %}
    </i></p>
    
    {% if edit_form %}
    <form class="form" method="POST">
    {{ edit_form.csrf_token }}
    {% endif %}
    <table class="data full center">
    	<colgroup><col span="2"></colgroup>
    	{% for task in tasks %}
    	<colgroup style="border: 2px black solid;"><col span="4"></colgroup>
    	{% endfor %}
    	<colgroup><col></colgroup>
    	<thead>
    		<tr>
    			<th rowspan=2>Účastník
    			<th rowspan=2>Stav účasti</th>
    			{% for task in tasks %}<th colspan=4>
    				<a href="{{ ctx.url_for('org_contest_task', task_id=task.task_id) }}">{{ task.code }}</a>
    			{% endfor %}
    			<th rowspan=2>Body celkem
    		</tr>
    		<tr>
    			{% for task in tasks %}<th title="Řešení">Řeš<th title="Oprava">Opr<th title="Body">B<th title="Detail"><span class="icon">🔍</span>{% endfor %}
    		</tr>
    	</thead>
    	{% for pion in pions %}
    	{% set u = pion.user %}
    	<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 %}
    			{% if u.user_id in tasks_sols[task.task_id] %}
    				{% set sol = tasks_sols[task.task_id][u.user_id] %}
    				{% if sol.final_submit_obj %}
    					{% set p = sol.final_submit_obj %}
    					{% set late = p.check_deadline(round) %}
    					<td class="sol{% if late or p.is_broken() %} sol-warn{% endif %}">
    						<a href="{{ paper_link(u, p) }}" title="{{ p.uploaded_at|timeformat }}{% if p.is_broken() %} - nekorektní PDF{% endif %}{% if p.pages != None %} - {{ p.pages|inflected('stránka', 'stránky', 'stránek') }}{% endif %}{% if late %} - {{ late }}{% endif %}">🖺</a>
    						{% set key = (u.user_id, task.task_id, "solution") %}
    						{% if key in paper_counts and paper_counts[key] > 1 %}
    							<span title="Celkem {{ paper_counts[key]|inflected('verze', 'verze', 'verzí') }}" class="icon">🗐</span>
    						{% endif %}
    				{% else %}
    					<td class="sol">
    				{% endif %}
    				{% if sol.final_feedback_obj %}
    					{% set p = sol.final_feedback_obj %}
    					<td class="sol{% if p.is_broken() %} sol-warn{% endif %}">
    						<a href="{{ paper_link(u, p) }}" title="{{ p.uploaded_at|timeformat }}{% if p.is_broken() %} - nekorektní PDF{% endif %}{% if p.pages != None %} - {{ p.pages|inflected('stránka', 'stránky', 'stránek') }}{% endif %}">🖺</a>
    						{% set key = (u.user_id, task.task_id, "feedback") %}
    						{% if key in paper_counts and paper_counts[key] > 1 %}
    							<span title="Celkem {{ paper_counts[key]|inflected('verze', 'verze', 'verzí') }}" class="icon">🗐</span>
    						{% endif %}
    				{% else %}
    					<td class="sol">
    				{% endif %}
    				<td class="sol">
    					{{ sol|sol_display_points }}
    					{% if sol.points is not none %}{% do sum_points.append(sol.points) %}{% endif %}
    				<td class="sol">
    			{% else %}
    				<td colspan=3>
    				{% if edit_form %}
    					<label>
    						<input type="checkbox" name="create_sol_{{task.task_id}}_{{u.user_id}}">
    						Založit
    					</label>
    				{% else %}–{% endif %}
    				<td>
    			{% 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>
    	</tr>
    	{% endfor %}
    	<tfoot>
    		<tr><td><td>
    		{% for task in tasks %}
    			<td colspan=4><div class='btn-group'>
    				<a class='btn btn-xs btn-primary' href="{{ ctx.url_for('org_generic_batch_download', task_id=task.task_id) }}">Stáhnout</a>
    			{% if rights.can_upload_feedback() %}
    				<a class='btn btn-xs btn-primary' href="{{ ctx.url_for('org_generic_batch_upload', task_id=task.task_id) }}">Nahrát</a>
    			{% endif %}
    			{% if edit_points or edit_create %}
    				<a class='btn btn-xs btn-primary' title="{{'Založit řešení nebo editovat body' if edit_both else 'Editovat body' if edit_points else 'Založit řešení'}}" href="{{ ctx.url_for('org_contest_task_edit', task_id=task.task_id) }}">Editovat</a>
    			{% endif %}
    
    				</div>
    		{% endfor %}
    		<td>
    	</tfoot>
    </table>
    {% if edit_form %}
    	<div class='btn-group'>
    		{{ wtf.form_field(edit_form.submit, class="btn btn-primary") }}
    		<a class="btn btn-default" href="{{ ctx.url_for('org_contest_solutions') }}">Zrušit</a>
    	</div>
    </form>
    {% else %}
    <div class='btn-group'>
    	{% if rights.can_create_solutions() %}
    	<a class="btn btn-primary" href="{{ ctx.url_for('org_contest_solutions_edit') }}">Založit řešení hromadně</a>
    	{% endif %}
    </div>
    {% endif %}
    
    {% endblock %}