Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6eb7738
Add feature to disable private submission
Harshit28j Aug 31, 2024
5e85318
add test case fix for private submission disable feature
Harshit28j Aug 31, 2024
288f96d
Removed console.log
Harshit28j Aug 31, 2024
6647892
add option disable changes & docs
Harshit28j Sep 1, 2024
9d8b8fc
Merge branch 'master' into add_disable_private_sub
gchhablani Sep 1, 2024
45925c7
feat: Add feature to disable private submission
TheArchitect19 Apr 29, 2025
68e94b9
feat: Add feature to disable private submission
TheArchitect19 Apr 29, 2025
a902135
refactor: removed conflicts
TheArchitect19 Apr 30, 2025
03795c3
Merge branch 'master' of https://github.com/TheArchitect19/EvalAI int…
TheArchitect19 May 1, 2025
b1f46ef
feat: added unit test for makeSubmission
TheArchitect19 May 1, 2025
8b97728
feat: added unit test for makeSubmission
TheArchitect19 May 1, 2025
827be74
feat: added unit test for makeSubmission
TheArchitect19 May 1, 2025
f296f18
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 1, 2025
6cf99d7
Merge branch 'master' of https://github.com/TheArchitect19/EvalAI int…
TheArchitect19 May 5, 2025
370c4e6
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
fc88765
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
1032bb8
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
46d70bf
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
93045f5
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
351395e
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
2365d0b
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
00ec830
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
22657b6
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
f7faf27
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
0336b08
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
25cea09
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
3aa40e9
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
b3d53d3
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
ba5dc1d
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
efc55be
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
33892e8
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
a2eeb4f
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
38a58e2
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
3121cfe
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
f19c359
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
9b3bb6c
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 5, 2025
049c863
Merge branch 'master' of https://github.com/TheArchitect19/EvalAI int…
TheArchitect19 May 6, 2025
475faec
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 6, 2025
ae0acf7
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 6, 2025
03485a0
feat: added unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 6, 2025
aa77a49
feat: removed unit test toggleDisablePrivateSubmission(ev)
TheArchitect19 May 6, 2025
b786c03
Merge branch 'master' of https://github.com/TheArchitect19/EvalAI int…
TheArchitect19 May 6, 2025
881502c
refactor: my-submission
TheArchitect19 May 7, 2025
cd5e4f8
Merge branch 'master' into add_disable_private_sub
TheArchitect19 May 10, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.20 on 2024-08-31 06:42

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("challenges", "0112_challenge_sqs_retention_period"),
]

operations = [
migrations.AddField(
model_name="challenge",
name="disable_private_submission",
field=models.BooleanField(default=False),
),
]
1 change: 1 addition & 0 deletions apps/challenges/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def __init__(self, *args, **kwargs):
max_length=200, blank=True, null=True, default=""
)
evaluation_module_error = models.TextField(null=True, blank=True)
disable_private_submission = models.BooleanField(default=False)

class Meta:
app_label = "challenges"
Expand Down
2 changes: 2 additions & 0 deletions apps/challenges/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class Meta:
"worker_instance_type",
"sqs_retention_period",
"github_repository",
"disable_private_submission",
)


Expand Down Expand Up @@ -312,6 +313,7 @@ class Meta:
"evaluation_module_error",
"worker_image_url",
"sqs_retention_period",
"disable_private_submission",
)


