From b1e73801d123aa50f15c3189cf89cce2da4be268 Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Wed, 19 Apr 2017 13:02:34 +0200 Subject: [PATCH] MDL-58434 mod_lesson: Display invalid responses in detailed report In the detailed statistics view for one user attempt, the user response for numerical question types was not being displayed. This was only happening for incorrect responses. --- mod/lesson/pagetypes/numerical.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/lesson/pagetypes/numerical.php b/mod/lesson/pagetypes/numerical.php index 338d44bea89..d1dc8c8b578 100644 --- a/mod/lesson/pagetypes/numerical.php +++ b/mod/lesson/pagetypes/numerical.php @@ -215,8 +215,9 @@ class lesson_page_type_numerical extends lesson_page { $answerdata->answers[] = array(get_string("nooneansweredthisquestion", "lesson"), " "); } $i++; - } else if ($useranswer != null && ($answer->id == $useranswer->answerid || ($answer == end($answers) && empty($answerdata)))) { - // get in here when what the user entered is not one of the answers + } else if ($useranswer != null && ($answer->id == $useranswer->answerid || ($answer == end($answers) && + empty($answerdata->answers)))) { + // Get in here when the user answered or for the last answer. $data = ''; if (isset($pagestats[$this->properties->id][$useranswer->useranswer])) {