MOBILE-2675 offline: Ignore errors when logging actions
parent
d2c82f25dd
commit
5b403129cd
|
@ -54,9 +54,14 @@ export class AddonCompetencyCompetencyPage {
|
||||||
ionViewDidLoad(): void {
|
ionViewDidLoad(): void {
|
||||||
this.fetchCompetency().then(() => {
|
this.fetchCompetency().then(() => {
|
||||||
if (this.planId) {
|
if (this.planId) {
|
||||||
this.competencyProvider.logCompetencyInPlanView(this.planId, this.competencyId, this.planStatus, this.userId);
|
this.competencyProvider.logCompetencyInPlanView(this.planId, this.competencyId, this.planStatus, this.userId)
|
||||||
|
.catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.competencyProvider.logCompetencyInCourseView(this.courseId, this.competencyId, this.userId);
|
this.competencyProvider.logCompetencyInCourseView(this.courseId, this.competencyId, this.userId).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.competencyLoaded = true;
|
this.competencyLoaded = true;
|
||||||
|
|
|
@ -41,7 +41,9 @@ export class AddonCompetencyCompetencySummaryPage {
|
||||||
*/
|
*/
|
||||||
ionViewDidLoad(): void {
|
ionViewDidLoad(): void {
|
||||||
this.fetchCompetency().then(() => {
|
this.fetchCompetency().then(() => {
|
||||||
this.competencyProvider.logCompetencyView(this.competencyId);
|
this.competencyProvider.logCompetencyView(this.competencyId).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
|
});
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.competencyLoaded = true;
|
this.competencyLoaded = true;
|
||||||
});
|
});
|
||||||
|
|
|
@ -168,6 +168,8 @@ export class AddonModBookIndexComponent extends CoreCourseModuleMainResourceComp
|
||||||
if (!this.nextChapter) {
|
if (!this.nextChapter) {
|
||||||
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
||||||
}
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.domUtils.showErrorModalDefault(error, 'addon.mod_book.errorchapter', true);
|
this.domUtils.showErrorModalDefault(error, 'addon.mod_book.errorchapter', true);
|
||||||
|
|
|
@ -49,6 +49,8 @@ export class AddonModChatIndexComponent extends CoreCourseModuleMainActivityComp
|
||||||
this.loadContent().then(() => {
|
this.loadContent().then(() => {
|
||||||
this.chatProvider.logView(this.chat.id).then(() => {
|
this.chatProvider.logView(this.chat.id).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,8 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp
|
||||||
|
|
||||||
this.dataProvider.logView(this.data.id).then(() => {
|
this.dataProvider.logView(this.data.id).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,9 @@ export class AddonModFeedbackIndexComponent extends CoreCourseModuleMainActivity
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
|
|
||||||
this.loadContent(false, true).then(() => {
|
this.loadContent(false, true).then(() => {
|
||||||
this.feedbackProvider.logView(this.feedback.id);
|
this.feedbackProvider.logView(this.feedback.id).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
|
});
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.tabsReady = true;
|
this.tabsReady = true;
|
||||||
});
|
});
|
||||||
|
|
|
@ -96,6 +96,8 @@ export class AddonModFeedbackFormPage implements OnDestroy {
|
||||||
this.fetchData().then(() => {
|
this.fetchData().then(() => {
|
||||||
this.feedbackProvider.logView(this.feedback.id, true).then(() => {
|
this.feedbackProvider.logView(this.feedback.id, true).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,8 @@ export class AddonModFolderIndexComponent extends CoreCourseModuleMainResourceCo
|
||||||
this.loadContent().then(() => {
|
this.loadContent().then(() => {
|
||||||
this.folderProvider.logView(this.module.instance).then(() => {
|
this.folderProvider.logView(this.module.instance).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
|
|
|
@ -48,7 +48,9 @@ export class AddonModGlossaryEntryPage {
|
||||||
*/
|
*/
|
||||||
ionViewDidLoad(): void {
|
ionViewDidLoad(): void {
|
||||||
this.fetchEntry().then(() => {
|
this.fetchEntry().then(() => {
|
||||||
this.glossaryProvider.logEntryView(this.entry.id);
|
this.glossaryProvider.logEntryView(this.entry.id).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
|
});
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
});
|
});
|
||||||
|
|
|
@ -54,6 +54,8 @@ export class AddonModImscpIndexComponent extends CoreCourseModuleMainResourceCom
|
||||||
this.loadContent().then(() => {
|
this.loadContent().then(() => {
|
||||||
this.imscpProvider.logView(this.module.instance).then(() => {
|
this.imscpProvider.logView(this.module.instance).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,8 @@ export class AddonModPageIndexComponent extends CoreCourseModuleMainResourceComp
|
||||||
this.loadContent().then(() => {
|
this.loadContent().then(() => {
|
||||||
this.pageProvider.logView(this.module.instance).then(() => {
|
this.pageProvider.logView(this.module.instance).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,8 @@ export class AddonModResourceIndexComponent extends CoreCourseModuleMainResource
|
||||||
this.loadContent().then(() => {
|
this.loadContent().then(() => {
|
||||||
this.resourceProvider.logView(this.module.instance).then(() => {
|
this.resourceProvider.logView(this.module.instance).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,6 +154,8 @@ export class AddonModResourceHelperProvider {
|
||||||
module.contents).then(() => {
|
module.contents).then(() => {
|
||||||
this.resourceProvider.logView(module.instance).then(() => {
|
this.resourceProvider.logView(module.instance).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(courseId, module.completionstatus);
|
this.courseProvider.checkModuleCompletion(courseId, module.completionstatus);
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.domUtils.showErrorModalDefault(error, 'addon.mod_resource.errorwhileloadingthecontent', true);
|
this.domUtils.showErrorModalDefault(error, 'addon.mod_resource.errorwhileloadingthecontent', true);
|
||||||
|
|
|
@ -55,6 +55,8 @@ export class AddonModSurveyIndexComponent extends CoreCourseModuleMainActivityCo
|
||||||
this.loadContent(false, true).then(() => {
|
this.loadContent(false, true).then(() => {
|
||||||
this.surveyProvider.logView(this.survey.id).then(() => {
|
this.surveyProvider.logView(this.survey.id).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,6 +173,8 @@ export class AddonModUrlIndexComponent extends CoreCourseModuleMainResourceCompo
|
||||||
go(): void {
|
go(): void {
|
||||||
this.urlProvider.logView(this.module.instance).then(() => {
|
this.urlProvider.logView(this.module.instance).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
this.urlHelper.open(this.url);
|
this.urlHelper.open(this.url);
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,6 +164,8 @@ export class AddonModUrlModuleHandler implements CoreCourseModuleHandler {
|
||||||
protected openUrl(module: any, courseId: number): void {
|
protected openUrl(module: any, courseId: number): void {
|
||||||
this.urlProvider.logView(module.instance).then(() => {
|
this.urlProvider.logView(module.instance).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(courseId, module.completionstatus);
|
this.courseProvider.checkModuleCompletion(courseId, module.completionstatus);
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
this.urlHelper.open(module.contents[0].fileurl);
|
this.urlHelper.open(module.contents[0].fileurl);
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,7 +341,9 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp
|
||||||
this.currentPage = data.pageId;
|
this.currentPage = data.pageId;
|
||||||
|
|
||||||
this.showLoadingAndFetch(true, false).then(() => {
|
this.showLoadingAndFetch(true, false).then(() => {
|
||||||
this.wikiProvider.logPageView(this.currentPage);
|
this.wikiProvider.logPageView(this.currentPage).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Stop listening for new page events.
|
// Stop listening for new page events.
|
||||||
|
|
|
@ -132,6 +132,8 @@ export class AddonModWorkshopSubmissionPage implements OnInit, OnDestroy {
|
||||||
this.fetchSubmissionData().then(() => {
|
this.fetchSubmissionData().then(() => {
|
||||||
this.workshopProvider.logViewSubmission(this.submissionId).then(() => {
|
this.workshopProvider.logViewSubmission(this.submissionId).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completionstatus);
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,9 @@ export class AddonNotesListComponent implements OnInit, OnDestroy {
|
||||||
*/
|
*/
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.fetchNotes(true).then(() => {
|
this.fetchNotes(true).then(() => {
|
||||||
this.notesProvider.logView(this.courseId);
|
this.notesProvider.logView(this.courseId).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +130,9 @@ export class AddonNotesListComponent implements OnInit, OnDestroy {
|
||||||
this.refreshIcon = 'spinner';
|
this.refreshIcon = 'spinner';
|
||||||
this.syncIcon = 'spinner';
|
this.syncIcon = 'spinner';
|
||||||
this.fetchNotes(true).then(() => {
|
this.fetchNotes(true).then(() => {
|
||||||
this.notesProvider.logView(this.courseId);
|
this.notesProvider.logView(this.courseId).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,9 @@ export class CoreGradesCourseComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add log in Moodle.
|
// Add log in Moodle.
|
||||||
return this.gradesProvider.logCourseGradesView(this.courseId, this.userId);
|
return this.gradesProvider.logCourseGradesView(this.courseId, this.userId).catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
|
});
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.gradesLoaded = true;
|
this.gradesLoaded = true;
|
||||||
});
|
});
|
||||||
|
|
|
@ -55,7 +55,9 @@ export class CoreGradesCoursesPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add log in Moodle.
|
// Add log in Moodle.
|
||||||
return this.gradesProvider.logCoursesGradesView();
|
return this.gradesProvider.logCoursesGradesView().catch(() => {
|
||||||
|
// Ignore errors.
|
||||||
|
});
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.gradesLoaded = true;
|
this.gradesLoaded = true;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue