diff --git a/src/addon/qtype/calculated/providers/handler.ts b/src/addon/qtype/calculated/providers/handler.ts index 22423edb4..0e432658f 100644 --- a/src/addon/qtype/calculated/providers/handler.ts +++ b/src/addon/qtype/calculated/providers/handler.ts @@ -191,7 +191,7 @@ export class AddonQtypeCalculatedHandler implements CoreQuestionHandler { let unitsLeft = false; let match = null; - if (!question.settings) { + if (!question.settings || question.settings.unitsleft === null) { // We don't know if units should be before or after so we check both. match = answer.match(new RegExp('^' + regexString)); if (!match) { diff --git a/src/core/question/classes/base-question-component.ts b/src/core/question/classes/base-question-component.ts index 91a238153..0dbd9df63 100644 --- a/src/core/question/classes/base-question-component.ts +++ b/src/core/question/classes/base-question-component.ts @@ -108,7 +108,7 @@ export class CoreQuestionBaseComponent { this.question.select = selectModel; // Check which one should be displayed first: the select or the input. - if (this.question.settings) { + if (this.question.settings && this.question.settings.unitsleft !== null) { this.question.selectFirst = this.question.settings.unitsleft == '1'; } else { const input = questionEl.querySelector('input[type="text"][name*=answer]'); @@ -166,7 +166,7 @@ export class CoreQuestionBaseComponent { } // Check which one should be displayed first: the options or the input. - if (this.question.settings) { + if (this.question.settings && this.question.settings.unitsleft !== null) { this.question.optionsFirst = this.question.settings.unitsleft == '1'; } else { const input = questionEl.querySelector('input[type="text"][name*=answer]');