From 9cd47ccebc4aba15545284296973a5bc858a2363 Mon Sep 17 00:00:00 2001
From: gautamjajoo Challenge Settings
+
+
+ Submission Guidelines
+
+
+
@@ -201,6 +207,12 @@ Challenge Settings
+
+ Leaderboard Description
+
+
+
+
diff --git a/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts b/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts
index e4de5f05b1..5155be6dcd 100644
--- a/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts
+++ b/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts
@@ -914,6 +914,40 @@ export class ChallengesettingsComponent implements OnInit, OnDestroy {
}
}
+ /**
+ * Edit submission guidelines
+ */
+ editSubmissionGuidelines() {
+ const SELF = this;
+ SELF.apiCall = (params) => {
+ const BODY = JSON.stringify(params);
+ SELF.apiService
+ .patchUrl(SELF.endpointsService.editChallengeDetailsURL(SELF.challenge.creator.id, SELF.challenge.id), BODY)
+ .subscribe(
+ (data) => {
+ SELF.challenge.submission_guidelines = data.submission_guidelines;
+ SELF.globalService.showToast('success', 'The submission guidelines are successfully updated!', 5);
+ },
+ (err) => {
+ SELF.globalService.handleApiError(err, true);
+ SELF.globalService.showToast('error', err);
+ },
+ () => {}
+ );
+ };
+
+ const PARAMS = {
+ title: 'Edit Submission Guidelines',
+ label: 'submission_guidelines',
+ isEditorRequired: true,
+ editorContent: this.challenge.submission_guidelines,
+ confirm: 'Submit',
+ deny: 'Cancel',
+ confirmCallback: SELF.apiCall,
+ };
+ SELF.globalService.showModal(PARAMS);
+ }
+
// Edit Leaderboard Details ->
/**
@@ -1000,6 +1034,43 @@ export class ChallengesettingsComponent implements OnInit, OnDestroy {
}
}
+ /**
+ * Edit leaderboard description of the challenge
+ */
+ editLeaderboardDescription() {
+ const SELF = this;
+ SELF.apiCall = (params) => {
+ const BODY = JSON.stringify(params);
+ SELF.apiService
+ .patchUrl(SELF.endpointsService.editChallengeDetailsURL(SELF.challenge.creator.id, SELF.challenge.id), BODY)
+ .subscribe(
+ (data) => {
+ SELF.challenge.leaderboard_description = data.leaderboard_description;
+ SELF.globalService.showToast('success', 'The leaderboard description is successfully updated!', 5);
+ },
+ (err) => {
+ SELF.globalService.handleApiError(err, true);
+ SELF.globalService.showToast('error', err);
+ },
+ () => this.logger.info('Edit Leaderboard Description')
+ );
+ };
+
+ /**
+ * Parameters of the modal
+ */
+ const PARAMS = {
+ title: 'Edit Leaderboard Description',
+ label: 'leaderboard_description',
+ isEditorRequired: true,
+ editorContent: this.challenge.leaderboard_description,
+ confirm: 'Submit',
+ deny: 'Cancel',
+ confirmCallback: SELF.apiCall,
+ };
+ SELF.globalService.showModal(PARAMS);
+ }
+
// Edit Evaluation Script and Criteria ->
/**
diff --git a/frontend_v2/src/app/components/challenge/challengesubmit/challengesubmit.component.html b/frontend_v2/src/app/components/challenge/challengesubmit/challengesubmit.component.html
index 5d3e6b3e0b..26796e163a 100644
--- a/frontend_v2/src/app/components/challenge/challengesubmit/challengesubmit.component.html
+++ b/frontend_v2/src/app/components/challenge/challengesubmit/challengesubmit.component.html
@@ -13,12 +13,7 @@ Submission Guidelines