diff --git a/judge/views/ranked_submission.py b/judge/views/ranked_submission.py index e00a460..fcf13f2 100644 --- a/judge/views/ranked_submission.py +++ b/judge/views/ranked_submission.py @@ -17,10 +17,9 @@ class RankedSubmissions(ProblemSubmissions): def get_queryset(self): if self.in_contest: - contest_join = """INNER JOIN judge_contestsubmission AS cs ON (sub.id = cs.submission_id) - INNER JOIN judge_contestparticipation AS cp ON (cs.participation_id = cp.id)""" + contest_join = "INNER JOIN judge_contestsubmission AS cs ON (sub.id = cs.submission_id)" points = "cs.points" - constraint = "AND cp.contest_id = %s" + constraint = " AND sub.contest_object_id = %s" else: contest_join = "" points = "sub.points" @@ -46,8 +45,8 @@ class RankedSubmissions(ProblemSubmissions): GROUP BY sub.user_id, {points} ) AS fastest ON (highscore.uid = fastest.uid AND highscore.points = fastest.points) STRAIGHT_JOIN judge_submission AS sub - ON (sub.user_id = fastest.uid AND sub.time = fastest.time) {contest_join} - WHERE sub.problem_id = %s AND {points} > 0 {constraint} + ON (sub.user_id = fastest.uid AND sub.time = fastest.time) + WHERE sub.problem_id = %s {constraint} GROUP BY sub.user_id """.format( points=points, contest_join=contest_join, constraint=constraint diff --git a/templates/contest/contest.html b/templates/contest/contest.html index 9e12283..6dc9850 100644 --- a/templates/contest/contest.html +++ b/templates/contest/contest.html @@ -135,6 +135,8 @@