Hide submissions for ioi16

This commit is contained in:
cuom1999 2022-12-20 15:24:34 -06:00
parent 9522e17acd
commit 56a9b5d6a0
2 changed files with 23 additions and 14 deletions

View file

@ -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:

View file

@ -35,6 +35,7 @@
</tbody></table>
<hr>
{% endif %}
{% if submissions %}
<table class="lightbox-submissions"><tbody>
{% for submission in submissions %}
<tr>
@ -65,3 +66,4 @@
</tr>
{% endfor %}
</tbody></table>
{% endif %}