codalab/codalab — pull request #326 by cpoulain (2014-02-06 01:11:02+00:00)
Title: Add ability for competition organizers to hide results in a phase per #315

This commit adds the ability for competition organizers to hide results in a phase per #315 and enhances the submission table per #318.

**Creating a competition**

A new flag is introduced to define when competition results will appear to participants and how results of a submission are added to the leaderboard.

The name of the flag is **leaderboard_management_mode** and its possible values are:
- **default**: Emulates current behavior where results are visible to participants immediately. Participants select which entry to put in the leaderboard and the leaderboard is visible to all as soon as the phase is active.
- **hide_results**: Emulates the new behavior where results are hidden from participants until competition organizers make them available. Participants do not have the ability to select which entry goes to the leaderboard; instead the last successful submission is automatically added to the leaderboard. The participant has no visibility into the process. The leaderboard is also hidden.

Following is an excerpt from the competition definition YAML file:
```
phases:
1:
...
leaderboard_management_mode: "default"
...
2:
...
leaderboard_management_mode: "hide_results"
...
```
If the **leaderboard_management_mode** flag is not specified, then the value defaults to **default**.

**Changes to submission table**

The submission table has been modified to hide UI elements that are not applicable when the phase of the competition is setup to hide results.

In addition, some new requested elements have been added:

- Name of uploaded is shown in the FILENAME column of the table.
- Uploaded file can be downloaded back by expanding the corresponding row of the submission table and clicking the link "Download your submission"
- When results are visible, list of downloadable files now include the output from the prediction phase (when applicable) in addition to the output from the scoring phase.
- Downloaded files use a new naming convention of the form:

```
--.zip
```
For example, if username is `john`, the scoring output for submission 3 will be named `john-3-output.zip`. The uploaded file can be re-downloaded and will then be named `john-3-input.zip`. Note that it would have been possible to also use the name of the original input file but we chose to use the same naming approach for all downloadable files. In addition, the API endpoint which serves the file is also accessible to competition organizers who may not be able to make sense of the user's original file name.

The object model for CompetitionSubmission has been modified to include a field which can hold a short description (256 chars max). However, the description field is not yet filled from the input bundle and is not surfaces in the UI.

Here is a snapshot of the submission table when results are not hidden:
![sub-table-show-results](https://f.cloud.github.com/assets/3453398/2094363/da2c7676-8eca-11e3-994d-63a8b7d6ce41.jpg)

Here is a snapshot when results are hidden:
![sub-table-hide-results](https://f.cloud.github.com/assets/3453398/2094376/09e61354-8ecb-11e3-845f-20b560973942.jpg)

**Follow-up items**

- The on-going work on the competition editor will need to surface the new **leaderboard_management_mode** flag. Without the editing capability, the competition organizer cannot publish phase results.
- Documentation work: update competition creation doc and address note in work item #315 (="the competition owner needs to know they should not expose anything sensitive in stderr").
- What date/time should be used in the submission table (local vs UTC)?