Fix ioi16
This commit is contained in:
parent
02e2539606
commit
5f7199669c
4 changed files with 55 additions and 4 deletions
|
@ -226,9 +226,22 @@ class SubmissionStatus(SubmissionDetailBase):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def get_frozen_subtasks(self):
|
||||||
|
if self.request.user.is_superuser:
|
||||||
|
return set()
|
||||||
|
submission = self.object
|
||||||
|
contest = submission.contest_object
|
||||||
|
if contest and contest.format_name == "ioi16":
|
||||||
|
contest_problem = contest.contest_problems.get(problem=submission.problem)
|
||||||
|
return contest.format.get_frozen_subtasks().get(
|
||||||
|
str(contest_problem.id), set()
|
||||||
|
)
|
||||||
|
return set()
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(SubmissionStatus, self).get_context_data(**kwargs)
|
context = super(SubmissionStatus, self).get_context_data(**kwargs)
|
||||||
submission = self.object
|
submission = self.object
|
||||||
|
|
||||||
context["last_msg"] = event.last()
|
context["last_msg"] = event.last()
|
||||||
context["batches"] = group_test_cases(submission.test_cases.all())
|
context["batches"] = group_test_cases(submission.test_cases.all())
|
||||||
context["time_limit"] = submission.problem.time_limit
|
context["time_limit"] = submission.problem.time_limit
|
||||||
|
@ -237,6 +250,7 @@ class SubmissionStatus(SubmissionDetailBase):
|
||||||
context["highlighted_source"] = highlight_code(
|
context["highlighted_source"] = highlight_code(
|
||||||
submission.source.source, submission.language.pygments, linenos=False
|
submission.source.source, submission.language.pygments, linenos=False
|
||||||
)
|
)
|
||||||
|
context["frozen_subtasks"] = self.get_frozen_subtasks()
|
||||||
|
|
||||||
contest = submission.contest_or_none
|
contest = submission.contest_or_none
|
||||||
prefix_length = 0
|
prefix_length = 0
|
||||||
|
@ -869,10 +883,10 @@ class UserContestSubmissionsAjax(UserContestSubmissions):
|
||||||
submission = Submission.objects.get(id=sub_id)
|
submission = Submission.objects.get(id=sub_id)
|
||||||
if (
|
if (
|
||||||
subtask in frozen_subtasks.get(str(problem_id), set())
|
subtask in frozen_subtasks.get(str(problem_id), set())
|
||||||
and not self.include_frozen
|
and not self.request.user.is_superuser
|
||||||
):
|
):
|
||||||
best_subtasks[subtask] = {
|
best_subtasks[subtask] = {
|
||||||
"submission": submission,
|
"submission": None,
|
||||||
"contest_time": nice_repr(
|
"contest_time": nice_repr(
|
||||||
self.contest_time(submission), "noday"
|
self.contest_time(submission), "noday"
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
{% set can_view = submission_layout(submission, profile_id, request.user, editable_problem_ids, completed_problem_ids) %}
|
{% set can_view = submission_layout(submission, profile_id, request.user, editable_problem_ids, completed_problem_ids) %}
|
||||||
|
{% set hidden = submission.contest_object and submission.contest_object.format_name == "ioi16" and not request.user.is_superuser %}
|
||||||
|
{% if hidden %}
|
||||||
|
<div class="sub-result TLE">
|
||||||
|
<div class="score">
|
||||||
|
{%- if submission.is_graded -%}
|
||||||
|
??? / {{ submission.case_total|floatformat(0) }}
|
||||||
|
{%- else -%}
|
||||||
|
<i class="fa fa-spinner fa-pulse"></i>
|
||||||
|
{%- endif -%}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="state">
|
||||||
|
<span title="?" class="status">?</span> |
|
||||||
|
<span class="language">{{ submission.language.short_display_name }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
<div class="sub-result {{ submission.result_class }}">
|
<div class="sub-result {{ submission.result_class }}">
|
||||||
<div class="score">
|
<div class="score">
|
||||||
{%- if submission.is_graded -%}
|
{%- if submission.is_graded -%}
|
||||||
|
@ -17,6 +34,7 @@
|
||||||
<span class="language">{{ submission.language.short_display_name }}</span>
|
<span class="language">{{ submission.language.short_display_name }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="sub-info{% if submission.status == 'G' %} sub-info-grading{% endif %}">
|
<div class="sub-info{% if submission.status == 'G' %} sub-info-grading{% endif %}">
|
||||||
{% if show_problem %}
|
{% if show_problem %}
|
||||||
<div class="name"><a href="{{ url('problem_detail', submission.problem.code) }}">{{ problem_name }}</a></div>
|
<div class="name"><a href="{{ url('problem_detail', submission.problem.code) }}">{{ problem_name }}</a></div>
|
||||||
|
@ -33,7 +51,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if submission.status == 'G' %}
|
{% if submission.status == 'G' and not hidden %}
|
||||||
<div class="sub-testcase">
|
<div class="sub-testcase">
|
||||||
{%- if submission.current_testcase > 0 -%}
|
{%- if submission.current_testcase > 0 -%}
|
||||||
{{ _('Point %(point)s / Case #%(case)s', point=submission.points|floatformat(1), case=submission.current_testcase) }}
|
{{ _('Point %(point)s / Case #%(case)s', point=submission.points|floatformat(1), case=submission.current_testcase) }}
|
||||||
|
@ -61,6 +79,12 @@
|
||||||
</div></div>
|
</div></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if hidden %}
|
||||||
|
<div class="sub-usage">
|
||||||
|
<div class="time">---</div>
|
||||||
|
<div class="memory">---</div>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
<div class="sub-usage">
|
<div class="sub-usage">
|
||||||
{% if submission.status in ('QU', 'P', 'G', 'CE', 'IE', 'AB') %}
|
{% if submission.status in ('QU', 'P', 'G', 'CE', 'IE', 'AB') %}
|
||||||
<div class="time">---</div>
|
<div class="time">---</div>
|
||||||
|
@ -77,3 +101,4 @@
|
||||||
<div class="memory">{{ (submission.memory_bytes|filesizeformat(True)).replace('i', '') }}</div>
|
<div class="memory">{{ (submission.memory_bytes|filesizeformat(True)).replace('i', '') }}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
|
@ -26,6 +26,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for batch in batches %}
|
{% for batch in batches %}
|
||||||
|
{% if batch.id not in frozen_subtasks %}
|
||||||
<div style="margin-top: 0.5em;">
|
<div style="margin-top: 0.5em;">
|
||||||
{% if batch.id %}
|
{% if batch.id %}
|
||||||
<b>{{ _('Batch ') }}#{{ batch.id }} ({{batch.points|floatformat}} / {{batch.total|floatformat}}): </b>
|
<b>{{ _('Batch ') }}#{{ batch.id }} ({{batch.points|floatformat}} / {{batch.total|floatformat}}): </b>
|
||||||
|
@ -40,11 +41,18 @@
|
||||||
</span>
|
</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div style="margin-top: 0.5em;">
|
||||||
|
{% if batch.id %}
|
||||||
|
<b>{{ _('Batch ') }}#{{ batch.id }} (??? / {{batch.total|floatformat}})</b>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<table class="testcases-table">
|
<table class="testcases-table">
|
||||||
{% if submission.is_graded and submission.result != 'AB' %}
|
{% if submission.is_graded and submission.result != 'AB' and not frozen_subtasks %}
|
||||||
<thead>
|
<thead>
|
||||||
<tr id="overall-row" class="case-row overall-result-{{submission.result}}">
|
<tr id="overall-row" class="case-row overall-result-{{submission.result}}">
|
||||||
<td><span class="col-title">{{_('Overall: ')}}</span>
|
<td><span class="col-title">{{_('Overall: ')}}</span>
|
||||||
|
@ -82,6 +90,7 @@
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for batch in batches %}
|
{% for batch in batches %}
|
||||||
|
{% if batch.id not in frozen_subtasks %}
|
||||||
{% if batch.id %}
|
{% if batch.id %}
|
||||||
{% set batch_AC = (batch.points == batch.total) %}
|
{% set batch_AC = (batch.points == batch.total) %}
|
||||||
<tr class="case-row background-{{'d6e8f7' if batch.points == batch.total else 'bisque'}}">
|
<tr class="case-row background-{{'d6e8f7' if batch.points == batch.total else 'bisque'}}">
|
||||||
|
@ -174,6 +183,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,14 @@
|
||||||
<td>
|
<td>
|
||||||
({{ cur_subtask.contest_time }})
|
({{ cur_subtask.contest_time }})
|
||||||
</td>
|
</td>
|
||||||
|
{% if cur_subtask.submission %}
|
||||||
{% set can_view = submission_layout(cur_subtask.submission, profile_id, request.user, editable_problem_ids, completed_problem_ids) %}
|
{% set can_view = submission_layout(cur_subtask.submission, profile_id, request.user, editable_problem_ids, completed_problem_ids) %}
|
||||||
{% if can_view %}
|
{% if can_view %}
|
||||||
<td>
|
<td>
|
||||||
→ <a href="{{url('submission_status', cur_subtask.submission.id)}}">{{ cur_subtask.submission.id }}</a>
|
→ <a href="{{url('submission_status', cur_subtask.submission.id)}}">{{ cur_subtask.submission.id }}</a>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Reference in a new issue