From 8d540e6010ec7b01646f0b4a6268f366fc16dc87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 25 Feb 2022 09:25:35 +0100 Subject: [PATCH] MOBILE-3149 choice: Collapse list of users in results --- .../index/addon-mod-choice-index.html | 22 ++++++++++++------- .../mod/choice/components/index/index.ts | 10 +++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) 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 6ef6a30cc..f5620647c 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 @@ -96,7 +96,11 @@ - + +

- - - - -

{{user.fullname}}

-
+ + + + +

{{user.fullname}}

+
+
+
diff --git a/src/addons/mod/choice/components/index/index.ts b/src/addons/mod/choice/components/index/index.ts index 2597bde19..a43fc8c58 100644 --- a/src/addons/mod/choice/components/index/index.ts +++ b/src/addons/mod/choice/components/index/index.ts @@ -446,6 +446,15 @@ export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityCo } } + /** + * Toggle list of users in a result visible. + * + * @param result Result to expand. + */ + toggle(result: AddonModChoiceResultFormatted): void { + result.expanded = !result.expanded; + } + /** * Performs the sync of the activity. * @@ -472,4 +481,5 @@ export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityCo */ export type AddonModChoiceResultFormatted = AddonModChoiceResult & { percentageamountfixed: string; // Percentage of users answers with fixed decimals. + expanded?: boolean; };