Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

mod-lesson MDL-25632 Fixed undefined var notice for responseformat in…

… the lesson report.
  • Loading branch information...
commit 2a03a824c4ac54286a8b491fd88b22edd40ee0c3 1 parent 88e5c58
@samhemelryk samhemelryk authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 mod/lesson/report.php
View
12 mod/lesson/report.php
@@ -437,7 +437,12 @@
$page = $lessonpages[$pageid];
$answerpage = new stdClass;
$data ='';
+
$answerdata = new stdClass;
+ // Set some defaults for the answer data.
+ $answerdata->score = NULL;
+ $answerdata->response = NULL;
+ $answerdata->responseformat = FORMAT_PLAIN;
$answerpage->title = format_string($page->title);
@@ -452,9 +457,7 @@
if (empty($userid)) {
// there is no userid, so set these vars and display stats.
$answerpage->grayout = 0;
- $useranswer = NULL;
- $answerdata->score = NULL;
- $answerdata->response = NULL;
+ $useranswer = NULL;
} elseif ($useranswers = $DB->get_records("lesson_attempts",array("lessonid"=>$lesson->id, "userid"=>$userid, "retry"=>$try,"pageid"=>$page->id), "timeseen")) {
// get the user's answer for this page
// need to find the right one
@@ -470,9 +473,6 @@
// user did not answer this page, gray it out and set some nulls
$answerpage->grayout = 1;
$useranswer = NULL;
- $answerdata->score = NULL;
- $answerdata->response = NULL;
-
}
$i = 0;
$n = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.