diff --git a/scripts/langindex.json b/scripts/langindex.json index 543d7f9ac..28c9b6d7f 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -1452,6 +1452,7 @@ "core.course.activitynotyetviewableremoteaddon": "local_moodlemobileapp", "core.course.activitynotyetviewablesiteupgradeneeded": "local_moodlemobileapp", "core.course.allsections": "local_moodlemobileapp", + "core.course.aria:sectionprogress": "local_moodlemobileapp", "core.course.askadmintosupport": "local_moodlemobileapp", "core.course.availablespace": "local_moodlemobileapp", "core.course.cannotdeletewhiledownloading": "local_moodlemobileapp", diff --git a/src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html b/src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html index d1965e2f9..c5b90ffd9 100644 --- a/src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html +++ b/src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html @@ -11,7 +11,7 @@ {{prefetchCoursesData[selectedFilter].badge}} diff --git a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html index 9939071b8..0f445b464 100644 --- a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html +++ b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html @@ -8,7 +8,7 @@ {{prefetchCoursesData.badge}} diff --git a/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html b/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html index 29b440230..dec6f7412 100644 --- a/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html +++ b/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html @@ -8,7 +8,7 @@ {{prefetchCoursesData.badge}} diff --git a/src/addons/competency/pages/coursecompetencies/coursecompetencies.html b/src/addons/competency/pages/coursecompetencies/coursecompetencies.html index 03d920cf6..091bd1676 100644 --- a/src/addons/competency/pages/coursecompetencies/coursecompetencies.html +++ b/src/addons/competency/pages/coursecompetencies/coursecompetencies.html @@ -22,9 +22,13 @@ - {{ 'addon.competency.xcompetenciesproficientoutofyincourse' | translate: {$a: - {x: competencies.statistics.proficientcompetencycount, y: competencies.statistics.competencycount} } }} - + + {{ 'addon.competency.xcompetenciesproficientoutofyincourse' | translate: {$a: + {x: competencies.statistics.proficientcompetencycount, y: competencies.statistics.competencycount} } }} + + + -

+

{{ 'addon.competency.progress' | translate }}: {{ 'addon.competency.xcompetenciesproficientoutofy' | translate: {$a: {x: plan.proficientcompetencycount, y: plan.competencycount} } }}

+ [text]="plan.proficientcompetencypercentageformatted" + ariaDescribedBy="addon-competency-plan-{{plan.plan.id}}-progress"> +
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 86dbd3f42..55c0b2c4b 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 @@ -85,7 +85,7 @@

{{ progressMessage | translate }}

- +
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 b9f84e270..21180d618 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 @@ -301,7 +301,8 @@

{{ student.fullname }}

