From c617957fc5d661019c724d7772e139090ef6861f Mon Sep 17 00:00:00 2001 From: Luong Doan Date: Sat, 5 Jun 2021 02:45:22 +0000 Subject: [PATCH] Fix a stat bug --- judge/views/contests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/judge/views/contests.py b/judge/views/contests.py index 89bcc9e..a20117f 100644 --- a/judge/views/contests.py +++ b/judge/views/contests.py @@ -567,7 +567,7 @@ class ContestStats(TitleMixin, ContestMixin, DetailView): .values_list('problem__code', 'contest__points', 'contest__problem__points', 'count')) counter = [[0 for _ in range(self.POINT_BIN + 1)] for _ in range(num_problems)] for problem_code, point, max_point, count in point_count_queryset: - if point == None: continue + if (point == None) or (problem_code not in codes): continue problem_idx = codes.index(problem_code) bin_idx = math.floor(point * self.POINT_BIN / max_point) counter[problem_idx][bin_idx] += count