Expand Down
2 changes: 2 additions & 0 deletions docs/source/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Following fields are required (and can be customized) in the [`challenge_config.

3. `metadata`: This field defines additional information about the metrics that are used to evaluate the challenge submissions.

- **disable_private_submission**: True/False (a Boolean field that gives the flexibility to Challenge Hosts to either disable or enable private submissions. Default is `False`)

The leaderboard schema for the [sample challenge configuration](https://github.com/Cloud-CV/EvalAI-Starters/blob/master/challenge_config.yaml) looks like this:

```yaml
Expand Down
61 changes: 59 additions & 2 deletions frontend/src/js/controllers/challengeCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
vm.isPublicSubmission = null;
vm.isMultiMetricLeaderboardEnabled = {};
vm.wrnMsg = {};
vm.page = {};
vm.page = $scope.page || {};
vm.isParticipated = false;
vm.isActive = false;
vm.phases = {};
Expand Down Expand Up @@ -82,7 +82,7 @@
vm.currentPhaseLeaderboardPublic = false;
vm.eligible_to_submit = false;
vm.evaluation_module_error = null;

vm.disable_private_submission = false;
vm.filter_all_submission_by_team_name = '';
vm.filter_my_submission_by_team_name = '';
// show loader
Expand Down Expand Up @@ -709,6 +709,9 @@
formData.append("project_url", vm.projectUrl);
formData.append("publication_url", vm.publicationUrl);
formData.append("submission_metadata", JSON.stringify(vm.metaAttributesforCurrentSubmission));
if (vm.disable_private_submission) {
vm.isPublicSubmission = true;
}
if (vm.isPublicSubmission !== null) {
formData.append("is_public", vm.isPublicSubmission);
}
Expand Down Expand Up @@ -2837,6 +2840,60 @@
$mdDialog.hide();
}
};
vm.toggleDisablePrivateSubmission = function(ev) {
ev.stopPropagation();
vm.toggleSubmissionState = null;
vm.submissionDesc = null;
if (vm.disable_private_submission)
vm.toggleSubmissionState = "allowed";

Check warning on line 2848 in frontend/src/js/controllers/challengeCtrl.js

View check run for this annotation

Codecov / codecov/patch

frontend/src/js/controllers/challengeCtrl.js#L2844-L2848

Added lines #L2844 - L2848 were not covered by tests
else
vm.toggleSubmissionState = "disabled";

Check warning on line 2850 in frontend/src/js/controllers/challengeCtrl.js

View check run for this annotation

Codecov / codecov/patch

frontend/src/js/controllers/challengeCtrl.js#L2850

Added line #L2850 was not covered by tests

var confirm = $mdDialog.confirm()

Check warning on line 2852 in frontend/src/js/controllers/challengeCtrl.js

View check run for this annotation

Codecov / codecov/patch

frontend/src/js/controllers/challengeCtrl.js#L2852

Added line #L2852 was not covered by tests
.title('Make private submissions ' + vm.toggleSubmissionState + '?')
.ariaLabel('')
.targetEvent(ev)
.ok('Yes')
.cancel('No');

$mdDialog.show(confirm).then(function() {
if (vm.page && vm.page.id) {
$http.get('/api/challenges/challenge/' + vm.page.id + '/')

Check warning on line 2861 in frontend/src/js/controllers/challengeCtrl.js

View check run for this annotation

Codecov / codecov/patch

frontend/src/js/controllers/challengeCtrl.js#L2859-L2861

Added lines #L2859 - L2861 were not covered by tests
.then(function (response) {
vm.challengeDetails = response.data;

Check warning on line 2863 in frontend/src/js/controllers/challengeCtrl.js

View check run for this annotation

Codecov / codecov/patch

frontend/src/js/controllers/challengeCtrl.js#L2863

Added line #L2863 was not covered by tests
})
.catch(function () {
$rootScope.notify("error", "Failed to fetch challenge data.");

Check warning on line 2866 in frontend/src/js/controllers/challengeCtrl.js

View check run for this annotation

Codecov / codecov/patch

frontend/src/js/controllers/challengeCtrl.js#L2866

Added line #L2866 was not covered by tests
});
} else {
$rootScope.notify("error", "Challenge ID is missing.");

Check warning on line 2869 in frontend/src/js/controllers/challengeCtrl.js

View check run for this annotation

Codecov / codecov/patch

frontend/src/js/controllers/challengeCtrl.js#L2869

Added line #L2869 was not covered by tests
}

parameters.url = "challenges/challenge_host_team/" + vm.page.creator.id + "/challenge/" + vm.page.id;
parameters.method = 'PATCH';
parameters.data = {

Check warning on line 2874 in frontend/src/js/controllers/challengeCtrl.js

View check run for this annotation

Codecov / codecov/patch

frontend/src/js/controllers/challengeCtrl.js#L2872-L2874

Added lines #L2872 - L2874 were not covered by tests
"disable_private_submission": !vm.disable_private_submission,
};
vm.disable_private_submission = !vm.disable_private_submission;
parameters.callback = {

Check warning on line 2878 in frontend/src/js/controllers/challengeCtrl.js

View check run for this annotation

Codecov / codecov/patch

frontend/src/js/controllers/challengeCtrl.js#L2877-L2878

Added lines #L2877 - L2878 were not covered by tests
onSuccess: function(response) {
var status = response.status;
if (status === 200) {
$mdDialog.hide();
$rootScope.notify("success", "Private submissions were successfully made " + vm.toggleSubmissionState);

Check warning on line 2883 in frontend/src/js/controllers/challengeCtrl.js

View check run for this annotation

Codecov / codecov/patch

frontend/src/js/controllers/challengeCtrl.js#L2880-L2883

Added lines #L2880 - L2883 were not covered by tests
}
},
onError: function(response) {
$mdDialog.hide();
var error = response.data;
$rootScope.notify("error", error);

Check warning on line 2889 in frontend/src/js/controllers/challengeCtrl.js

View check run for this annotation

Codecov / codecov/patch

frontend/src/js/controllers/challengeCtrl.js#L2887-L2889

Added lines #L2887 - L2889 were not covered by tests
}
};
utilities.sendRequest(parameters);

Check warning on line 2892 in frontend/src/js/controllers/challengeCtrl.js

View check run for this annotation

Codecov / codecov/patch

frontend/src/js/controllers/challengeCtrl.js#L2892

Added line #L2892 was not covered by tests
}, function() {
// Nope
});
};

