diff --git a/frontend_v2/src/app/components/challenge/challengeevaluation/challengeevaluation.component.html b/frontend_v2/src/app/components/challenge/challengeevaluation/challengeevaluation.component.html index a33a62ddf7..eb386b49cb 100644 --- a/frontend_v2/src/app/components/challenge/challengeevaluation/challengeevaluation.component.html +++ b/frontend_v2/src/app/components/challenge/challengeevaluation/challengeevaluation.component.html @@ -6,18 +6,6 @@
Evaluation Criteria
-
-
- -  Upload - -
-
- -  Edit - -
-
diff --git a/frontend_v2/src/app/components/challenge/challengeevaluation/challengeevaluation.component.ts b/frontend_v2/src/app/components/challenge/challengeevaluation/challengeevaluation.component.ts index c6e8d950c2..d381cd4ec7 100644 --- a/frontend_v2/src/app/components/challenge/challengeevaluation/challengeevaluation.component.ts +++ b/frontend_v2/src/app/components/challenge/challengeevaluation/challengeevaluation.component.ts @@ -80,44 +80,6 @@ export class ChallengeevaluationComponent implements OnInit { this.tncElement.innerHTML = this.challenge['terms_and_conditions']; } - /** - * Edit evaluation criteria of the challenge - */ - editEvaluationCriteria() { - 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.evaluation_details = data.evaluation_details; - this.updateView(); - SELF.globalService.showToast('success', 'The evaluation details is successfully updated!', 5); - }, - (err) => { - SELF.globalService.handleApiError(err, true); - SELF.globalService.showToast('error', err); - }, - () => this.logger.info('EDIT-CHALLENGE-EVALUATION-DETAILS-FINISHED') - ); - }; - - /** - * Parameters of the modal - */ - const PARAMS = { - title: 'Edit Evaluation Details', - label: 'evaluation_details', - isEditorRequired: true, - editorContent: this.challenge.evaluation_details, - confirm: 'Submit', - deny: 'Cancel', - confirmCallback: SELF.apiCall, - }; - SELF.globalService.showModal(PARAMS); - } - /** * Edit terms and conditions of the challenge */ @@ -155,50 +117,4 @@ export class ChallengeevaluationComponent implements OnInit { }; SELF.globalService.showModal(PARAMS); } - - /** - * Edit evaluation script of the challenge - */ - editEvaluationScript() { - const SELF = this; - SELF.apiCall = (params) => { - const FORM_DATA: FormData = new FormData(); - FORM_DATA.append('evaluation_script', params['evaluation_script']); - SELF.apiService - .patchFileUrl( - SELF.endpointsService.editChallengeDetailsURL(SELF.challenge.creator.id, SELF.challenge.id), - FORM_DATA - ) - .subscribe( - (data) => { - SELF.globalService.showToast('success', 'The evaluation script is successfully updated!'); - }, - (err) => { - SELF.globalService.showToast('error', err); - }, - () => this.logger.info('EDIT-EVALUATION-SCRIPT-FINISHED') - ); - }; - - /** - * Parameters of the modal - */ - const PARAMS = { - title: 'Edit Evaluation Script', - confirm: 'Submit', - deny: 'Cancel', - form: [ - { - name: 'evaluationScript', - isRequired: true, - label: 'evaluation_script', - placeholder: '', - type: 'file', - value: '', - }, - ], - confirmCallback: SELF.apiCall, - }; - SELF.globalService.showModal(PARAMS); - } } diff --git a/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.html b/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.html index 1198b96324..b2d88a9759 100644 --- a/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.html +++ b/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.html @@ -36,7 +36,6 @@
Challenge Settings
Starts on: {{ challenge['start_date'] | date: 'medium' }} {{ challenge['start_zone'] }} -   @@ -72,6 +71,32 @@
Challenge Settings
+ +
+
+ Evaluation and Annotations +
+
+
+
+ + + Evaluation Criteria + + + +    + + + Evaluation Script + + + + +
+
+
+
Banned emails Ids: 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 ff3616e629..a02d97eb28 100644 --- a/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts +++ b/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts @@ -388,6 +388,90 @@ export class ChallengesettingsComponent implements OnInit, OnDestroy { SELF.globalService.showModal(PARAMS); } + /** + * Edit evaluation criteria of the challenge + */ + editEvaluationCriteria() { + 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.evaluation_details = data.evaluation_details; + this.updateView(); + SELF.globalService.showToast('success', 'The evaluation details is successfully updated!', 5); + }, + (err) => { + SELF.globalService.handleApiError(err, true); + SELF.globalService.showToast('error', err); + }, + () => this.logger.info('EDIT-CHALLENGE-EVALUATION-DETAILS-FINISHED') + ); + }; + + /** + * Parameters of the modal + */ + const PARAMS = { + title: 'Edit Evaluation Details', + label: 'evaluation_details', + isEditorRequired: true, + editorContent: this.challenge.evaluation_details, + confirm: 'Submit', + deny: 'Cancel', + confirmCallback: SELF.apiCall, + }; + SELF.globalService.showModal(PARAMS); + } + + /** + * Edit evaluation script of the challenge + */ + editEvaluationScript() { + const SELF = this; + SELF.apiCall = (params) => { + const FORM_DATA: FormData = new FormData(); + FORM_DATA.append('evaluation_script', params['evaluation_script']); + SELF.apiService + .patchFileUrl( + SELF.endpointsService.editChallengeDetailsURL(SELF.challenge.creator.id, SELF.challenge.id), + FORM_DATA + ) + .subscribe( + (data) => { + SELF.globalService.showToast('success', 'The evaluation script is successfully updated!'); + }, + (err) => { + SELF.globalService.showToast('error', err); + }, + () => this.logger.info('EDIT-EVALUATION-SCRIPT-FINISHED') + ); + }; + + /** + * Parameters of the modal + */ + const PARAMS = { + title: 'Edit Evaluation Script', + confirm: 'Submit', + deny: 'Cancel', + form: [ + { + name: 'evaluationScript', + isRequired: true, + label: 'evaluation_script', + placeholder: '', + type: 'file', + value: '', + }, + ], + confirmCallback: SELF.apiCall, + }; + SELF.globalService.showModal(PARAMS); + } + /** * Edit challenge image function */