commit
ed9f66d3a9
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,11 +30,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="module.visible === 0 || module.availabilityinfo || module.handlerData.extraBadge">
|
||||
<div *ngIf="module.visible === 0 || module.availabilityinfo || module.handlerData.extraBadge || module.isStealth">
|
||||
<ion-badge item-end *ngIf="module.handlerData.extraBadge" [color]="module.handlerData.extraBadgeColor" text-wrap text-start>
|
||||
<core-format-text [text]="module.handlerData.extraBadge"></core-format-text>
|
||||
</ion-badge>
|
||||
<ion-badge item-end *ngIf="module.visible === 0">{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge>
|
||||
<ion-badge item-end *ngIf="module.visible !== 0 && module.isStealth">{{ 'core.course.hiddenoncoursepage' | translate }}</ion-badge>
|
||||
<ion-badge item-end *ngIf="module.availabilityinfo"><core-format-text [text]="module.availabilityinfo"></core-format-text></ion-badge>
|
||||
</div>
|
||||
<core-format-text class="core-module-description" *ngIf="module.description" maxHeight="80" [text]="module.description"></core-format-text>
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<a ion-item *ngIf="section.hasContent" text-wrap (click)="selectSection(section)" [class.core-primary-item]="selected.id == section.id" [class.item-dimmed]="section.visible === 0 || section.uservisible === false" detail-none>
|
||||
<core-icon name="fa-folder" item-start></core-icon>
|
||||
<h2><core-format-text [text]="section.formattedName || section.name"></core-format-text></h2>
|
||||
<ion-badge color="secondary" *ngIf="section.visible === 0">{{ 'core.course.nocontentavailable' | translate }}</ion-badge>
|
||||
<ion-badge color="secondary" *ngIf="section.visible === 0 && section.uservisible !== false">{{ 'core.course.hiddenfromstudents' | translate }}</ion-badge>
|
||||
<ion-badge color="secondary" *ngIf="section.availabilityinfo"><core-format-text [text]=" section.availabilityinfo"></core-format-text></ion-badge>
|
||||
</a>
|
||||
</ng-container>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue