MDL-57366 mod_lesson: Zero now acceptable numeric answer.

When creating a numerical question. If the answer to the
question is 0 then the answer will not save.
This commit is contained in:
Adrian Greeve
2016-12-23 10:36:12 +08:00
parent a09a9879e5
commit e2f5592b8f
+1 -1
View File
@@ -2955,7 +2955,7 @@ abstract class lesson_page extends lesson_base {
for ($i = 0; $i < $this->lesson->maxanswers; $i++) {
$answer = clone($newanswer);
if (!empty($properties->answer_editor[$i])) {
if (isset($properties->answer_editor[$i])) {
if (is_array($properties->answer_editor[$i])) {
// Multichoice and true/false pages have an HTML editor.
$answer->answer = $properties->answer_editor[$i]['text'];