diff --git a/src/core/course/components/format/format.ts b/src/core/course/components/format/format.ts index c378fe847..b6ec4c1de 100644 --- a/src/core/course/components/format/format.ts +++ b/src/core/course/components/format/format.ts @@ -257,14 +257,14 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { let j; for (j = i - 1; j >= 1; j--) { - if (!(this.sections[j].visible === 0 || this.sections[j].uservisible === false) && this.sections[j].hasContent) { + if (this.sections[j].uservisible !== false && this.sections[j].hasContent) { break; } } this.previousSection = j >= 1 ? this.sections[j] : null; for (j = i + 1; j < this.sections.length; j++) { - if (!(this.sections[j].visible === 0 || this.sections[j].uservisible === false) && this.sections[j].hasContent) { + if (this.sections[j].uservisible !== false && this.sections[j].hasContent) { break; } } diff --git a/src/core/course/components/module/core-course-module.html b/src/core/course/components/module/core-course-module.html index 7780f423f..d5c91e4d1 100644 --- a/src/core/course/components/module/core-course-module.html +++ b/src/core/course/components/module/core-course-module.html @@ -30,11 +30,12 @@ -
+
{{ 'core.course.hiddenfromstudents' | translate }} + {{ 'core.course.hiddenoncoursepage' | translate }}
diff --git a/src/core/course/lang/en.json b/src/core/course/lang/en.json index b003ae145..e21a91a95 100644 --- a/src/core/course/lang/en.json +++ b/src/core/course/lang/en.json @@ -17,6 +17,7 @@ "errordownloadingsection": "Error downloading section.", "errorgetmodule": "Error getting activity data.", "hiddenfromstudents": "Hidden from students", + "hiddenoncoursepage": "Available but not shown on course page", "nocontentavailable": "No content available at the moment.", "overriddennotice": "Your final grade from this activity was manually adjusted.", "refreshcourse": "Refresh course", diff --git a/src/core/course/pages/section-selector/section-selector.html b/src/core/course/pages/section-selector/section-selector.html index dcdd72a9c..a1d6acde4 100644 --- a/src/core/course/pages/section-selector/section-selector.html +++ b/src/core/course/pages/section-selector/section-selector.html @@ -13,7 +13,7 @@

- {{ 'core.course.nocontentavailable' | translate }} + {{ 'core.course.hiddenfromstudents' | translate }}
diff --git a/src/core/course/pages/section-selector/section-selector.ts b/src/core/course/pages/section-selector/section-selector.ts index ff76889fc..82a4241c8 100644 --- a/src/core/course/pages/section-selector/section-selector.ts +++ b/src/core/course/pages/section-selector/section-selector.ts @@ -47,7 +47,7 @@ export class CoreCourseSectionSelectorPage { * @param {any} section Selected section object. */ selectSection(section: any): void { - if (!(section.visible === 0 || section.uservisible === false)) { + if (section.uservisible !== false) { this.viewCtrl.dismiss(section); } } diff --git a/src/core/course/providers/helper.ts b/src/core/course/providers/helper.ts index 99aed6fd0..859b36fa9 100644 --- a/src/core/course/providers/helper.ts +++ b/src/core/course/providers/helper.ts @@ -151,6 +151,9 @@ export class CoreCourseHelperProvider { module.completionstatus = completionStatus[module.id]; module.completionstatus.courseId = courseId; } + + // Check if the module is stealth. + module.isStealth = !module.visibleoncoursepage || (module.visible && !section.visible); }); });