From 9b296d8ee5e1ea990ae3def06a5d4d6af6179a4f Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 14 May 2019 17:26:30 +0200 Subject: [PATCH] MOBILE-2966 quiz: Fix multichoice question broken due to clear option --- src/addon/mod/quiz/pages/player/player.html | 2 +- src/core/question/classes/base-question-component.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/addon/mod/quiz/pages/player/player.html b/src/addon/mod/quiz/pages/player/player.html index 62b15934f..9470bec15 100644 --- a/src/addon/mod/quiz/pages/player/player.html +++ b/src/addon/mod/quiz/pages/player/player.html @@ -135,8 +135,8 @@ - {{ 'core.openinbrowser' | translate }} + diff --git a/src/core/question/classes/base-question-component.ts b/src/core/question/classes/base-question-component.ts index c20654f32..c36375f8b 100644 --- a/src/core/question/classes/base-question-component.ts +++ b/src/core/question/classes/base-question-component.ts @@ -461,6 +461,11 @@ export class CoreQuestionBaseComponent { }, parent = element.parentElement; + if (option.value == '-1') { + // It's the clear choice option, ignore it. + continue; + } + this.question.optionsName = option.name; this.question.disabled = this.question.disabled && element.disabled;