From 540141bad55b2aa6f70094a1f50985611c99b4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 25 Feb 2022 10:54:23 +0100 Subject: [PATCH] MOBILE-3149 scorm: Collapse grades on scorm page --- .../index/addon-mod-scorm-index.html | 35 ++++++++++++------- .../mod/scorm/components/index/index.ts | 8 +++++ 2 files changed, 31 insertions(+), 12 deletions(-) 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 49c22490a..f3dc13496 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 @@ -31,7 +31,7 @@ -

{{ 'addon.mod_scorm.noattemptsallowed' | translate }}

+

{{ 'addon.mod_scorm.noattemptsallowed' | translate }}

{{ 'core.unlimited' | translate }} @@ -40,23 +40,34 @@ -

{{ 'addon.mod_scorm.noattemptsmade' | translate }}

+

{{ 'addon.mod_scorm.noattemptsmade' | translate }}

{{ numAttempts }}

- + + -

{{ 'addon.mod_scorm.gradeforattempt' | translate }} {{attempt.num}}

+

{{'core.grades.grades' | translate}}

-

- {{ attempt.gradeFormatted }} - {{ 'addon.mod_scorm.cannotcalculategrade' | translate }} -

+ + + +

{{ 'addon.mod_scorm.gradeforattempt' | translate }} {{attempt.num}}

+
+

+ {{ attempt.gradeFormatted }} + {{ 'addon.mod_scorm.cannotcalculategrade' | translate }} +

+
+
-

{{ 'addon.mod_scorm.gradeforattempt' | translate }} {{attempt.num}}

+

{{ 'addon.mod_scorm.gradeforattempt' | translate }} {{attempt.num}}

{{ 'addon.mod_scorm.offlineattemptnote' | translate }}

@@ -71,13 +82,13 @@
-

{{ 'addon.mod_scorm.grademethod' | translate }}

+

{{ 'addon.mod_scorm.grademethod' | translate }}

{{ gradeMethodReadable }}

-

{{ 'addon.mod_scorm.gradereported' | translate }}

+

{{ 'addon.mod_scorm.gradereported' | translate }}

{{ gradeFormatted }} @@ -86,7 +97,7 @@ -

{{ 'core.lastsync' | translate }}

+

{{ 'core.lastsync' | translate }}

{{ syncTime }}

diff --git a/src/addons/mod/scorm/components/index/index.ts b/src/addons/mod/scorm/components/index/index.ts index 88dd7b2c8..fcfa22b41 100644 --- a/src/addons/mod/scorm/components/index/index.ts +++ b/src/addons/mod/scorm/components/index/index.ts @@ -81,6 +81,7 @@ export class AddonModScormIndexComponent extends CoreCourseModuleMainActivityCom attemptsLeft = -1; // Number of attempts left. onlineAttempts: AttemptGrade[] = []; // Grades for online attempts. offlineAttempts: AttemptGrade[] = []; // Grades for offline attempts. + gradesExpanded = false; protected fetchContentDefaultError = 'addon.mod_scorm.errorgetscorm'; // Default error to show when loading contents. protected syncEventName = AddonModScormSyncProvider.AUTO_SYNCED; @@ -523,6 +524,13 @@ export class AddonModScormIndexComponent extends CoreCourseModuleMainActivityCom } } + /** + * Toggle list of grades. + */ + toggleGrades(): void { + this.gradesExpanded = !this.gradesExpanded; + } + /** * Open a SCORM package. *