mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
mod-lesson MDL-25632 Fixed undefined var notice for responseformat in the lesson report.
This commit is contained in:
parent
88e5c58677
commit
2a03a824c4
@ -437,7 +437,12 @@ if ($action === 'delete') {
|
||||
$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 ($action === 'delete') {
|
||||
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 @@ if ($action === 'delete') {
|
||||
// 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user