From 56a9b5d6a0ff03288092a97f346b52bb128d5edc Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Tue, 20 Dec 2022 15:24:34 -0600 Subject: [PATCH] Hide submissions for ioi16 --- judge/views/submission.py | 33 +++++++++++++++++------------ templates/submission/user-ajax.html | 4 +++- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/judge/views/submission.py b/judge/views/submission.py index 83c4216..5b539df 100644 --- a/judge/views/submission.py +++ b/judge/views/submission.py @@ -907,19 +907,26 @@ class UserContestSubmissionsAjax(UserContestSubmissions): contest_problem = self.contest.contest_problems.get(problem=self.problem) filtered_submissions = [] - for s in context["submissions"]: - if not hasattr(s, "contest"): - continue - contest_time = self.contest_time(s) - if contest_time: - s.contest_time = nice_repr(contest_time, "noday") - else: - s.contest_time = None - total = floatformat(contest_problem.points, -self.contest.points_precision) - points = floatformat(s.contest.points, -self.contest.points_precision) - s.display_point = f"{points} / {total}" - filtered_submissions.append(s) - context["submissions"] = filtered_submissions + + # Only show this for some users when using ioi16 + if self.contest.format_name != "ioi16" or self.include_frozen: + for s in context["submissions"]: + if not hasattr(s, "contest"): + continue + contest_time = self.contest_time(s) + if contest_time: + s.contest_time = nice_repr(contest_time, "noday") + else: + s.contest_time = None + total = floatformat( + contest_problem.points, -self.contest.points_precision + ) + points = floatformat(s.contest.points, -self.contest.points_precision) + s.display_point = f"{points} / {total}" + filtered_submissions.append(s) + context["submissions"] = filtered_submissions + else: + context["submissions"] = None best_subtasks = self.get_best_subtask_points() if best_subtasks: diff --git a/templates/submission/user-ajax.html b/templates/submission/user-ajax.html index bc237fb..95220a0 100644 --- a/templates/submission/user-ajax.html +++ b/templates/submission/user-ajax.html @@ -35,6 +35,7 @@
{% endif %} +{% if submissions %} {% for submission in submissions %} @@ -64,4 +65,5 @@ {% endif %} {% endfor %} - \ No newline at end of file + +{% endif %} \ No newline at end of file