vm.publishChallenge = function(ev) {
ev.stopPropagation();
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/views/web/challenge/challenge-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ <h4 class="challenge-step-title w-300">{{challenge.page.title}}
<strong class="text-light-black">Not Published </strong>
<i class="fa fa-eye red-text" aria-hidden="true"></i>
</a>
</span><br>
<span ng-if="challenge.disable_private_submission">
<a class="pointer" ng-click="challenge.toggleDisablePrivateSubmission($event)">
<strong class="text-light-black">Private Submissions Disabled </strong>
<i class="fa fa-lock red-text" aria-hidden="true"></i>
</a>
</span>
<span ng-if="!challenge.disable_private_submission">
<a class="pointer" ng-click="challenge.toggleDisablePrivateSubmission($event)">
<strong class="text-light-black">Private Submissions Allowed </strong>
<i class="fa fa-unlock green-text" aria-hidden="true"></i>
</a>
</span>
</span>
<br>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/web/challenge/submission.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ <h5 class="w-300">Make Submission</h5>
<div
ng-show="challenge.isSubmissionUsingUrl || challenge.isSubmissionUsingFile">

<div ng-show="challenge.currentPhaseLeaderboardPublic">
<div ng-if="!challenge.disable_private_submission" ng-show="challenge.currentPhaseLeaderboardPublic">
<p class="fs-14 w-400" ng>Select submission visibility:</p>
<li>
<input type="radio" name="submissionVisibility" class="with-gap selectPhase" id="isPublicSubmission"
Expand Down Expand Up @@ -498,7 +498,7 @@ <h5 class="w-300">Make Submission</h5>
</button>
</li>
<li>
<div class="center-content">Use &nbsp;<code> --private </code> &nbsp;or&nbsp; <code> --public </code>&nbsp; flag in the submission
<div class="center-content">Use &nbsp; <span ng-show="!challenge.disable_private_submission"><code> --private </code> &nbsp;or&nbsp; </span><code> --public </code>&nbsp; flag in the submission
command to make the submission private or public respectively.<br />
</div>
</li>
Expand Down
Loading