MOBILE-2735 course: Log view when changing sections
parent
dc5b9875b3
commit
b302ea0d5a
|
@ -82,7 +82,8 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
|
|||
constructor(private cfDelegate: CoreCourseFormatDelegate, translate: TranslateService, private injector: Injector,
|
||||
private courseHelper: CoreCourseHelperProvider, private domUtils: CoreDomUtilsProvider,
|
||||
eventsProvider: CoreEventsProvider, private sitesProvider: CoreSitesProvider, private content: Content,
|
||||
prefetchDelegate: CoreCourseModulePrefetchDelegate, private modalCtrl: ModalController) {
|
||||
prefetchDelegate: CoreCourseModulePrefetchDelegate, private modalCtrl: ModalController,
|
||||
private courseProvider: CoreCourseProvider) {
|
||||
|
||||
this.selectOptions.title = translate.instant('core.course.sections');
|
||||
this.completionChanged = new EventEmitter();
|
||||
|
@ -335,6 +336,13 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
|
|||
} else {
|
||||
this.domUtils.scrollToTop(this.content, 0);
|
||||
}
|
||||
|
||||
if (!previousValue || previousValue.id != newSection.id) {
|
||||
// First load or section changed, add log in Moodle.
|
||||
this.courseProvider.logView(this.course.id, newSection.section, undefined, this.course.fullname).catch(() => {
|
||||
// Ignore errors.
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -234,11 +234,6 @@ export class CoreCourseSectionPage implements OnDestroy {
|
|||
}).then((sections) => {
|
||||
let promise;
|
||||
|
||||
// Add log in Moodle.
|
||||
this.courseProvider.logView(this.course.id, this.sectionNumber, undefined, this.course.fullname).catch(() => {
|
||||
// Ignore errors.
|
||||
});
|
||||
|
||||
// Get the completion status.
|
||||
if (this.course.enablecompletion === false) {
|
||||
// Completion not enabled.
|
||||
|
|
Loading…
Reference in New Issue