Repository: Cloud-CV/EvalAI
Issue: [FrontendV2] The P tag should not appear for the results on private leaderboard
Root cause: Documentation Deficiency

### Description

![Screen Shot 2021-03-24 at 12 09 21 PM](https://user-images.githubusercontent.com/16323427/112266335-d5d01180-8c99-11eb-8e8c-cbbde4e23423.png)

For submissions made to the private phase we should not show the `P` tag on the private phase leaderboard

Can I work on this? @Ram81 

@xavierfigueroav sure, go ahead

@xavierfigueroav are you currently working on this issue ?

@ankitpal1029 yes, I am

oh cool let me know if you need some assistance
i'd be happy to help


I've been playing around with the system, but I haven't been able to reproduce the behaviour described in the issue.
What I've tried is:
1. To create a challenge as _host_ based on the examples in the repository, but setting `leaderboard_public` to `True` and `is_public` to `False` in the challenge phase. The resulting config file is:
```
title: Xavier 2 Challenge
short_description: Short description of the challenge (preferably 140 characters)
description: description.html
evaluation_details: evaluation_details.html
terms_and_conditions: terms_and_conditions.html
image : logo.png
submission_guidelines: submission_guidelines.html
evaluation_script: evaluation_script.zip
start_date: 2021-04-03 16:00:00
end_date: 2021-04-05 16:00:00

leaderboard:
  - id: 1
    schema: {"labels": ["yes/no", "number", "others", "overall"], "default_order_by": "overall"}

challenge_phases:
  - id: 1
    name: Challenge Name of the challenge phase
    description: challenge_phase_description.html
    leaderboard_public: True
    is_public: False
    start_date: 2021-04-03 16:00:00
    end_date: 2021-04-03 18:00:00
    test_annotation_file: test_annotation.txt
    codename: Challenge phase codename
    max_submissions_per_day: 100
    max_submissions: 1000
    max_submissions_per_month: 345

dataset_splits:
  - id: 1
    name: Name of the dataset split
    codename: codename of dataset split

challenge_phase_splits:
  - challenge_phase_id: 1
    leaderboard_id: 1
    dataset_split_id: 1
    visibility: 3
```
2. To approve the challenge with the Django Admin.
3. To participate in the challenge as the user _participant_.

But I wasn't able to make any submission because the phase was private. So, I tried to make a private submission (_test_annotation.txt_ file) as _host_. I could, but the submission got a FAILED status. The stderr is:
```
ORGINIAL EXCEPTION: No such relation between Challenge Phase and DatasetSplit specified by Challenge Host 
Traceback (most recent call last):
  File "/code/scripts/workers/submission_worker.py", line 513, in run_submission
    dataset_split__codename=split_code_name,
  File "/usr/local/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 408, in get
    self.model._meta.object_name
challenges.models.ChallengePhaseSplit.DoesNotExist: ChallengePhaseSplit matching query does not exist.
```
And, in the leaderboard tab, I get: "No results to show!".

I also tried:
1. To create a challenge as _host_ based on the examples in the repository, but setting `leaderboard_public` to `False` and `is_public` to `True` in the challenge phase. The resulting config file is:
```
title: Xavier Challenge
short_description: Short description of the challenge (preferably 140 characters)
description: description.html
evaluation_details: evaluation_details.html
terms_and_conditions: terms_and_conditions.html
image : logo.png
submission_guidelines: submission_guidelines.html
evaluation_script: evaluation_script.zip
start_date: 2021-04-03 16:00:00
end_date: 2021-04-05 16:00:00

leaderboard:
  - id: 1
    schema: {"labels": ["yes/no", "number", "others", "overall"], "default_order_by": "overall"}

challenge_phases:
  - id: 1
    name: Phase 2 Xavier Private
    description: challenge_phase_description.html
    leaderboard_public: False
    is_public: True
    start_date: 2021-04-03 16:00:00
    end_date: 2021-04-03 18:00:00
    test_annotation_file: test_annotation.txt
    codename: Challenge phase codename
    max_submissions_per_day: 100
    max_submissions: 1000
    max_submissions_per_month: 345

dataset_splits:
  - id: 1
    name: Name of the dataset split
    codename: codename of dataset split

challenge_phase_splits:
  - challenge_phase_id: 1
    leaderboard_id: 1
    dataset_split_id: 1
    visibility: 3
```
2. To approve the challenge with the Django Admin.
3. To participate in the challenge as _participant_.
4. To make a private submission (_test_annotation.txt_ file).

After step 4, the submission has status FAILED. The stderr is:
```
ORGINIAL EXCEPTION: No such relation between Challenge Phase and DatasetSplit specified by Challenge Host 
Traceback (most recent call last):
  File "/code/scripts/workers/submission_worker.py", line 513, in run_submission
    dataset_split__codename=split_code_name,
  File "/usr/local/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 408, in get
    self.model._meta.object_name
challenges.models.ChallengePhaseSplit.DoesNotExist: ChallengePhaseSplit matching query does not exist.
```
And, in the leaderboard tab, I get: "No results to show!".

Besides trying to reproduce the behaviour, I've also had a look at the code. I found the place where the P tag rendering logic is implemented.

https://github.com/Cloud-CV/EvalAI/blob/1d8cb272016d6a493e81e43c62a98b88ce789e2b/frontend_v2/src/app/components/challenge/challengeleaderboard/challengeleaderboard.component.html#L189-L193

So, the P tag should actually be shown only if the phase is public (due to the condition `isSelectedPhaseLeaderboardPublic`), what is not happening, according to the issue. But I cannot relate more, because of the explained above.

It would be great if you can give me some guidance on this @Ram81 @ankitpal1029. I am sorry for the delay in providing some progress in this issue, it has been a tough week.

@Ram81 isn't this issue already fixed by the PR I made earlier https://github.com/Cloud-CV/EvalAI/pull/3295 . Also, it has been merged to master

Closing this since we are not working on Frontend_V2.