3 // This file is part of Moodle - http://moodle.org/
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
19 * This page prints a particular instance of lesson
23 * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or late
27 require_once(dirname(__FILE__) . '/../../config.php');
28 require_once($CFG->dirroot.'/mod/lesson/locallib.php');
29 require_once($CFG->dirroot.'/mod/lesson/view_form.php');
30 require_once($CFG->libdir . '/completionlib.php');
32 $id = required_param('id', PARAM_INT); // Course Module ID
33 $pageid = optional_param('pageid', NULL, PARAM_INT); // Lesson Page ID
34 $edit = optional_param('edit', -1, PARAM_BOOL);
35 $userpassword = optional_param('userpassword','',PARAM_RAW);
36 $backtocourse = optional_param('backtocourse', false, PARAM_RAW);
38 $cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
39 $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
40 $lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
42 require_login($course, false, $cm);
45 redirect(new moodle_url('/course/view.php', array('id'=>$course->id)));
49 $completion = new completion_info($course);
50 $completion->set_module_viewed($cm);
52 $url = new moodle_url('/mod/lesson/view.php', array('id'=>$id));
53 if ($pageid !== null) {
54 $url->param('pageid', $pageid);
58 $context = get_context_instance(CONTEXT_MODULE, $cm->id);
59 $canmanage = has_capability('mod/lesson:manage', $context);
61 $lessonoutput = $PAGE->get_renderer('mod_lesson');
64 $userhasgrade = $DB->count_records("lesson_grades", array("lessonid"=>$lesson->id, "userid"=>$USER->id));
65 if ($userhasgrade && !$lesson->retake) {
69 /// Check these for students only TODO: Find a better method for doing this!
70 /// Check lesson availability
71 /// Check for password
72 /// Check dependencies
73 /// Check for high scores
75 if (!$lesson->is_accessible()) { // Deadline restrictions
76 echo $lessonoutput->header($lesson, $cm);
77 if ($lesson->deadline != 0 && time() > $lesson->deadline) {
78 echo $lessonoutput->lesson_inaccessible(get_string('lessonclosed', 'lesson', userdate($lesson->deadline)));
80 echo $lessonoutput->lesson_inaccessible(get_string('lessonopen', 'lesson', userdate($lesson->available)));
82 echo $lessonoutput->footer();
84 } else if ($lesson->usepassword && empty($USER->lessonloggedin[$lesson->id])) { // Password protected lesson code
86 if (!empty($userpassword) && (($lesson->password == md5(trim($userpassword))) || ($lesson->password == trim($userpassword)))) {
87 // with or without md5 for backward compatibility (MDL-11090)
88 $USER->lessonloggedin[$lesson->id] = true;
89 if ($lesson->highscores) {
90 // Logged in - redirect so we go through all of these checks before starting the lesson.
91 redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id");
94 echo $lessonoutput->header($lesson, $cm);
95 echo $lessonoutput->login_prompt($lesson, $userpassword !== '');
96 echo $lessonoutput->footer();
99 } else if ($lesson->dependency) { // check for dependencies
100 if ($dependentlesson = $DB->get_record('lesson', array('id' => $lesson->dependency))) {
101 // lesson exists, so we can proceed
102 $conditions = unserialize($lesson->conditions);
103 // assume false for all
106 // check for the timespent condition
107 if ($conditions->timespent) {
109 if ($attempttimes = $DB->get_records('lesson_timer', array("userid"=>$USER->id, "lessonid"=>$dependentlesson->id))) {
110 // go through all the times and test to see if any of them satisfy the condition
111 foreach($attempttimes as $attempttime) {
112 $duration = $attempttime->lessontime - $attempttime->starttime;
113 if ($conditions->timespent < $duration/60) {
119 $errors[] = get_string('timespenterror', 'lesson', $conditions->timespent);
123 // check for the gradebetterthan condition
124 if($conditions->gradebetterthan) {
125 $gradebetterthan = false;
126 if ($studentgrades = $DB->get_records('lesson_grades', array("userid"=>$USER->id, "lessonid"=>$dependentlesson->id))) {
127 // go through all the grades and test to see if any of them satisfy the condition
128 foreach($studentgrades as $studentgrade) {
129 if ($studentgrade->grade >= $conditions->gradebetterthan) {
130 $gradebetterthan = true;
134 if (!$gradebetterthan) {
135 $errors[] = get_string('gradebetterthanerror', 'lesson', $conditions->gradebetterthan);
139 // check for the completed condition
140 if ($conditions->completed) {
141 if (!$DB->count_records('lesson_grades', array('userid'=>$USER->id, 'lessonid'=>$dependentlesson->id))) {
142 $errors[] = get_string('completederror', 'lesson');
146 if (!empty($errors)) { // print out the errors if any
147 echo $lessonoutput->header($lesson, $cm);
148 echo $lessonoutput->dependancy_errors($dependentlesson, $errors);
149 echo $lessonoutput->footer();
153 } else if ($lesson->highscores && !$lesson->practice && !optional_param('viewed', 0, PARAM_INT) && empty($pageid)) {
154 // Display high scores before starting lesson
155 redirect(new moodle_url('/mod/lesson/highscores.php', array("id"=>$cm->id)));
159 // this is called if a student leaves during a lesson
160 if ($pageid == LESSON_UNSEENBRANCHPAGE) {
161 $pageid = lesson_unseen_question_jump($lesson, $USER->id, $pageid);
164 // display individual pages and their sets of answers
165 // if pageid is EOL then the end of the lesson has been reached
166 // for flow, changed to simple echo for flow styles, michaelp, moved lesson name and page title down
167 $attemptflag = false;
168 if (empty($pageid)) {
169 // make sure there are pages to view
170 if (!$DB->get_field('lesson_pages', 'id', array('lessonid' => $lesson->id, 'prevpageid' => 0))) {
172 $lesson->add_message(get_string('lessonnotready2', 'lesson')); // a nice message to the student
174 if (!$DB->count_records('lesson_pages', array('lessonid'=>$lesson->id))) {
175 redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id"); // no pages - redirect to add pages
177 $lesson->add_message(get_string('lessonpagelinkingbroken', 'lesson')); // ok, bad mojo
182 add_to_log($course->id, 'lesson', 'start', 'view.php?id='. $cm->id, $lesson->id, $cm->id);
184 // if no pageid given see if the lesson has been started
185 $retries = $DB->count_records('lesson_grades', array("lessonid" => $lesson->id, "userid" => $USER->id));
190 if (isset($USER->modattempts[$lesson->id])) {
191 unset($USER->modattempts[$lesson->id]); // if no pageid, then student is NOT reviewing
194 // if there are any questions have been answered correctly in this attempt
195 $corrrectattempts = $lesson->get_attempts($retries, true);
196 if ($corrrectattempts>0) {
197 $attempt = end($corrrectattempts);
198 $jumpto = $DB->get_field('lesson_answers', 'jumpto', array('id' => $attempt->answerid));
199 // convert the jumpto to a proper page id
200 if ($jumpto == 0) { // unlikely value!
201 $lastpageseen = $attempt->pageid;
202 } elseif ($jumpto == LESSON_NEXTPAGE) {
203 if (!$lastpageseen = $DB->get_field('lesson_pages', 'nextpageid', array('id' => $attempt->pageid))) {
204 // no nextpage go to end of lesson
205 $lastpageseen = LESSON_EOL;
208 $lastpageseen = $jumpto;
212 if ($branchtables = $DB->get_records('lesson_branch', array("lessonid"=>$lesson->id, "userid"=>$USER->id, "retry"=>$retries), 'timeseen DESC')) {
213 // in here, user has viewed a branch table
214 $lastbranchtable = current($branchtables);
215 if (count($corrrectattempts)>0) {
216 foreach($corrrectattempts as $attempt) {
217 if ($lastbranchtable->timeseen > $attempt->timeseen) {
218 // branch table was viewed later than the last attempt
219 $lastpageseen = $lastbranchtable->pageid;
224 // hasnt answered any questions but has viewed a branch table
225 $lastpageseen = $lastbranchtable->pageid;
228 if (isset($lastpageseen) && $DB->count_records('lesson_attempts', array('lessonid'=>$lesson->id, 'userid'=>$USER->id, 'retry'=>$retries)) > 0) {
229 echo $lessonoutput->header($lesson, $cm);
230 if ($lesson->timed) {
231 if ($lesson->retake) {
232 $continuelink = new single_button(new moodle_url('/mod/lesson/view.php', array('id'=>$cm->id, 'pageid'=>$lesson->firstpageid, 'startlastseen'=>'no')), get_string('continue', 'lesson'), 'get');
233 echo '<div class="center leftduring">'.$lessonoutput->message(get_string('leftduringtimed', 'lesson'), $continuelink).'</div>';
235 $courselink = new single_button(new moodle_url('/course/view.php', array('id'=>$PAGE->course->id)), get_string('returntocourse', 'lesson'), 'get');
236 echo '<div class="center leftduring">'.$lessonoutput->message(get_string('leftduringtimednoretake', 'lesson'), $courselink).'</div>';
239 echo $lessonoutput->continue_links($lesson, $lastpageseen);
241 echo $lessonoutput->footer();
246 if (!$lesson->retake) {
247 echo $lessonoutput->header($lesson, $cm, 'view');
248 $courselink = new single_button(new moodle_url('/course/view.php', array('id'=>$PAGE->course->id)), get_string('returntocourse', 'lesson'), 'get');
249 echo $lessonoutput->message(get_string("noretake", "lesson"), $courselink);
250 echo $lessonoutput->footer();
254 // start at the first page
255 if (!$pageid = $DB->get_field('lesson_pages', 'id', array('lessonid' => $lesson->id, 'prevpageid' => 0))) {
256 print_error('cannotfindfirstpage', 'lesson');
258 /// This is the code for starting a timed test
259 if(!isset($USER->startlesson[$lesson->id]) && !$canmanage) {
260 $lesson->start_timer();
264 $currenttab = 'view';
265 $extraeditbuttons = false;
266 $lessonpageid = null;
269 if ($pageid != LESSON_EOL) {
270 /// This is the code updates the lessontime for a timed test
271 $startlastseen = optional_param('startlastseen', '', PARAM_ALPHA);
272 if ($startlastseen == 'no') {
273 // this deletes old records not totally sure if this is necessary anymore
274 $retries = $DB->count_records('lesson_grades', array('lessonid'=>$lesson->id, 'userid'=>$USER->id));
275 $DB->delete_records('lesson_attempts', array('userid' => $USER->id, 'lessonid' => $lesson->id, 'retry' => $retries));
276 $DB->delete_records('lesson_branch', array('userid' => $USER->id, 'lessonid' => $lesson->id, 'retry' => $retries));
279 $page = $lesson->load_page($pageid);
280 // Check if the page is of a special type and if so take any nessecary action
281 $newpageid = $page->callback_on_view($canmanage);
282 if (is_numeric($newpageid)) {
283 $page = $lesson->load_page($newpageid);
286 add_to_log($PAGE->course->id, 'lesson', 'view', 'view.php?id='. $PAGE->cm->id, $page->id, $PAGE->cm->id);
288 // This is where several messages (usually warnings) are displayed
289 // all of this is displayed above the actual page
291 // check to see if the user can see the left menu
293 $lesson->displayleft = lesson_displayleftif($lesson);
295 $continue = ($startlastseen !== '');
296 $restart = ($continue && $startlastseen == 'yes');
297 $timer = $lesson->update_timer($continue, $restart);
299 if ($lesson->timed) {
300 $timeleft = ($timer->starttime + $lesson->maxtime * 60) - time();
301 if ($timeleft <= 0) {
303 $lesson->add_message(get_string('eolstudentoutoftime', 'lesson'));
304 redirect(new moodle_url('/mod/lesson/view.php', array('id'=>$cm->id,'pageid'=>LESSON_EOL, 'outoftime'=>'normal')));
305 die; // Shouldn't be reached, but make sure
306 } else if ($timeleft < 60) {
307 // One minute warning
308 $lesson->add_message(get_string('studentoneminwarning', 'lesson'));
312 if ($page->qtype == LESSON_PAGE_BRANCHTABLE && $lesson->minquestions) {
313 // tell student how many questions they have seen, how many are required and their grade
314 $ntries = $DB->count_records("lesson_grades", array("lessonid"=>$lesson->id, "userid"=>$USER->id));
315 $gradeinfo = lesson_grade($lesson, $ntries);
316 if ($gradeinfo->attempts) {
317 if ($gradeinfo->nquestions < $lesson->minquestions) {
319 $a->nquestions = $gradeinfo->nquestions;
320 $a->minquestions = $lesson->minquestions;
321 $lesson->add_message(get_string('numberofpagesviewednotice', 'lesson', $a));
325 $a->grade = number_format($gradeinfo->grade * $lesson->grade / 100, 1);
326 $a->total = $lesson->grade;
327 if (!$reviewmode && !$lesson->retake){
328 $lesson->add_message(get_string("numberofcorrectanswers", "lesson", $gradeinfo->earned), 'notify');
329 $lesson->add_message(get_string('yourcurrentgradeisoutof', 'lesson', $a), 'notify');
335 if ($lesson->timed) {
336 $lesson->add_message(get_string('teachertimerwarning', 'lesson'));
338 if (lesson_display_teacher_warning($lesson)) {
339 // This is the warning msg for teachers to inform them that cluster
340 // and unseen does not work while logged in as a teacher
341 $warningvars->cluster = get_string('clusterjump', 'lesson');
342 $warningvars->unseen = get_string('unseenpageinbranch', 'lesson');
343 $lesson->add_message(get_string('teacherjumpwarning', 'lesson', $warningvars));
347 $PAGE->set_url('/mod/lesson/view.php', array('id' => $cm->id, 'pageid' => $page->id));
348 $PAGE->set_subpage($page->id);
349 $currenttab = 'view';
350 $extraeditbuttons = true;
351 $lessonpageid = $page->id;
353 if (($edit != -1) && $PAGE->user_allowed_editing()) {
354 $USER->editing = $edit;
357 if (is_array($page->answers) && count($page->answers)>0) {
358 // this is for modattempts option. Find the users previous answer to this page,
359 // and then display it below in answer processing
360 if (isset($USER->modattempts[$lesson->id])) {
361 $retries = $DB->count_records('lesson_grades', array("lessonid"=>$lesson->id, "userid"=>$USER->id));
362 if (!$attempts = $lesson->get_attempts($retries-1, false, $page->id)) {
363 print_error('cannotfindpreattempt', 'lesson');
365 $attempt = end($attempts);
366 $USER->modattempts[$lesson->id] = $attempt;
370 $lessoncontent = $lessonoutput->display_page($lesson, $page, $attempt);
372 $data = new stdClass;
373 $data->id = $PAGE->cm->id;
374 $data->pageid = $page->id;
375 $data->newpageid = $lesson->get_next_page($page->nextpageid);
378 'title' => $page->title,
379 'contents' => $page->get_contents()
381 $mform = new lesson_page_without_answers($CFG->wwwroot.'/mod/lesson/continue.php', $customdata);
382 $mform->set_data($data);
385 $lessoncontent = ob_get_contents();
389 lesson_add_fake_blocks($PAGE, $cm, $lesson, $timer);
390 echo $lessonoutput->header($lesson, $cm, $currenttab, $extraeditbuttons, $lessonpageid);
392 // We are using level 3 header because attempt heading is a sub-heading of lesson title (MDL-30911).
393 echo $OUTPUT->heading(get_string('attempt', 'lesson', $retries), 3);
395 /// This calculates and prints the ongoing score
396 if ($lesson->ongoing && !empty($pageid) && !$reviewmode) {
397 echo $lessonoutput->ongoing_score($lesson);
399 if ($lesson->displayleft) {
400 echo '<a name="maincontent" id="maincontent" title="' . get_string('anchortitle', 'lesson') . '"></a>';
403 echo $lessonoutput->slideshow_end();
404 echo $lessonoutput->progress_bar($lesson);
405 echo $lessonoutput->footer();
410 // end of lesson reached work out grade
411 // Used to check to see if the student ran out of time
412 $outoftime = optional_param('outoftime', '', PARAM_ALPHA);
414 // Update the clock / get time information for this user
415 add_to_log($course->id, "lesson", "end", "view.php?id=".$PAGE->cm->id, "$lesson->id", $PAGE->cm->id);
417 // We are using level 3 header because the page title is a sub-heading of lesson title (MDL-30911).
418 $lessoncontent .= $OUTPUT->heading(get_string("congratulations", "lesson"), 3);
419 $lessoncontent .= $OUTPUT->box_start('generalbox boxaligncenter');
420 $ntries = $DB->count_records("lesson_grades", array("lessonid"=>$lesson->id, "userid"=>$USER->id));
421 if (isset($USER->modattempts[$lesson->id])) {
422 $ntries--; // need to look at the old attempts :)
425 $lesson->stop_timer();
426 $gradeinfo = lesson_grade($lesson, $ntries);
428 if ($gradeinfo->attempts) {
429 if (!$lesson->custom) {
430 $lessoncontent .= $lessonoutput->paragraph(get_string("numberofpagesviewed", "lesson", $gradeinfo->nquestions), 'center');
431 if ($lesson->minquestions) {
432 if ($gradeinfo->nquestions < $lesson->minquestions) {
433 // print a warning and set nviewed to minquestions
434 $lessoncontent .= $lessonoutput->paragraph(get_string("youshouldview", "lesson", $lesson->minquestions), 'center');
437 $lessoncontent .= $lessonoutput->paragraph(get_string("numberofcorrectanswers", "lesson", $gradeinfo->earned), 'center');
440 $a->score = $gradeinfo->earned;
441 $a->grade = $gradeinfo->total;
442 if ($gradeinfo->nmanual) {
443 $a->tempmaxgrade = $gradeinfo->total - $gradeinfo->manualpoints;
444 $a->essayquestions = $gradeinfo->nmanual;
445 $lessoncontent .= $OUTPUT->box(get_string("displayscorewithessays", "lesson", $a), 'center');
447 $lessoncontent .= $OUTPUT->box(get_string("displayscorewithoutessays", "lesson", $a), 'center');
450 $a->grade = number_format($gradeinfo->grade * $lesson->grade / 100, 1);
451 $a->total = $lesson->grade;
452 $lessoncontent .= $lessonoutput->paragraph(get_string("yourcurrentgradeisoutof", "lesson", $a), 'center');
454 $grade = new stdClass();
455 $grade->lessonid = $lesson->id;
456 $grade->userid = $USER->id;
457 $grade->grade = $gradeinfo->grade;
458 $grade->completed = time();
459 if (!$lesson->practice) {
460 if (isset($USER->modattempts[$lesson->id])) { // if reviewing, make sure update old grade record
461 if (!$grades = $DB->get_records("lesson_grades", array("lessonid" => $lesson->id, "userid" => $USER->id), "completed DESC", '*', 0, 1)) {
462 print_error('cannotfindgrade', 'lesson');
464 $oldgrade = array_shift($grades);
465 $grade->id = $oldgrade->id;
466 $DB->update_record("lesson_grades", $grade);
468 $newgradeid = $DB->insert_record("lesson_grades", $grade);
471 $DB->delete_records("lesson_attempts", array("lessonid" => $lesson->id, "userid" => $USER->id, "retry" => $ntries));
474 if ($lesson->timed) {
475 if ($outoftime == 'normal') {
476 $grade = new stdClass();;
477 $grade->lessonid = $lesson->id;
478 $grade->userid = $USER->id;
480 $grade->completed = time();
481 if (!$lesson->practice) {
482 $newgradeid = $DB->insert_record("lesson_grades", $grade);
484 $lessoncontent .= get_string("eolstudentoutoftimenoanswers", "lesson");
487 $lessoncontent .= get_string("welldone", "lesson");
491 // update central gradebook
492 lesson_update_grades($lesson, $USER->id);
495 // display for teacher
496 $lessoncontent .= $lessonoutput->paragraph(get_string("displayofgrade", "lesson"), 'center');
498 $lessoncontent .= $OUTPUT->box_end(); //End of Lesson button to Continue.
500 // after all the grade processing, check to see if "Show Grades" is off for the course
501 // if yes, redirect to the course page
502 if (!$course->showgrades) {
503 redirect(new moodle_url('/course/view.php', array('id'=>$course->id)));
507 if ($lesson->highscores && !$canmanage && !$lesson->practice) {
508 $lessoncontent .= $OUTPUT->box_start('center');
509 if ($grades = $DB->get_records("lesson_grades", array("lessonid" => $lesson->id), "completed")) {
511 if ($highscores = $DB->get_records("lesson_high_scores", array("lessonid" => $lesson->id))) {
512 // get all the high scores into an array
513 $topscores = array();
514 $uniquescores = array();
515 foreach ($highscores as $highscore) {
516 $grade = $grades[$highscore->gradeid]->grade;
517 $topscores[] = $grade;
518 $uniquescores[$grade] = 1;
520 // sort to find the lowest score
522 $lowscore = $topscores[0];
524 if ($gradeinfo->grade >= $lowscore || count($uniquescores) <= $lesson->maxhighscores) {
528 if (!$highscores or $madeit) {
529 $lessoncontent .= $lessonoutput->paragraph(get_string("youmadehighscore", "lesson", $lesson->maxhighscores), 'center');
530 $aurl = new moodle_url('/mod/lesson/highscores.php', array('id'=>$PAGE->cm->id, 'sesskey'=>sesskey()));
531 $lessoncontent .= $OUTPUT->single_button($aurl, get_string('clicktopost', 'lesson'));
533 $lessoncontent .= get_string("nothighscore", "lesson", $lesson->maxhighscores)."<br />";
536 $url = new moodle_url('/mod/lesson/highscores.php', array('id'=>$PAGE->cm->id, 'link'=>'1'));
537 $lessoncontent .= html_writer::link($url, get_string('viewhighscores', 'lesson'), array('class'=>'centerpadded lessonbutton standardbutton'));
538 $lessoncontent .= $OUTPUT->box_end();
541 if ($lesson->modattempts && !$canmanage) {
542 // make sure if the student is reviewing, that he/she sees the same pages/page path that he/she saw the first time
543 // look at the attempt records to find the first QUESTION page that the user answered, then use that page id
544 // to pass to view again. This is slick cause it wont call the empty($pageid) code
545 // $ntries is decremented above
546 if (!$attempts = $lesson->get_attempts($ntries)) {
548 $url = new moodle_url('/mod/lesson/view.php', array('id'=>$PAGE->cm->id));
550 $firstattempt = current($attempts);
551 $pageid = $firstattempt->pageid;
552 // IF the student wishes to review, need to know the last question page that the student answered. This will help to make
553 // sure that the student can leave the lesson via pushing the continue button.
554 $lastattempt = end($attempts);
555 $USER->modattempts[$lesson->id] = $lastattempt->pageid;
557 $url = new moodle_url('/mod/lesson/view.php', array('id'=>$PAGE->cm->id, 'pageid'=>$pageid));
559 $lessoncontent .= html_writer::link($url, get_string('reviewlesson', 'lesson'), array('class' => 'centerpadded lessonbutton standardbutton'));
560 } elseif ($lesson->modattempts && $canmanage) {
561 $lessoncontent .= $lessonoutput->paragraph(get_string("modattemptsnoteacher", "lesson"), 'centerpadded');
564 if ($lesson->activitylink) {
565 $lessoncontent .= $lesson->link_for_activitylink();
568 $url = new moodle_url('/course/view.php', array('id'=>$course->id));
569 $lessoncontent .= html_writer::link($url, get_string('returnto', 'lesson', format_string($course->fullname, true)), array('class'=>'centerpadded lessonbutton standardbutton'));
571 $url = new moodle_url('/grade/index.php', array('id'=>$course->id));
572 $lessoncontent .= html_writer::link($url, get_string('viewgrades', 'lesson'), array('class'=>'centerpadded lessonbutton standardbutton'));
574 lesson_add_fake_blocks($PAGE, $cm, $lesson, $timer);
575 echo $lessonoutput->header($lesson, $cm, $currenttab, $extraeditbuttons, $lessonpageid);
577 echo $lessonoutput->footer();