Skip to content

Commit

Permalink
cleanup interface for TAMa/Euler-style contests a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
kcvajgf committed Oct 14, 2023
1 parent b521da5 commit 6d020ec
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
15 changes: 12 additions & 3 deletions cms/server/contest/templates/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,21 +211,30 @@ <h2>{% trans %}Task overview{% endtrans %}</h2>
<th>{{ t_iter.name }}</th>
<td>{{ t_iter.title }}</td>
<td>
{% if t_iter.active_dataset.time_limit is not none %}
{% if t_iter.active_dataset.time_limit is not none and t_iter.active_dataset.task_type != "OutputOnly" %}
{{ t_iter.active_dataset.time_limit|format_duration(length="long") }}
{% else %}
{% trans %}N/A{% endtrans %}
{% endif %}
</td>
<td>
{% if t_iter.active_dataset.memory_limit is not none %}
{% if t_iter.active_dataset.memory_limit is not none and t_iter.active_dataset.task_type != "OutputOnly" %}
{{ t_iter.active_dataset.memory_limit|format_size }}
{% else %}
{% trans %}N/A{% endtrans %}
{% endif %}
</td>
<td>{{ get_task_type(dataset=t_iter.active_dataset).name }}</td>
<td>{{ t_iter.submission_format|map("replace", ".%l", extensions)|join(" ") }}</td>

{# TODO in the future, instead of this condition, simply use the option in the admin about Euler-style problems #}
<td>
{% if t_iter.active_dataset.task_type != "OutputOnly" %}
{{ t_iter.submission_format|map("replace", ".%l", extensions)|join(" ") }}
{% else %}
{% trans %}N/A{% endtrans %}
{% endif %}
</td>

{% if tokens_contest != TOKEN_MODE_DISABLED and tokens_tasks != TOKEN_MODE_DISABLED %}
<td>
{% if t_iter.token_mode == TOKEN_MODE_FINITE or t_iter.token_mode == TOKEN_MODE_INFINITE %}
Expand Down
4 changes: 2 additions & 2 deletions cms/server/contest/templates/task_description.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ <h2>{% trans %}Some details{% endtrans %}</h2>
<th>{% trans %}Type{% endtrans %}</th>
<td colspan="2">{% set task_type = get_task_type(dataset=task.active_dataset) %}{{ task_type.name }}</td>
</tr>
{% if task.active_dataset.time_limit is not none %}
{% if task.active_dataset.time_limit is not none and task.active_dataset.task_type != "OutputOnly" %}
<tr>
<th>{% trans %}Time limit{% endtrans %}</th>
<td colspan="2">{{ task.active_dataset.time_limit|format_duration(length="long") }}</td>
</tr>
{% endif %}
{% if task.active_dataset.memory_limit is not none %}
{% if task.active_dataset.memory_limit is not none and task.active_dataset.task_type != "OutputOnly" %}
<tr>
<th>{% trans %}Memory limit{% endtrans %}</th>
<td colspan="2">{{ task.active_dataset.memory_limit|format_size }}</td>
Expand Down
7 changes: 4 additions & 3 deletions cms/server/contest/templates/task_submissions.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ <h2 style="margin-bottom: 10px">{% trans %}Submit a solution{% endtrans %}</h2>
{% for filename in task.submission_format %}
<div class="control-group">

{# TODO make this an option in the admin somewhere (option per task) #}
{# TODO make this an option in the admin somewhere (option per task), say "Euler-style" #}

{#
<label class="control-label" for="input{{ loop.index0 }}">{{ filename|replace(".%l", ": ") }}</label>
Expand All @@ -260,9 +260,10 @@ <h2 style="margin-bottom: 10px">{% trans %}Submit a solution{% endtrans %}</h2>
</div>
#}

<label class="control-label" for="raw-input{{ loop.index0 }}">{{ filename|replace(".%l", ": ")|replace(".txt", ": ") }}</label>
<label class="control-label" for="raw-input{{ loop.index0 }}">{{ filename|replace(".%l", ": ")|replace(".txt", ": ")|replace("output_", "Subtask ") }}</label>
<div class="controls">
<input type="text" class="input-xlarge"
placeholder="Final Answer (NOT code), e.g., 12345"
id="raw-input{{ loop.index0 }}" name="raw:{{ filename }}"/>
</div>
</div>
Expand All @@ -287,7 +288,7 @@ <h2 style="margin-bottom: 10px">{% trans %}Submit a solution{% endtrans %}</h2>
</fieldset>
</form>
</div>
{% if task.submission_format|length > 1 and not task.submission_format|any("endswith", ".%l") %}
{% if task.submission_format|length > 1 and not task.submission_format|any("endswith", ".%l") and task.active_dataset.task_type != "OutputOnly" %}
<div class="span4">
<form class="form-horizontal" enctype="multipart/form-data" action="{{ contest_url("tasks", task.name, "submit") }}" method="POST">
{{ xsrf_form_html|safe }}
Expand Down

0 comments on commit 6d020ec

Please sign in to comment.