Exercise: Fix commit 4b1149e6ed to still not consider empty an answer with 0 only if its in a fill in the blank question, in other case it should be considered as empty -refs BT#21290

pull/5019/head
NicoDucou 2 years ago
parent 852bd80e9d
commit 4eb6f13207
  1. 5
      main/exercise/exercise.class.php

@ -10859,11 +10859,14 @@ class Exercise
case FILL_IN_BLANKS:
case FILL_IN_BLANKS_COMBINATION:
$option['answer'] = $this->fill_in_blank_answer_to_string($option['answer']);
if ($option['answer'] === "0") {
$option['answer'] = "there is 0 as answer so we do not want to consider it empty";
}
break;
}
}
if (isset($option['answer'])) {
if (!empty($option['answer'])) {
$exerciseResult[] = $questionId;
break;

Loading…
Cancel
Save