Skip to content

Commit d524036

Browse files
committed
MOBILE-4690 quiz: Check empty units on numerical question
1 parent 490847f commit d524036

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/addons/qtype/numerical/services/handlers/numerical.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ export class AddonQtypeNumericalHandlerService implements CoreQuestionHandler {
216216
return Translate.instant('addon.qtype_numerical.invalidnumber');
217217
}
218218

219-
if (!question.parsedSettings) {
220-
if (this.hasSeparateUnitField(question)) {
221-
return Translate.instant('addon.qtype_numerical.unitnotselected');
222-
}
219+
if (this.hasSeparateUnitField(question) && !unit) {
220+
return Translate.instant('addon.qtype_numerical.unitnotselected');
221+
}
223222

224-
// We cannot know if the answer should contain units or not.
223+
if (!question.parsedSettings) {
224+
// We cannot check anything else without settings.
225225
return;
226226
}
227227

0 commit comments

Comments
 (0)