Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

Moodle renderer used to display special elements of the lesson module

Copyright: 2009 Sam Hemelryk
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 642 lines (27 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: mod_lesson_renderer  - X-Ref

header($lesson, $cm, $currenttab = '', $extraeditbuttons = false, $lessonpageid = null, $extrapagetitle = null)   X-Ref
Returns the header for the lesson module

param: lesson $lesson a lesson object.
param: string $currenttab current tab that is shown.
param: bool   $extraeditbuttons if extra edit buttons should be displayed.
param: int    $lessonpageid id of the lesson page that needs to be displayed.
param: string $extrapagetitle String to appent to the page title.
return: string

footer()   X-Ref
Returns the footer

return: string

lesson_inaccessible($message)   X-Ref
Returns HTML for a lesson inaccessible message

param: string $message
return: <type>

login_prompt(lesson $lesson, $failedattempt = false)   X-Ref
Returns HTML to prompt the user to log in

param: lesson $lesson
param: bool $failedattempt
return: string

dependancy_errors($dependentlesson, $errors)   X-Ref
Returns HTML to display dependancy errors

param: object $dependentlesson
param: array $errors
return: string

message($message, single_button $button = null)   X-Ref
Returns HTML to display a message

param: string $message
param: single_button $button
return: string

continue_links(lesson $lesson, $lastpageseenid)   X-Ref
Returns HTML to display a continue button

param: lesson $lesson
param: int $lastpageseen
return: string

display_page(lesson $lesson, lesson_page $page, $attempt)   X-Ref
Returns HTML to display a page to the user

param: lesson $lesson
param: lesson_page $page
param: object $attempt
return: string

display_edit_collapsed(lesson $lesson, $pageid)   X-Ref
Returns HTML to display a collapsed edit form

param: lesson $lesson
param: int $pageid
return: string

display_edit_full(lesson $lesson, $pageid, $prevpageid, $single=false)   X-Ref
Returns HTML to display the full edit page

param: lesson $lesson
param: int $pageid
param: int $prevpageid
param: bool $single
return: string

add_page_links(lesson $lesson, $prevpageid=false)   X-Ref
Returns HTML to display the add page links

param: lesson $lesson
param: int $prevpageid
return: string

add_first_page_links(lesson $lesson)   X-Ref
Return HTML to display add first page links

param: lesson $lesson
return: string

page_action_links(lesson_page $page, $printmove, $printaddpage=false)   X-Ref
Returns HTML to display action links for a page

param: lesson_page $page
param: bool $printmove
param: bool $printaddpage
return: string

ongoing_score(lesson $lesson)   X-Ref
Prints the on going message to the user.

With custom grading On, displays points
earned out of total points possible thus far.
With custom grading Off, displays number of correct
answers out of total attempted.

param: lesson $lesson
return: string

progress_bar(lesson $lesson, $progress = null)   X-Ref
Returns HTML to display a progress bar of progression through a lesson

param: lesson $lesson
param: int $progress optional, if empty it will be calculated
return: string

slideshow_start(lesson $lesson)   X-Ref
Returns HTML to show the start of a slideshow

param: lesson $lesson

slideshow_end()   X-Ref
Returns HTML to show the end of a slideshow


paragraph($contents, $class='')   X-Ref
Returns a P tag containing contents

param: string $contents
param: string $class

display_eol_page(lesson $lesson, $data)   X-Ref
Returns the HTML for displaying the end of lesson page.

param: lesson $lesson lesson instance
param: stdclass $data lesson data to be rendered
return: string         HTML contents