MOBILE-3523 workshop: Prefetch assessments forms
parent
8620535d7b
commit
eab3a622ba
|
@ -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) => {
|
||||
|
|
|
@ -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(() => {
|
||||
|
|
|
@ -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);
|
||||
}));
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue