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.
This commit is contained in:
Juan Leyva 2017-04-19 13:02:34 +02:00
parent 06e3b6d8ba
commit 91357e7c36

View File

@ -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 = '<input class="form-control" type="text" size="50" ' .
'disabled="disabled" readonly="readonly" value="'.s($useranswer->useranswer).'">';
if (isset($pagestats[$this->properties->id][$useranswer->useranswer])) {