diff --git a/src/addons/mod/assign/components/index/addon-mod-assign-index.html b/src/addons/mod/assign/components/index/addon-mod-assign-index.html index 2382ff0e7..de9b9a462 100644 --- a/src/addons/mod/assign/components/index/addon-mod-assign-index.html +++ b/src/addons/mod/assign/components/index/addon-mod-assign-index.html @@ -30,8 +30,8 @@ - + @@ -148,4 +148,5 @@ - + + diff --git a/src/addons/mod/bigbluebuttonbn/components/index/index.html b/src/addons/mod/bigbluebuttonbn/components/index/index.html index a5a2baeb8..7b5f0aa7b 100644 --- a/src/addons/mod/bigbluebuttonbn/components/index/index.html +++ b/src/addons/mod/bigbluebuttonbn/components/index/index.html @@ -23,8 +23,8 @@ - + @@ -126,5 +126,5 @@ - + diff --git a/src/addons/mod/book/components/index/addon-mod-book-index.html b/src/addons/mod/book/components/index/addon-mod-book-index.html index 247a4b5c7..0789f53c5 100644 --- a/src/addons/mod/book/components/index/addon-mod-book-index.html +++ b/src/addons/mod/book/components/index/addon-mod-book-index.html @@ -24,8 +24,8 @@ - + @@ -56,5 +56,5 @@ - + diff --git a/src/addons/mod/chat/components/index/addon-mod-chat-index.html b/src/addons/mod/chat/components/index/addon-mod-chat-index.html index 046853afd..d9106e2bf 100644 --- a/src/addons/mod/chat/components/index/addon-mod-chat-index.html +++ b/src/addons/mod/chat/components/index/addon-mod-chat-index.html @@ -27,8 +27,8 @@ - + @@ -48,5 +48,5 @@ - + diff --git a/src/addons/mod/choice/components/index/addon-mod-choice-index.html b/src/addons/mod/choice/components/index/addon-mod-choice-index.html index 4d291227e..730623b79 100644 --- a/src/addons/mod/choice/components/index/addon-mod-choice-index.html +++ b/src/addons/mod/choice/components/index/addon-mod-choice-index.html @@ -29,8 +29,8 @@ - + @@ -155,7 +155,7 @@ - + diff --git a/src/addons/mod/data/components/index/addon-mod-data-index.html b/src/addons/mod/data/components/index/addon-mod-data-index.html index 1bb70403b..c33a3a94a 100644 --- a/src/addons/mod/data/components/index/addon-mod-data-index.html +++ b/src/addons/mod/data/components/index/addon-mod-data-index.html @@ -39,8 +39,8 @@ - + @@ -138,7 +138,7 @@ - + diff --git a/src/addons/mod/feedback/components/index/addon-mod-feedback-index.html b/src/addons/mod/feedback/components/index/addon-mod-feedback-index.html index 685a98db0..f7bde4f52 100644 --- a/src/addons/mod/feedback/components/index/addon-mod-feedback-index.html +++ b/src/addons/mod/feedback/components/index/addon-mod-feedback-index.html @@ -29,8 +29,8 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/src/addons/mod/folder/components/index/addon-mod-folder-index.html b/src/addons/mod/folder/components/index/addon-mod-folder-index.html index 6c8d1aaeb..adceb5976 100644 --- a/src/addons/mod/folder/components/index/addon-mod-folder-index.html +++ b/src/addons/mod/folder/components/index/addon-mod-folder-index.html @@ -26,8 +26,8 @@ - + 0)"> @@ -49,5 +49,5 @@ - + diff --git a/src/addons/mod/forum/components/index/index.html b/src/addons/mod/forum/components/index/index.html index 09e94eb1a..eebda708e 100644 --- a/src/addons/mod/forum/components/index/index.html +++ b/src/addons/mod/forum/components/index/index.html @@ -38,9 +38,8 @@ - + {{descriptionNote}} @@ -140,7 +139,8 @@ - + diff --git a/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html b/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html index d6f12a61e..a3437f70d 100644 --- a/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html +++ b/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html @@ -50,8 +50,8 @@ - + 0"> @@ -96,7 +96,8 @@ - + diff --git a/src/addons/mod/h5pactivity/components/index/addon-mod-h5pactivity-index.html b/src/addons/mod/h5pactivity/components/index/addon-mod-h5pactivity-index.html index 300b5feb7..26790f9c0 100644 --- a/src/addons/mod/h5pactivity/components/index/addon-mod-h5pactivity-index.html +++ b/src/addons/mod/h5pactivity/components/index/addon-mod-h5pactivity-index.html @@ -36,8 +36,8 @@ - + @@ -85,5 +85,5 @@ - + diff --git a/src/addons/mod/imscp/components/index/addon-mod-imscp-index.html b/src/addons/mod/imscp/components/index/addon-mod-imscp-index.html index 056553b9f..4a92470fb 100644 --- a/src/addons/mod/imscp/components/index/addon-mod-imscp-index.html +++ b/src/addons/mod/imscp/components/index/addon-mod-imscp-index.html @@ -29,7 +29,7 @@ - + @@ -46,5 +46,5 @@ - + diff --git a/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html b/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html index 0219bef8c..0f1de12a2 100644 --- a/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html +++ b/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html @@ -33,8 +33,8 @@ - + @@ -298,5 +298,5 @@ - + diff --git a/src/addons/mod/lti/components/index/addon-mod-lti-index.html b/src/addons/mod/lti/components/index/addon-mod-lti-index.html index 20cf1a86e..9430ef52b 100644 --- a/src/addons/mod/lti/components/index/addon-mod-lti-index.html +++ b/src/addons/mod/lti/components/index/addon-mod-lti-index.html @@ -20,9 +20,8 @@ - + @@ -33,5 +32,5 @@ - + diff --git a/src/addons/mod/page/components/index/addon-mod-page-index.html b/src/addons/mod/page/components/index/addon-mod-page-index.html index 078f5c5c9..1c8cab9ed 100644 --- a/src/addons/mod/page/components/index/addon-mod-page-index.html +++ b/src/addons/mod/page/components/index/addon-mod-page-index.html @@ -26,8 +26,8 @@ - + @@ -49,5 +49,5 @@ - + diff --git a/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html b/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html index 5d39ece10..dffa76b76 100644 --- a/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html +++ b/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html @@ -29,9 +29,8 @@ - + @@ -227,5 +226,5 @@ - + diff --git a/src/addons/mod/resource/components/index/addon-mod-resource-index.html b/src/addons/mod/resource/components/index/addon-mod-resource-index.html index 9638db04e..e0f1279be 100644 --- a/src/addons/mod/resource/components/index/addon-mod-resource-index.html +++ b/src/addons/mod/resource/components/index/addon-mod-resource-index.html @@ -21,7 +21,7 @@ - @@ -61,5 +61,5 @@ - + diff --git a/src/addons/mod/scorm/components/index/addon-mod-scorm-index.html b/src/addons/mod/scorm/components/index/addon-mod-scorm-index.html index 37ae91bfa..aeb744521 100644 --- a/src/addons/mod/scorm/components/index/addon-mod-scorm-index.html +++ b/src/addons/mod/scorm/components/index/addon-mod-scorm-index.html @@ -29,8 +29,8 @@ - + @@ -237,5 +237,5 @@ - + diff --git a/src/addons/mod/survey/components/index/addon-mod-survey-index.html b/src/addons/mod/survey/components/index/addon-mod-survey-index.html index 345c10b5a..99a46962c 100644 --- a/src/addons/mod/survey/components/index/addon-mod-survey-index.html +++ b/src/addons/mod/survey/components/index/addon-mod-survey-index.html @@ -30,9 +30,8 @@ - + @@ -148,5 +147,5 @@ - + diff --git a/src/addons/mod/url/components/index/addon-mod-url-index.html b/src/addons/mod/url/components/index/addon-mod-url-index.html index 7026fddf3..24f4579bd 100644 --- a/src/addons/mod/url/components/index/addon-mod-url-index.html +++ b/src/addons/mod/url/components/index/addon-mod-url-index.html @@ -16,8 +16,8 @@ - + @@ -53,5 +53,5 @@ - + diff --git a/src/addons/mod/wiki/components/index/addon-mod-wiki-index.html b/src/addons/mod/wiki/components/index/addon-mod-wiki-index.html index 9d9fdf7fb..7db05d66b 100644 --- a/src/addons/mod/wiki/components/index/addon-mod-wiki-index.html +++ b/src/addons/mod/wiki/components/index/addon-mod-wiki-index.html @@ -48,8 +48,8 @@ - + @@ -89,7 +89,7 @@ - + diff --git a/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html b/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html index 8a5e5543d..a5a979a6f 100644 --- a/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html +++ b/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html @@ -30,7 +30,7 @@ - + @@ -254,5 +254,5 @@ - + diff --git a/src/core/features/course/components/module-info/core-course-module-info.html b/src/core/features/course/components/module-info/core-course-module-info.html index 66eb61541..88060b6ca 100644 --- a/src/core/features/course/components/module-info/core-course-module-info.html +++ b/src/core/features/course/components/module-info/core-course-module-info.html @@ -19,21 +19,12 @@ - + + - - - - {{ date.label }} {{ date.timestamp * 1000 | coreFormatDate:'strftimedatetime' }} - - - - - - + + {{ date.label }} {{ date.timestamp * 1000 | coreFormatDate:'strftimedatetime' }} + diff --git a/src/core/features/course/components/module-info/module-info.ts b/src/core/features/course/components/module-info/module-info.ts index 43fbe8ec4..f57b95e7e 100644 --- a/src/core/features/course/components/module-info/module-info.ts +++ b/src/core/features/course/components/module-info/module-info.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { CoreCourse } from '@features/course/services/course'; -import { CoreCourseModuleData, CoreCourseModuleCompletionData } from '@features/course/services/course-helper'; +import { CoreCourseModuleData } from '@features/course/services/course-helper'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; import { CoreSites } from '@services/sites'; @@ -36,7 +36,6 @@ import { CoreSites } from '@services/sites'; export class CoreCourseModuleInfoComponent implements OnInit { @Input() module!: CoreCourseModuleData; // The module to render. - @Input() showManualCompletion = true; // Whether to show manual completion, true by default. @Input() courseId!: number; // The courseId the module belongs to. @Input() component!: string; // Component for format text directive. @@ -47,8 +46,6 @@ export class CoreCourseModuleInfoComponent implements OnInit { @Input() hasDataToSync = false; // If the activity has any data to be synced. - @Output() completionChanged = new EventEmitter(); // Notify when completion changes. - modicon = ''; showCompletion = false; // Whether to show completion. moduleNameTranslated = ''; @@ -60,7 +57,6 @@ export class CoreCourseModuleInfoComponent implements OnInit { this.modicon = await CoreCourseModuleDelegate.getModuleIconSrc(this.module.modname, this.module.modicon, this.module); this.moduleNameTranslated = CoreCourse.translateModuleName(this.module.modname || ''); - this.showCompletion = CoreSites.getRequiredCurrentSite().isVersionGreaterEqualThan('3.11'); } diff --git a/src/core/features/course/components/module-navigation/core-course-module-navigation.html b/src/core/features/course/components/module-navigation/core-course-module-navigation.html index 74fc6f584..7d0fde92d 100644 --- a/src/core/features/course/components/module-navigation/core-course-module-navigation.html +++ b/src/core/features/course/components/module-navigation/core-course-module-navigation.html @@ -6,6 +6,14 @@ + + + + + diff --git a/src/core/features/course/components/module-navigation/module-navigation.ts b/src/core/features/course/components/module-navigation/module-navigation.ts index fa326b1c7..6da81c2f4 100644 --- a/src/core/features/course/components/module-navigation/module-navigation.ts +++ b/src/core/features/course/components/module-navigation/module-navigation.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, ElementRef, Input, OnDestroy, OnInit } from '@angular/core'; +import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { CoreCourse, CoreCourseProvider, CoreCourseWSSection } from '@features/course/services/course'; -import { CoreCourseModuleData } from '@features/course/services/course-helper'; +import { CoreCourseModuleCompletionData, CoreCourseModuleData } from '@features/course/services/course-helper'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; import { IonContent } from '@ionic/angular'; import { ScrollDetail } from '@ionic/core'; @@ -29,7 +29,7 @@ import { CoreMath } from '@singletons/math'; * Component to show a button to go to the next resource/activity. * * Example usage: - * + * */ @Component({ selector: 'core-course-module-navigation', @@ -39,13 +39,17 @@ import { CoreMath } from '@singletons/math'; export class CoreCourseModuleNavigationComponent implements OnInit, OnDestroy { @Input() courseId!: number; // Course ID. - @Input() currentModuleId!: number; // Current module ID. + @Input() currentModule!: CoreCourseModuleData; // Current module. + @Input() showManualCompletion = true; // Whether to show manual completion, true by default. + + @Output() completionChanged = new EventEmitter(); // Notify when completion changes. nextModule?: CoreCourseModuleData; previousModule?: CoreCourseModuleData; nextModuleSection?: CoreCourseWSSection; previousModuleSection?: CoreCourseWSSection; loaded = false; + showCompletion = false; // Whether to show completion. protected element: HTMLElement; protected initialHeight = 0; @@ -78,6 +82,8 @@ export class CoreCourseModuleNavigationComponent implements OnInit, OnDestroy { * @inheritdoc */ async ngOnInit(): Promise { + this.showCompletion = CoreSites.getRequiredCurrentSite().isVersionGreaterEqualThan('3.11'); + try { await this.setNextAndPreviousModules(CoreSitesReadingStrategy.PREFER_CACHE); } finally { @@ -172,6 +178,7 @@ export class CoreCourseModuleNavigationComponent implements OnInit, OnDestroy { } const preSets = CoreSites.getReadingStrategyPreSets(readingStrategy); + const currentModuleId = this.currentModule.id; const sections = await CoreCourse.getSections(this.courseId, false, true, preSets); @@ -184,7 +191,7 @@ export class CoreCourseModuleNavigationComponent implements OnInit, OnDestroy { return false; } - currentModuleIndex = section.modules.findIndex((module: CoreCourseModuleData) => module.id == this.currentModuleId); + currentModuleIndex = section.modules.findIndex((module: CoreCourseModuleData) => module.id == currentModuleId); return currentModuleIndex >= 0; }); diff --git a/src/core/features/course/pages/module-preview/module-preview.html b/src/core/features/course/pages/module-preview/module-preview.html index 8f352f3b5..711f8c740 100644 --- a/src/core/features/course/pages/module-preview/module-preview.html +++ b/src/core/features/course/pages/module-preview/module-preview.html @@ -25,8 +25,7 @@ + [componentId]="module.id" [expandDescription]="true"> @@ -61,5 +60,6 @@ - + diff --git a/src/core/features/siteplugins/components/module-index/core-siteplugins-module-index.html b/src/core/features/siteplugins/components/module-index/core-siteplugins-module-index.html index ac5c6b837..89dfe24d8 100644 --- a/src/core/features/siteplugins/components/module-index/core-siteplugins-module-index.html +++ b/src/core/features/siteplugins/components/module-index/core-siteplugins-module-index.html @@ -30,4 +30,5 @@ (onLoadingContent)="contentLoading()"> - + +
- {{ date.label }} {{ date.timestamp * 1000 | coreFormatDate:'strftimedatetime' }} -
+ {{ date.label }} {{ date.timestamp * 1000 | coreFormatDate:'strftimedatetime' }} +