From 72c61e0996bc609e32217bbf13c9785adfa8859f Mon Sep 17 00:00:00 2001 From: mark-nielsen Date: Sat, 13 Oct 2007 03:12:27 +0000 Subject: [PATCH] Mergin fix for MDL-11684 from MOODLE_19_STABLE --- mod/lesson/report.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mod/lesson/report.php b/mod/lesson/report.php index bc6b6f9156..0a9e06d55e 100644 --- a/mod/lesson/report.php +++ b/mod/lesson/report.php @@ -331,6 +331,7 @@ **************************************************************************/ else if ($action == 'reportdetail') { + $formattextdefoptions = new stdClass; $formattextdefoptions->para = false; //I'll use it widely in this page $userid = optional_param('userid', NULL, PARAM_INT); // if empty, then will display the general detailed view @@ -691,38 +692,38 @@ } break; case LESSON_MATCHING: - if ($n == 0 && $useranswer->correct) { + if ($n == 0 && $useranswer != NULL && $useranswer->correct) { if ($answer->response == NULL && $useranswer != NULL) { $answerdata->response = get_string("thatsthecorrectanswer", "lesson"); } else { $answerdata->response = $answer->response; } - } elseif ($n == 1 && !$useranswer->correct) { + } elseif ($n == 1 && $useranswer != NULL && !$useranswer->correct) { if ($answer->response == NULL && $useranswer != NULL) { $answerdata->response = get_string("thatsthewronganswer", "lesson"); } else { $answerdata->response = $answer->response; } } elseif ($n > 1) { - if ($n == 2 && $useranswer->correct && $useranswer != NULL) { + if ($n == 2 && $useranswer != NULL && $useranswer->correct) { if ($lesson->custom) { $answerdata->score = get_string("pointsearned", "lesson").": ".$answer->score; } else { $answerdata->score = get_string("receivedcredit", "lesson"); } - } elseif ($n == 3 && !$useranswer->correct && $useranswer != NULL) { + } elseif ($n == 3 && $useranswer != NULL && !$useranswer->correct) { if ($lesson->custom) { $answerdata->score = get_string("pointsearned", "lesson").": ".$answer->score; } else { $answerdata->score = get_string("didnotreceivecredit", "lesson"); } } - $data = ""; + $data = ""; if ($useranswer != NULL) { $userresponse = explode(",", $useranswer->useranswer); - $data .= ""; + $data .= ""; } else { - $data .= ""; + $data .= ""; } if ($n == 2) { -- 2.39.5