diff --git a/judge/views/submission.py b/judge/views/submission.py index a150071..827fe04 100644 --- a/judge/views/submission.py +++ b/judge/views/submission.py @@ -226,9 +226,22 @@ class SubmissionStatus(SubmissionDetailBase): return True 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): context = super(SubmissionStatus, self).get_context_data(**kwargs) submission = self.object + context["last_msg"] = event.last() context["batches"] = group_test_cases(submission.test_cases.all()) context["time_limit"] = submission.problem.time_limit @@ -237,6 +250,7 @@ class SubmissionStatus(SubmissionDetailBase): context["highlighted_source"] = highlight_code( submission.source.source, submission.language.pygments, linenos=False ) + context["frozen_subtasks"] = self.get_frozen_subtasks() contest = submission.contest_or_none prefix_length = 0 @@ -869,10 +883,10 @@ class UserContestSubmissionsAjax(UserContestSubmissions): submission = Submission.objects.get(id=sub_id) if ( subtask in frozen_subtasks.get(str(problem_id), set()) - and not self.include_frozen + and not self.request.user.is_superuser ): best_subtasks[subtask] = { - "submission": submission, + "submission": None, "contest_time": nice_repr( self.contest_time(submission), "noday" ), diff --git a/templates/submission/row.html b/templates/submission/row.html index d1adef1..0c523ef 100644 --- a/templates/submission/row.html +++ b/templates/submission/row.html @@ -1,4 +1,21 @@ {% 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 %} +
+
+ {%- if submission.is_graded -%} + ??? / {{ submission.case_total|floatformat(0) }} + {%- else -%} + + {%- endif -%} +
+ +
+ ? | + {{ submission.language.short_display_name }} +
+
+{% else %}
{%- if submission.is_graded -%} @@ -17,6 +34,7 @@ {{ submission.language.short_display_name }}
+{% endif %}
{% if show_problem %}
{{ problem_name }}
@@ -33,7 +51,7 @@
-{% if submission.status == 'G' %} +{% if submission.status == 'G' and not hidden %}
{%- if submission.current_testcase > 0 -%} {{ _('Point %(point)s / Case #%(case)s', point=submission.points|floatformat(1), case=submission.current_testcase) }} @@ -61,6 +79,12 @@
{% endif %} +{% if hidden %} +
+
---
+
---
+
+{% else %}
{% if submission.status in ('QU', 'P', 'G', 'CE', 'IE', 'AB') %}
---
@@ -77,3 +101,4 @@
{{ (submission.memory_bytes|filesizeformat(True)).replace('i', '') }}
{% endif %}
+{% endif %} \ No newline at end of file diff --git a/templates/submission/status-testcases.html b/templates/submission/status-testcases.html index db743be..487edd2 100644 --- a/templates/submission/status-testcases.html +++ b/templates/submission/status-testcases.html @@ -26,6 +26,7 @@ {% endif %} {% for batch in batches %} + {% if batch.id not in frozen_subtasks %}
{% if batch.id %} {{ _('Batch ') }}#{{ batch.id }} ({{batch.points|floatformat}} / {{batch.total|floatformat}}): @@ -40,11 +41,18 @@ {% endfor %}
+ {% else %} +
+ {% if batch.id %} + {{ _('Batch ') }}#{{ batch.id }} (??? / {{batch.total|floatformat}}) + {% endif %} +
+ {% endif %} {% endfor %}
- {% if submission.is_graded and submission.result != 'AB' %} + {% if submission.is_graded and submission.result != 'AB' and not frozen_subtasks %} {% for batch in batches %} + {% if batch.id not in frozen_subtasks %} {% if batch.id %} {% set batch_AC = (batch.points == batch.total) %} @@ -174,6 +183,7 @@ {% endif %} {% endfor %} + {% endif %} {% endfor %}
{{_('Overall: ')}} @@ -82,6 +90,7 @@
diff --git a/templates/submission/user-ajax.html b/templates/submission/user-ajax.html index 95220a0..ff97a5d 100644 --- a/templates/submission/user-ajax.html +++ b/templates/submission/user-ajax.html @@ -16,12 +16,14 @@ ({{ cur_subtask.contest_time }}) + {% if cur_subtask.submission %} {% set can_view = submission_layout(cur_subtask.submission, profile_id, request.user, editable_problem_ids, completed_problem_ids) %} {% if can_view %} → {{ cur_subtask.submission.id }} {% endif %} + {% endif %} {% endfor %}