MOBILE-3346 workshop: Show current user assessments when closed
parent
333f3f7188
commit
df906f91e9
|
@ -234,16 +234,16 @@ export class AddonModWorkshopSubmissionPage implements OnInit, OnDestroy {
|
|||
this.canDelete = !assessment;
|
||||
}
|
||||
|
||||
assessment.userid = assessment.reviewerid;
|
||||
assessment = this.workshopHelper.realGradeValue(this.workshop, assessment);
|
||||
|
||||
if (this.currentUserId == assessment.userid) {
|
||||
this.ownAssessment = assessment;
|
||||
assessment.ownAssessment = true;
|
||||
}
|
||||
assessment = this.parseAssessment(assessment);
|
||||
|
||||
this.submissionInfo.reviewedby = [assessment];
|
||||
}));
|
||||
} else if (this.workshop.phase == AddonModWorkshopProvider.PHASE_CLOSED && this.userId == this.currentUserId) {
|
||||
this.workshopProvider.getSubmissionAssessments(this.workshopId, this.submissionId).then((assessments) => {
|
||||
this.submissionInfo.reviewedby = assessments.map((assessment) => {
|
||||
return this.parseAssessment(assessment);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (this.canAddFeedback || this.workshop.phase == AddonModWorkshopProvider.PHASE_CLOSED) {
|
||||
|
@ -324,6 +324,24 @@ export class AddonModWorkshopSubmissionPage implements OnInit, OnDestroy {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse assessment to be shown.
|
||||
*
|
||||
* @param assessment Original assessment.
|
||||
* @return Parsed assessment.
|
||||
*/
|
||||
protected parseAssessment(assessment: any): any {
|
||||
assessment.userid = assessment.reviewerid;
|
||||
assessment = this.workshopHelper.realGradeValue(this.workshop, assessment);
|
||||
|
||||
if (this.currentUserId == assessment.userid) {
|
||||
this.ownAssessment = assessment;
|
||||
assessment.ownAssessment = true;
|
||||
}
|
||||
|
||||
return assessment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Force leaving the page, without checking for changes.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue