diff --git a/mod/lesson/pagetypes/multichoice.php b/mod/lesson/pagetypes/multichoice.php index 232add56eae..1ca091211f0 100644 --- a/mod/lesson/pagetypes/multichoice.php +++ b/mod/lesson/pagetypes/multichoice.php @@ -351,7 +351,7 @@ class lesson_page_type_multichoice extends lesson_page { } if (in_array($answer->id, $userresponse)) { // make checked - $data = ""; + $checkboxelement = ""; if (!isset($answerdata->response)) { if ($answer->response == null) { if ($useranswer->correct) { @@ -374,17 +374,19 @@ class lesson_page_type_multichoice extends lesson_page { } } else { // unchecked - $data = ""; + $checkboxelement = ""; } if (($answer->score > 0 && $this->lesson->custom) || ($this->lesson->jumpto_is_correct($this->properties->id, $answer->jumpto) && !$this->lesson->custom)) { - $data = "
".$data.' '.format_text($answer->answer,$answer->answerformat,$formattextdefoptions)."
"; + $answertext = $checkboxelement . format_text($answer->answer, $answer->answerformat, $formattextdefoptions); + $data = "
"; } else { - $data .= format_text($answer->answer,$answer->answerformat,$formattextdefoptions); + $answertext = $checkboxelement . format_text($answer->answer, $answer->answerformat, $formattextdefoptions); + $data = ""; } } else { if ($useranswer != null and $answer->id == $useranswer->answerid) { // make checked - $data = ""; + $checkboxelement = ""; if ($answer->response == null) { if ($useranswer->correct) { $answerdata->response = get_string("thatsthecorrectanswer", "lesson"); @@ -403,12 +405,14 @@ class lesson_page_type_multichoice extends lesson_page { } } else { // unchecked - $data = ""; + $checkboxelement = ""; } if (($answer->score > 0 && $this->lesson->custom) || ($this->lesson->jumpto_is_correct($this->properties->id, $answer->jumpto) && !$this->lesson->custom)) { - $data = "
".$data.' '.format_text($answer->answer,FORMAT_MOODLE,$formattextdefoptions)."
"; + $answertext = $checkboxelement . format_text($answer->answer, FORMAT_MOODLE, $formattextdefoptions); + $data = "
"; } else { - $data .= format_text($answer->answer,$answer->answerformat,$formattextdefoptions); + $answertext = $checkboxelement . format_text($answer->answer, $answer->answerformat, $formattextdefoptions); + $data = ""; } } if (isset($pagestats[$this->properties->id][$answer->id])) {