diff --git a/src/apps/api/views/competitions.py b/src/apps/api/views/competitions.py index c34eec48e..3f032b834 100644 --- a/src/apps/api/views/competitions.py +++ b/src/apps/api/views/competitions.py @@ -705,6 +705,7 @@ def get_leaderboard(self, request, pk): # - child submissions (submissions who has a parent i.e. parent field is not null) # - Failed submissions # - Cancelled submissions + num_entries = 1 # TMP, remove counting # num_entries = Submission.objects.filter( # Q(owner__username=submission['owner']) | # Q(parent__owner__username=submission['owner']), @@ -737,7 +738,7 @@ def get_leaderboard(self, request, pk): 'fact_sheet_answers': submission['fact_sheet_answers'], 'slug_url': submission['slug_url'], 'organization': submission['organization'], - # 'num_entries': num_entries, + 'num_entries': num_entries, 'created_when': submission['created_when'] }) for score in submission['scores']: diff --git a/src/static/riot/competitions/detail/leaderboards.tag b/src/static/riot/competitions/detail/leaderboards.tag index 25cc1e99a..b004d5ce9 100644 --- a/src/static/riot/competitions/detail/leaderboards.tag +++ b/src/static/riot/competitions/detail/leaderboards.tag @@ -34,6 +34,7 @@ # Participant + Entries Date ID {column.title} @@ -82,6 +83,7 @@ { submission.owner } { submission.organization.name } + {submission.num_entries} { pretty_date(submission.created_when) } {submission.id} diff --git a/src/tests/functional/test_submissions.py b/src/tests/functional/test_submissions.py index 6248ccaf2..3ee088ae0 100644 --- a/src/tests/functional/test_submissions.py +++ b/src/tests/functional/test_submissions.py @@ -74,7 +74,7 @@ def _run_submission_and_add_to_leaderboard(self, competition_zip_path, submissio # The leaderboard table lists our submission prediction_score = Submission.objects.get(pk=submission_id).scores.first().score - assert Decimal(self.find('leaderboards table tbody tr:nth-of-type(1) td:nth-of-type(5)').text) == round(Decimal(prediction_score), precision) + assert Decimal(self.find('leaderboards table tbody tr:nth-of-type(1) td:nth-of-type(6)').text) == round(Decimal(prediction_score), precision) def test_v15_iris_result_submission_end_to_end(self): self._run_submission_and_add_to_leaderboard('competition_15_iris.zip', 'submission_15_iris_result.zip', '======= Set 1 (Iris_test)', has_solutions=False, precision=4)