MDL-66409 mod_lesson: Fix editing of numerical pages

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.
This commit is contained in:
Raphaël Santos 2019-08-21 09:48:28 +02:00
parent a672f021ea
commit 21d6123fbd
No known key found for this signature in database
GPG Key ID: 71831CD69F6E183B

View File

@ -4549,7 +4549,7 @@ abstract class lesson_page extends lesson_base {
$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];
}