Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ docker-compose.override.yml
server_config.yaml
/graphs/
/codabench/

.DS_Store
.DS_Store?
1 change: 1 addition & 0 deletions src/apps/api/views/competitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ def get_leaderboard(self, request, pk):
if submission_key not in submissions_keys:
submissions_keys[submission_key] = len(response['submissions'])
response['submissions'].append({
'id': submission['id'],
'owner': submission['display_name'] or submission['owner'],
'scores': [],
'fact_sheet_answers': submission['fact_sheet_answers'],
Expand Down
1 change: 1 addition & 0 deletions src/apps/competitions/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
path('edit/<int:pk>/', views.CompetitionForm.as_view(), name="edit"),
path('upload/', views.CompetitionUpload.as_view(), name="upload"),
path('public/', views.CompetitionPublic.as_view(), name="public"),
path('<int:pk>/detailed_results/<int:submission_id>/', views.CompetitionDetailedResults.as_view(), name="detailed_results"),
]
4 changes: 4 additions & 0 deletions src/apps/competitions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ def get_object(self, *args, **kwargs):
if is_creator or is_collaborator or competition.published or valid_secret_key:
return competition
raise Http404()


class CompetitionDetailedResults(LoginRequiredMixin, TemplateView):
template_name = 'competitions/detailed_results.html'
16 changes: 16 additions & 0 deletions src/static/riot/competitions/detail/_detailed_results.tag
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<competition-detailed-results>
<h3>Detailed Results</h3>
<iframe src="{detailed_result}" width="100%" height="100%" frameBorder="0"></iframe>

<script>

let self = this
CODALAB.api.get_submission_details(opts.submission_id)
.done(function (data) {
self.detailed_result = data.detailed_result
self.update()
})


</script>
</competition-detailed-results>
8 changes: 8 additions & 0 deletions src/static/riot/competitions/detail/leaderboards.tag
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
<th>Task:</th>
<th></th>
<th each="{ task in filtered_tasks }" class="center aligned" colspan="{ task.colWidth }">{ task.name }</th>
<th if="{enable_detailed_results}"></th>
</tr>
<tr>
<th class="center aligned">#</th>
<th>Participant</th>
<th class="center aligned" each="{ column in filtered_columns }" colspan="1">{column.title}</th>
<th if="{enable_detailed_results}">Detailed Results</th>
</tr>
</thead>
<tbody>
Expand All @@ -55,6 +57,7 @@
<td if="{submission.organization === null}"><a href="{submission.slug_url}">{ submission.owner }</a></td>
<td if="{submission.organization !== null}"><a href="{submission.organization.url}">{ submission.organization.name }</a></td>
<td each="{ column in filtered_columns }">{ get_score(column, submission) } </td>
<td if="{enable_detailed_results}"><a href="detailed_results/{submission.id}">Show detailed results</a></td>
</tr>
</tbody>
</table>
Expand All @@ -67,6 +70,7 @@
self.filtered_columns = []
self.phase_id = null
self.competition_id = null
self.enable_detailed_results = false

self.get_score = function(column, submission) {
if(column.task_id === -1){
Expand Down Expand Up @@ -117,6 +121,8 @@
CODALAB.api.get_leaderboard_for_render(self.phase_id)
.done(responseData => {
self.selected_leaderboard = responseData


self.columns = []
// Make fake task and columns for Metadata so it can be filtered like columns
if(self.selected_leaderboard.fact_sheet_keys){
Expand Down Expand Up @@ -154,6 +160,8 @@
CODALAB.events.on('competition_loaded', (competition) => {
self.competition_id = competition.id
self.opts.is_admin ? self.show_download = "visible": self.show_download = "hidden"
self.enable_detailed_results = competition.enable_detailed_results

})

CODALAB.events.on('submission_changed_on_leaderboard', self.update_leaderboard)
Expand Down
4 changes: 4 additions & 0 deletions src/templates/competitions/detailed_results.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% extends "base.html" %}
{% block content %}
<competition-detailed-results submission_id="{{ submission_id }}"></competition-detailed-results>
{% endblock %}