Skip to content

Commit

Permalink
MDL-57366 mod_lesson: Zero now acceptable numeric answer.
Browse files Browse the repository at this point in the history
When creating a numerical question. If the answer to the
question is 0 then the answer will not save.
  • Loading branch information
abgreeve committed Dec 20, 2016
1 parent 5100c48 commit 0a36b93
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 @@ -2955,7 +2955,7 @@ public function create_answers($properties) {
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'];
Expand Down

0 comments on commit 0a36b93

Please sign in to comment.