Skip to content

Commit

Permalink
MDL-66409 mod_lesson: Fix editing of numerical pages
Browse files Browse the repository at this point in the history
This avoids using the "magic" `isset` function implemented
within the lesson_base class (which returns the `empty` function).
In the case of the answer beeing `0`, the test fails and the answer
is considered to be deleted.
  • Loading branch information
rhea-machine committed Sep 9, 2019
1 parent a672f02 commit 21d6123
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mod/lesson/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4549,7 +4549,7 @@ public function update($properties, $context = null, $maxbytes = null) {
$this->answers[$i]->responseformat = $properties->response_editor[$i]['format'];
}

if (isset($this->answers[$i]->answer) && $this->answers[$i]->answer != '') {
if ($this->answers[$i]->answer !== null && $this->answers[$i]->answer !== '') {
if (isset($properties->jumpto[$i])) {
$this->answers[$i]->jumpto = $properties->jumpto[$i];
}
Expand Down

0 comments on commit 21d6123

Please sign in to comment.