diff --git a/src/addon/mod/workshop/pages/submission/submission.ts b/src/addon/mod/workshop/pages/submission/submission.ts index aab6470db..245d320ac 100644 --- a/src/addon/mod/workshop/pages/submission/submission.ts +++ b/src/addon/mod/workshop/pages/submission/submission.ts @@ -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. */