Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move test annotations to edit phase section #3570

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -172,23 +172,7 @@
</div>
</div>
</div>

<div class="row row-lr-margin">
<div class="col-lg-6 col-md-6 col-sm-12 col-lr-pad">
<app-input
[name]="'test_annotation_file'"
[label]="'test_annotation'"
[editPhaseDetails]="editPhaseDetails"
[placeholder]="''"
[type]="'file'"
[value]="''"
#formmodal
></app-input>
</div>
</div>

<div class="row row-lr-margin"></div>
</div>

<div class="buttons">
<div class="col-md-12 col-sm-12 col-lr-pad">
<div class="align-left text-med-black fw-regular">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,23 @@ <h5 class="fw-light">Challenge Settings</h5>
<img *ngIf="challenge['image'] == null" src="assets/images/404.png" width="80%" />
</div>
<div
class="btn btn-waves-effect waves-dark grad-btn grad-btn-dark fs-16 upload-button"
(click)="editChallengeImage()"
class="btn btn-waves-effect waves-dark grad-btn grad-btn-dark fs-16 upload-button"
(click)="editChallengeImage()"
>
<i class="fa fa-file" aria-hidden="true"> </i>
<i class="fa fa-file" aria-hidden="true"> </i>
<span> Upload New Image</span>
</div>
</div>
<div class="col-lg-6 col-md-12 col-sm-7 col-xs-12">
<span class="fs-20 fw-semibold challenge-title">
{{ challenge['title'] }}
</span>
<a style="padding-right: 4px;" class="pointer fs-16" *ngIf="isChallengeHost" (click)="editChallengeTitle()">
<a
style="padding-right: 4px;"
class="pointer fs-16"
*ngIf="isChallengeHost"
(click)="editChallengeTitle()"
>
<i class="fa fa-pencil" aria-hidden="true"></i>
</a>
<a class="pointer fs-16" *ngIf="isChallengeHost" (click)="deleteChallenge()">
Expand All @@ -44,7 +49,7 @@ <h5 class="fw-light">Challenge Settings</h5>
<i class="fa fa-pencil" aria-hidden="true"> </i>
</a>
</div>
</div>
</div>
<div class="ev-action">
<div *ngIf="isChallengeHost" class="col-sm-1.5 col-xs-1.5">
<span class="fs-16 fw-light">
Expand Down Expand Up @@ -78,10 +83,10 @@ <h5 class="fw-light">Challenge Settings</h5>
</span>
<br />
<span class="fs-16 fw-light" *ngIf="isChallengeHost">
<a class="pointer" (click)="togglePublishChallengeState()">
<strong class="text-light-black">{{ publishChallenge.state }} </strong>
<i class="{{ publishChallenge.icon }}" aria-hidden="true"></i>
</a>
<a class="pointer" (click)="togglePublishChallengeState()">
<strong class="text-light-black">{{ publishChallenge.state }} </strong>
<i class="{{ publishChallenge.icon }}" aria-hidden="true"></i>
</a>
</span>
<br />
<mat-checkbox
Expand All @@ -94,8 +99,8 @@ <h5 class="fw-light">Challenge Settings</h5>
</mat-checkbox>
</div>
</div>
</div>
</div>

<!-- Banned Email Ids -->
<div class="row settings-section">
<div class="col-lg-3 col-md-4 col-sm-3 col-xs-3">
Expand Down Expand Up @@ -135,7 +140,7 @@ <h5 class="fw-light">Challenge Settings</h5>
</mat-tab>

<!-- Edit Phase Details -->
<mat-tab label="Phase and Leaderboard Details">
<mat-tab label="Phase and Leaderboard Details">
<div class="row settings-section">
<div class="col-lg-3 col-md-4 col-sm-3 col-xs-3">
<span class="fw-light fs-18">Edit Phase</span>
Expand All @@ -151,29 +156,48 @@ <h5 class="fw-light">Challenge Settings</h5>
#phaseselect
></app-selectphase>
</div>
<div class="row margin-bottom-cancel phase-card " *ngIf="selectedPhase">

<div class="row margin-bottom-cancel phase-card" *ngIf="selectedPhase">
<span class="fs-16 fw-light">
<strong class="text-light-black">Phase Details </strong>
</span>
<a class="pointer fs-16" (click)="editPhaseDetails()">
<i class="fa fa-pencil" aria-hidden="true"> </i>
</a>&nbsp;&nbsp;&nbsp;&nbsp;
<i class="fa fa-pencil" aria-hidden="true"> </i> </a
>&nbsp;&nbsp;&nbsp;&nbsp;
<span class="fs-16 fw-light">
<strong class="text-light-black">Is Public </strong>
</span>
<a class="pointer fs-20" (click)="togglePhaseVisibility()">
<i class="{{ phaseVisibility.icon }}" aria-hidden="true"> </i>
</a>&nbsp;&nbsp;&nbsp;&nbsp;
<i class="{{ phaseVisibility.icon }}" aria-hidden="true"> </i> </a
>&nbsp;&nbsp;&nbsp;&nbsp;
<span class="fs-16 fw-light">
<strong class="text-light-black">Submission Visibility </strong>
</span>
<a class="pointer fs-20" (click)="toggleSubmissionVisibility()">
<i class="{{ submissionVisibility.icon }}" aria-hidden="true"> </i>
</a>
<br /><br />
<span class="fs-16 fw-light">
<strong class="text-light-black">Test Annotations </strong>
</span>
<a class="pointer fs-15" (click)="editTestAnnotations()">
<i class="fa fa-upload" aria-hidden="true"> </i>
</a>
</div>

</div>
<br />
<div class="col-s12" *ngIf="isChallengeHost">
<div class="fw-light">
<p class="fs-16">
<strong> Note: </strong> For test annotations > 100MB, please use
<a href=" https://cli.eval.ai/#challenge-annotations" target="_blank"
><strong class="blue-text"> evalai-cli </strong></a
>
to update the test annotations.
<a (click)="showCliInstructions()"><strong class="blue-text">View Instructions</strong></a>
</p>
</div>
</div>
</div>
</div>
</div>

Expand All @@ -199,8 +223,8 @@ <h5 class="fw-light">Challenge Settings</h5>
<strong class="text-light-black">Leaderboard Visibility </strong>
</span>
<a class="pointer fs-20" (click)="toggleLeaderboardVisibility()">
<i class="{{ leaderboardVisibility.icon }}" aria-hidden="true"> </i>
</a>&nbsp;&nbsp;&nbsp;&nbsp;
<i class="{{ leaderboardVisibility.icon }}" aria-hidden="true"> </i> </a
>&nbsp;&nbsp;&nbsp;&nbsp;
</div>
</div>
<div class="row margin-bottom-cancel phase-card" *ngIf="selectedPhaseSplit">
Expand Down Expand Up @@ -232,11 +256,10 @@ <h5 class="fw-light">Challenge Settings</h5>
</div>
</div>
</div>

</mat-tab>

<!-- Edit Evaluation Script and Criteria & Worker logs -->
<mat-tab label="Evaluation">
<mat-tab label="Evaluation">
<ng-template matTabContent>
<div class="row settings-section">
<div class="margin-bottom-cancel">
Expand All @@ -251,8 +274,8 @@ <h5 class="w-300">Evaluation script</h5>
<strong class="text-light-black">Evaluation Criteria </strong>
</span>
<a class="pointer fs-16" (click)="editEvaluationCriteria()">
<i class="fa fa-pencil" aria-hidden="true"> </i>
</a>&nbsp;&nbsp;
<i class="fa fa-pencil" aria-hidden="true"> </i> </a
>&nbsp;&nbsp;
<!-- Evaluation Script -->
<span class="fs-16 fw-light">
<strong class="text-light-black">Evaluation Script </strong>
Expand Down Expand Up @@ -303,7 +326,6 @@ <h5 class="w-300">Submission worker logs</h5>
</div>
</ng-template>
</mat-tab>

</mat-tab-group>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ input {
border-bottom: none;
}

p {
margin:0px 0px 25px 0px;
}

:host ::ng-deep .mat-tab-label .mat-tab-label-content{
font-weight: $fw-light !important;
font-size: $fs-16 !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,26 +111,6 @@ export class ChallengesettingsComponent implements OnInit, OnDestroy {
* 3 -> public
*/
isPhaseSplitLeaderboardPublic: number = 1;

/**
* Leaderboard precision value
*/
leaderboardPrecisionValue = 2;

/**
* Set leaderboard precision value
*/
setLeaderboardPrecisionValue = '1.2-2';

/**
* If leaderboard precision value is equal to 0
*/
minusDisabled = false;

/**
* If leaderboard precision value is equal to 20
*/
plusDisabled = false;

/**
* store worker logs
Expand Down Expand Up @@ -750,6 +730,19 @@ export class ChallengesettingsComponent implements OnInit, OnDestroy {
};
}

showCliInstructions() {
const SELF = this;
/**
* Parameters of the modal
*/
const PARAMS = {
title: 'Instructions',
label: 'evaluation_details',
isCliInstructions: true
};
SELF.globalService.showModal(PARAMS);
}

/**
* Edit Phase Details function
*/
Expand Down Expand Up @@ -934,6 +927,52 @@ export class ChallengesettingsComponent implements OnInit, OnDestroy {
}
}

/**
* Edit test annotations of the phase
*/
editTestAnnotations() {
const SELF = this;
SELF.apiCall = (params) => {
const FORM_DATA: FormData = new FormData();
FORM_DATA.append('test_annotation', params['test_annotation']);
SELF.apiService
.patchFileUrl(
SELF.endpointsService.updateChallengePhaseDetailsURL(SELF.selectedPhase['challenge'], SELF.selectedPhase['id']),
FORM_DATA
)
.subscribe(
(data) => {
SELF.globalService.showToast('success', 'The test annotations are successfully updated!');
},
(err) => {
SELF.globalService.showToast('error', err);
},
() => this.logger.info('EDIT-TEST-ANNOTATION-FINISHED')
);
};

/**
* Parameters of the modal
*/
const PARAMS = {
title: 'Edit Test Annotations',
confirm: 'Submit',
deny: 'Cancel',
form: [
{
name: 'testAnnotation',
isRequired: true,
label: 'test_annotation',
placeholder: '',
type: 'file',
value: '',
},
],
confirmCallback: SELF.apiCall,
};
SELF.globalService.showModal(PARAMS);
}

// Edit Leaderboard Details ->

/**
Expand All @@ -952,17 +991,6 @@ export class ChallengesettingsComponent implements OnInit, OnDestroy {
SELF.leaderboardVisibility.state = 'Private';
SELF.leaderboardVisibility.icon = 'fa fa fa-toggle-off grey-text text-darken-1';
}
const API_PATH = SELF.endpointsService.particularChallengePhaseSplitUrl(this.selectedPhaseSplit['id']);
SELF.apiService.getUrl(API_PATH).subscribe(
(data) => {
SELF.leaderboardPrecisionValue = data.leaderboard_decimal_precision;
SELF.setLeaderboardPrecisionValue = `1.${ SELF.leaderboardPrecisionValue }-${ SELF.leaderboardPrecisionValue }`;
},
(err) => {
SELF.globalService.handleApiError(err);
},
() => {}
);
}
}

Expand Down Expand Up @@ -1031,30 +1059,6 @@ export class ChallengesettingsComponent implements OnInit, OnDestroy {
}
}

/**
* Update leaderboard decimal precision value
* @param updatedLeaderboardPrecisionValue new leaderboard precision value
*/
updateLeaderboardDecimalPrecision(updatedLeaderboardPrecisionValue) {
const API_PATH = this.endpointsService.particularChallengePhaseSplitUrl(this.selectedPhaseSplit['id']);
const SELF = this;
SELF.leaderboardPrecisionValue = updatedLeaderboardPrecisionValue;
SELF.setLeaderboardPrecisionValue = '1.' + SELF.leaderboardPrecisionValue + '-' + SELF.leaderboardPrecisionValue;
const BODY = JSON.stringify({
leaderboard_decimal_precision: SELF.leaderboardPrecisionValue,
});
SELF.apiService.patchUrl(API_PATH, BODY).subscribe(
(data) => {
this.minusDisabled = SELF.leaderboardPrecisionValue === 0 ? true : false;
this.plusDisabled = SELF.leaderboardPrecisionValue === 20 ? true : false;
},
(err) => {
SELF.globalService.handleApiError(err, true);
},
() => this.logger.info('EDIT-LEADERBOARD-PRECISION-VALUE-FINISHED')
);
}

// Edit Evaluation Script and Criteria ->

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p class="fs-16">
<strong> Note: </strong> Results are greater than 5k, please use the
<a href="https://eval.ai/api/docs/#operation/get_all_submissions_for_a_challenge"><strong class="blue-text"> get_all_submissions </strong></a> API to download results.
</p>
</p>
</div>
</div>
</div>
Expand Down
Loading