Skip to content

Commit

Permalink
MOBILE-4690 quiz: Check empty units on numerical question
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyserver committed Jan 17, 2025
1 parent 490847f commit d524036
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/addons/qtype/numerical/services/handlers/numerical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ export class AddonQtypeNumericalHandlerService implements CoreQuestionHandler {
return Translate.instant('addon.qtype_numerical.invalidnumber');
}

if (!question.parsedSettings) {
if (this.hasSeparateUnitField(question)) {
return Translate.instant('addon.qtype_numerical.unitnotselected');
}
if (this.hasSeparateUnitField(question) && !unit) {
return Translate.instant('addon.qtype_numerical.unitnotselected');
}

// We cannot know if the answer should contain units or not.
if (!question.parsedSettings) {
// We cannot check anything else without settings.
return;
}

Expand Down

0 comments on commit d524036

Please sign in to comment.