- + +
diff --git a/src/addons/mod/lesson/pages/player/player.html b/src/addons/mod/lesson/pages/player/player.html index 21f3668dc..bdf332aef 100644 --- a/src/addons/mod/lesson/pages/player/player.html +++ b/src/addons/mod/lesson/pages/player/player.html @@ -170,8 +170,11 @@ - {{ 'addon.mod_lesson.progresscompleted' | translate:{$a: pageData.progress} }} - + + {{ 'addon.mod_lesson.progresscompleted' | translate:{$a: pageData.progress} }} + + +
@@ -224,8 +227,12 @@ - {{ 'addon.mod_lesson.progresscompleted' | translate:{$a: eolData.progresscompleted.value} }} - + + {{ 'addon.mod_lesson.progresscompleted' | translate:{$a: eolData.progresscompleted.value} }} + + + diff --git a/src/addons/mod/lesson/pages/player/player.page.ts b/src/addons/mod/lesson/pages/player/player.page.ts index 0f3d01787..1a014068c 100644 --- a/src/addons/mod/lesson/pages/player/player.page.ts +++ b/src/addons/mod/lesson/pages/player/player.page.ts @@ -98,8 +98,8 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave { loadingMenu?: boolean; // Whether the lesson menu is being loaded. mediaFile?: CoreWSExternalFile; // Media file of the lesson. activityLink?: AddonModLessonActivityLink; // Next activity link data. + cmId!: number; // Course module ID. - protected cmId!: number; // Course module ID. protected password?: string; // Lesson password (if any). protected forceLeave = false; // If true, don't perform any check when leaving the view. protected offline?: boolean; // Whether we are in offline mode. diff --git a/src/addons/mod/lesson/pages/user-retake/user-retake.html b/src/addons/mod/lesson/pages/user-retake/user-retake.html index 77900e473..0684f5507 100644 --- a/src/addons/mod/lesson/pages/user-retake/user-retake.html +++ b/src/addons/mod/lesson/pages/user-retake/user-retake.html @@ -19,7 +19,7 @@

{{student.fullname}}

- +
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 60c6f6f9a..b5d76b0f0 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 @@ -242,7 +242,8 @@

{{ progressMessage | translate }}

- + +
diff --git a/src/core/components/progress-bar/core-progress-bar.html b/src/core/components/progress-bar/core-progress-bar.html index 7583839a4..90f75d9df 100644 --- a/src/core/components/progress-bar/core-progress-bar.html +++ b/src/core/components/progress-bar/core-progress-bar.html @@ -1,5 +1,9 @@ - + -
{{ 'core.percentagenumber' | translate: {$a: text} }}
+
+ {{ a11yText | translate }} + {{ 'core.percentagenumber' | translate: {$a: text} }} +
diff --git a/src/core/components/progress-bar/progress-bar.ts b/src/core/components/progress-bar/progress-bar.ts index 39267d2f0..615aef875 100644 --- a/src/core/components/progress-bar/progress-bar.ts +++ b/src/core/components/progress-bar/progress-bar.ts @@ -14,6 +14,7 @@ import { Component, Input, OnChanges, SimpleChange, ChangeDetectionStrategy } from '@angular/core'; import { DomSanitizer, SafeStyle } from '@angular/platform-browser'; +import { Translate } from '@singletons'; /** * Component to show a progress bar and its value. @@ -31,7 +32,12 @@ export class CoreProgressBarComponent implements OnChanges { @Input() progress!: number | string; // Percentage from 0 to 100. @Input() text?: string; // Percentage in text to be shown at the right. If not defined, progress will be used. + @Input() a11yText?: string; // Accessibility text to read before the percentage. + @Input() ariaDescribedBy?: string; // ID of the element that described the progress, if any. + width?: SafeStyle; + progressBarValueText?: string; + protected textSupplied = false; constructor(private sanitizer: DomSanitizer) { } @@ -66,6 +72,11 @@ export class CoreProgressBarComponent implements OnChanges { this.width = this.sanitizer.bypassSecurityTrustStyle(this.progress + '%'); } } + + if (changes.text || changes.progress || changes.a11yText) { + this.progressBarValueText = (this.a11yText ? Translate.instant(this.a11yText) + ' ' : '') + + Translate.instant('core.percentagenumber', { $a: this.text }); + } } } diff --git a/src/core/features/course/components/format/core-course-format.html b/src/core/features/course/components/format/core-course-format.html index 9b98dc61d..223fe9458 100644 --- a/src/core/features/course/components/format/core-course-format.html +++ b/src/core/features/course/components/format/core-course-format.html @@ -45,7 +45,8 @@ - + + @@ -159,7 +160,7 @@ {{section.count}} / {{section.total}} diff --git a/src/core/features/course/components/format/format.ts b/src/core/features/course/components/format/format.ts index 4f14cd84b..b756f4ae0 100644 --- a/src/core/features/course/components/format/format.ts +++ b/src/core/features/course/components/format/format.ts @@ -105,6 +105,7 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { progress?: number; sectionSelectorModalOptions: ModalOptions = { component: CoreCourseSectionSelectorComponent, + componentProps: {}, }; protected sectionStatusObserver?: CoreEventObserver; @@ -124,12 +125,6 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { * Component being initialized. */ ngOnInit(): void { - - this.sectionSelectorModalOptions.componentProps = { - course: this.course, - sections: this.sections, - }; - // Listen for section status changes. this.sectionStatusObserver = CoreEvents.on( CoreEvents.SECTION_STATUS_CHANGED, @@ -187,6 +182,8 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { */ ngOnChanges(changes: { [name: string]: SimpleChange }): void { this.setInputData(); + this.sectionSelectorModalOptions.componentProps!.course = this.course; + this.sectionSelectorModalOptions.componentProps!.sections = this.sections; if (changes.course && this.course) { // Course has changed, try to get the components. diff --git a/src/core/features/course/components/section-selector/section-selector.html b/src/core/features/course/components/section-selector/section-selector.html index 238e1ce58..8d7a051ee 100644 --- a/src/core/features/course/components/section-selector/section-selector.html +++ b/src/core/features/course/components/section-selector/section-selector.html @@ -20,7 +20,9 @@

- + + diff --git a/src/core/features/course/lang.json b/src/core/features/course/lang.json index 835de1253..f383e9d84 100644 --- a/src/core/features/course/lang.json +++ b/src/core/features/course/lang.json @@ -3,6 +3,7 @@ "activitynotyetviewableremoteaddon": "Your organisation installed a plugin that is not yet supported.", "activitynotyetviewablesiteupgradeneeded": "Your organisation's Moodle installation needs to be updated.", "allsections": "All sections", + "aria:sectionprogress": "Section progress:", "askadmintosupport": "Contact the site administrator and tell them you want to use this activity with the Moodle Mobile app.", "availablespace": " You currently have about {{available}} free space.", "cannotdeletewhiledownloading": "Files cannot be deleted while the activity is being downloaded. Please wait for the download to finish.", diff --git a/src/core/features/courses/components/course-list-item/core-courses-course-list-item.html b/src/core/features/courses/components/course-list-item/core-courses-course-list-item.html index 83aa9653e..16b4872d8 100644 --- a/src/core/features/courses/components/course-list-item/core-courses-course-list-item.html +++ b/src/core/features/courses/components/course-list-item/core-courses-course-list-item.html @@ -24,7 +24,7 @@

- +

diff --git a/src/core/features/courses/components/course-progress/core-courses-course-progress.html b/src/core/features/courses/components/course-progress/core-courses-course-progress.html index 5599247be..02f3d39e6 100644 --- a/src/core/features/courses/components/course-progress/core-courses-course-progress.html +++ b/src/core/features/courses/components/course-progress/core-courses-course-progress.html @@ -56,7 +56,7 @@
- + diff --git a/src/core/features/courses/pages/my-courses/my-courses.html b/src/core/features/courses/pages/my-courses/my-courses.html index 1fb2aa745..6e7d6f8a6 100644 --- a/src/core/features/courses/pages/my-courses/my-courses.html +++ b/src/core/features/courses/pages/my-courses/my-courses.html @@ -20,7 +20,7 @@ [attr.aria-label]="'core.loading' | translate"> {{downloadAllCoursesBadge}}