diff --git a/src/addon/mod/workshop/components/assessment/assessment.ts b/src/addon/mod/workshop/components/assessment/assessment.ts index 4aafdd625..b7a13569f 100644 --- a/src/addon/mod/workshop/components/assessment/assessment.ts +++ b/src/addon/mod/workshop/components/assessment/assessment.ts @@ -113,7 +113,7 @@ export class AddonModWorkshopAssessmentComponent implements OnInit { }; if (!this.submission) { - const modal = this.domUtils.showModalLoading('core.sending', true); + const modal = this.domUtils.showModalLoading(); this.workshopHelper.getSubmissionById(this.workshop.id, this.assessment.submissionid, {cmId: this.workshop.coursemodule}).then((submissionData) => { diff --git a/src/addon/mod/workshop/providers/helper.ts b/src/addon/mod/workshop/providers/helper.ts index 7adf38209..5ef4d8f8f 100644 --- a/src/addon/mod/workshop/providers/helper.ts +++ b/src/addon/mod/workshop/providers/helper.ts @@ -189,10 +189,14 @@ export class AddonModWorkshopHelperProvider { options.siteId = options.siteId || this.sitesProvider.getCurrentSiteId(); return this.workshopProvider.getReviewerAssessments(workshopId, options).then((assessments) => { - const promises = assessments.map((assessment) => { - return this.getSubmissionById(workshopId, assessment.submissionid, options).then((submission) => { + const promises = []; + assessments.forEach((assessment) => { + promises.push(this.getSubmissionById(workshopId, assessment.submissionid, options).then((submission) => { assessment.submission = submission; - }); + })); + promises.push(this.workshopProvider.getAssessmentForm(workshopId, assessment.id, options).then((assessmentForm) => { + assessment.form = assessmentForm; + })); }); return Promise.all(promises).then(() => { diff --git a/src/addon/mod/workshop/providers/prefetch-handler.ts b/src/addon/mod/workshop/providers/prefetch-handler.ts index 9f69bb7d0..c189a9f60 100644 --- a/src/addon/mod/workshop/providers/prefetch-handler.ts +++ b/src/addon/mod/workshop/providers/prefetch-handler.ts @@ -142,6 +142,11 @@ export class AddonModWorkshopPrefetchHandler extends CoreCourseActivityPrefetchH files = files.concat(assessment.feedbackattachmentfiles) .concat(assessment.feedbackcontentfiles); }); + if (workshop.phase >= AddonModWorkshopProvider.PHASE_ASSESSMENT && canAssess) { + return Promise.all(assessments.map((assessment) => { + return this.workshopHelper.getReviewerAssessmentById(workshop.id, assessment.id); + })); + } })); });