From 8f461adf74661bf9eba1d7304c4b4c04e2d77cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 14 May 2024 14:55:06 +0200 Subject: [PATCH] MOBILE-4470 choice: Fix messages shown on the app --- scripts/langindex.json | 4 +- src/addons/mod/choice/choice.module.ts | 4 +- .../index/addon-mod-choice-index.html | 49 +++++----- .../mod/choice/components/index/index.ts | 90 ++++++++++--------- src/addons/mod/choice/constants.ts | 29 ++++++ src/addons/mod/choice/lang.json | 4 +- src/addons/mod/choice/services/choice-sync.ts | 5 +- src/addons/mod/choice/services/choice.ts | 70 +++++++++------ .../mod/choice/services/handlers/prefetch.ts | 7 +- 9 files changed, 158 insertions(+), 104 deletions(-) create mode 100644 src/addons/mod/choice/constants.ts diff --git a/scripts/langindex.json b/scripts/langindex.json index fa870638e..08019c959 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -524,15 +524,13 @@ "addon.mod_choice.cannotsubmit": "choice", "addon.mod_choice.choiceoptions": "choice", "addon.mod_choice.errorgetchoice": "local_moodlemobileapp", - "addon.mod_choice.expired": "choice", "addon.mod_choice.full": "choice", "addon.mod_choice.limita": "choice", "addon.mod_choice.modulenameplural": "choice", "addon.mod_choice.noresultsviewable": "choice", - "addon.mod_choice.notopenyet": "choice", "addon.mod_choice.numberofuser": "choice", "addon.mod_choice.numberofuserinpercentage": "choice", - "addon.mod_choice.previewonly": "choice", + "addon.mod_choice.previewing": "choice", "addon.mod_choice.publishinfoanonafter": "choice", "addon.mod_choice.publishinfoanonclose": "choice", "addon.mod_choice.publishinfofullafter": "choice", diff --git a/src/addons/mod/choice/choice.module.ts b/src/addons/mod/choice/choice.module.ts index dbf056f0f..b09b8ab97 100644 --- a/src/addons/mod/choice/choice.module.ts +++ b/src/addons/mod/choice/choice.module.ts @@ -22,13 +22,13 @@ import { CoreCourseModulePrefetchDelegate } from '@features/course/services/modu import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModChoiceProvider } from './services/choice'; import { OFFLINE_SITE_SCHEMA } from './services/database/choice'; import { AddonModChoiceIndexLinkHandler } from './services/handlers/index-link'; import { AddonModChoiceListLinkHandler } from './services/handlers/list-link'; import { AddonModChoiceModuleHandler, AddonModChoiceModuleHandlerService } from './services/handlers/module'; import { AddonModChoicePrefetchHandler } from './services/handlers/prefetch'; import { AddonModChoiceSyncCronHandler } from './services/handlers/sync-cron'; +import { ADDON_MOD_CHOICE_COMPONENT } from './constants'; const routes: Routes = [ { @@ -57,7 +57,7 @@ const routes: Routes = [ CoreContentLinksDelegate.registerHandler(AddonModChoiceIndexLinkHandler.instance); CoreContentLinksDelegate.registerHandler(AddonModChoiceListLinkHandler.instance); - CoreCourseHelper.registerModuleReminderClick(AddonModChoiceProvider.COMPONENT); + CoreCourseHelper.registerModuleReminderClick(ADDON_MOD_CHOICE_COMPONENT); }, }, ], 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 80374ed11..fd8aa8e1d 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 @@ -12,32 +12,17 @@ [courseId]="courseId" [hasDataToSync]="hasOffline" (completionChanged)="onCompletionChange()" /> - + - - - - - - + - + - + - + + + + + +

{{ 'addon.mod_choice.yourselection' | translate }}

+
+
+ + + + + + + +
+ -
+

{{ 'addon.mod_choice.responses' | translate }}

@@ -115,9 +116,9 @@ -
+ - +