From 97bb43604be7f31cac54b59a864ad24af5d60224 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 5 Sep 2018 15:34:40 +0200 Subject: [PATCH 1/8] MOBILE-2567 ios: Fix local notifications in iOS --- config.xml | 2 +- src/providers/local-notifications.ts | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/config.xml b/config.xml index 33e6375ec..36612b734 100644 --- a/config.xml +++ b/config.xml @@ -122,7 +122,7 @@ - + diff --git a/src/providers/local-notifications.ts b/src/providers/local-notifications.ts index 29ea131a2..25e51da9e 100644 --- a/src/providers/local-notifications.ts +++ b/src/providers/local-notifications.ts @@ -497,6 +497,8 @@ export class CoreLocalNotificationsProvider { /** * Show an in app notification popover. + * This function was used because local notifications weren't displayed when the app was in foreground in iOS10+, + * but the issue was fixed in the plugin and this function is no longer used. * * @param {CoreILocalNotification} notification Notification. */ @@ -594,11 +596,6 @@ export class CoreLocalNotificationsProvider { * @return {Promise} Promise resolved when stored, rejected otherwise. */ trigger(notification: CoreILocalNotification): Promise { - if (this.platform.is('ios') && this.platform.version().num >= 10) { - // In iOS10 show in app notification. - this.showNotificationPopover(notification); - } - const entry = { id: notification.id, at: parseInt(notification.at, 10) From 3fe4d02bc155e72734b7f50e1e84993d7933692d Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 6 Sep 2018 12:39:54 +0200 Subject: [PATCH 2/8] MOBILE-2567 quiz: Fix single multichoice without answer --- src/addon/mod/quiz/pages/player/player.scss | 4 ++++ .../qtype/multichoice/providers/handler.ts | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/addon/mod/quiz/pages/player/player.scss b/src/addon/mod/quiz/pages/player/player.scss index 0ee54c698..5766ea400 100644 --- a/src/addon/mod/quiz/pages/player/player.scss +++ b/src/addon/mod/quiz/pages/player/player.scss @@ -7,4 +7,8 @@ ion-app.app-root page-addon-mod-quiz-player { .core-has-fixed-timer form { padding-top: 56px; } + + .toolbar-ios .bar-buttons-ios .bar-button { + @include padding-horizontal($content-padding); + } } \ No newline at end of file diff --git a/src/addon/qtype/multichoice/providers/handler.ts b/src/addon/qtype/multichoice/providers/handler.ts index 8eded4917..b543e3d97 100644 --- a/src/addon/qtype/multichoice/providers/handler.ts +++ b/src/addon/qtype/multichoice/providers/handler.ts @@ -151,4 +151,22 @@ export class AddonQtypeMultichoiceHandler implements CoreQuestionHandler { isSameResponseSingle(prevAnswers: any, newAnswers: any): boolean { return this.utils.sameAtKeyMissingIsBlank(prevAnswers, newAnswers, 'answer'); } + + /** + * Prepare and add to answers the data to send to server based in the input. Return promise if async. + * + * @param {any} question Question. + * @param {any} answers The answers retrieved from the form. Prepared answers must be stored in this object. + * @param {boolean} [offline] Whether the data should be saved in offline. + * @param {string} [siteId] Site ID. If not defined, current site. + * @return {void|Promise} Return a promise resolved when done if async, void if sync. + */ + prepareAnswers(question: any, answers: any, offline: boolean, siteId?: string): void | Promise { + if (question && !question.multi && typeof answers[question.optionsName] != 'undefined' && !answers[question.optionsName]) { + /* It's a single choice and the user hasn't answered. Delete the answer and its sequencecheck because + sending an empty string (default value) will mark the first option as selected. */ + delete answers[question.optionsName]; + delete answers[question.optionsName.replace('answer', ':sequencecheck')]; + } + } } From bd5bdee45d9fcda5b8276326c514af43ed0fada3 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 6 Sep 2018 12:44:09 +0200 Subject: [PATCH 3/8] MOBILE-2567 core: Bump version number --- config.xml | 2 +- src/config.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.xml b/config.xml index 36612b734..8f99bd079 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + Moodle Moodle official app Moodle Mobile team diff --git a/src/config.json b/src/config.json index 80abf6de7..27634fc6f 100644 --- a/src/config.json +++ b/src/config.json @@ -2,8 +2,8 @@ "app_id" : "com.moodle.moodlemobile", "appname": "Moodle Mobile", "desktopappname": "Moodle Desktop", - "versioncode" : 3510, - "versionname" : "3.5.1", + "versioncode" : 3520, + "versionname" : "3.5.2", "cache_expiration_time" : 300000, "default_lang" : "en", "languages": {"ar": "عربي", "bg": "Български", "ca": "Català", "cs": "Čeština", "da": "Dansk", "de": "Deutsch", "de-du": "Deutsch - Du", "el": "Ελληνικά", "en": "English", "es": "Español", "es-mx": "Español - México", "eu": "Euskara", "fa": "فارسی", "fi": "Suomi", "fr" : "Français", "he" : "עברית", "hu": "magyar", "it": "Italiano", "ja": "日本語", "ko" : "한국어", "lt" : "Lietuvių", "mr": "मराठी", "nl": "Nederlands", "pl": "Polski", "pt-br": "Português - Brasil", "pt": "Português - Portugal", "ro": "Română", "ru": "Русский", "sr-cr": "Српски", "sr-lt": "Srpski", "sv": "Svenska", "tr" : "Türkçe", "uk" : "Українська", "zh-cn" : "简体中文", "zh-tw" : "正體中文"}, From c2a471a5070f2232baa67dab426c3c7425ed681c Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 6 Sep 2018 14:53:27 +0200 Subject: [PATCH 4/8] MOBILE-2567 ios: Make save file name icon bigger in iOS --- src/components/local-file/core-local-file.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/local-file/core-local-file.html b/src/components/local-file/core-local-file.html index cad6c9347..fe68564d6 100644 --- a/src/components/local-file/core-local-file.html +++ b/src/components/local-file/core-local-file.html @@ -17,7 +17,7 @@