Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
mod_quiz\output\renderer Class Reference
Inheritance diagram for mod_quiz\output\renderer:
plugin_renderer_base renderer_base

Public Member Functions

 __call ($method, $arguments)
 Magic method used to pass calls otherwise meant for the standard renderer to it to ensure we don't go causing unnecessary grief.
 
 access_messages ($messages)
 Print each message in an array, surrounded by <p>, </p> tags.
 
 add_action_handler (component_action $action, $id=null)
 Adds a JS action for the element with the provided id.
 
 attempt_form ($attemptobj, $page, $slots, $id, $nextpage)
 Outputs the form for making an attempt.
 
 attempt_page ($attemptobj, $page, $accessmanager, $messages, $slots, $id, $nextpage)
 Attempt Page.
 
 attempt_state ($attemptobj)
 Generate a brief textual description of the current state of an attempt.
 
 chart (\core\chart_base $chart, $title, $attrs=[])
 Outputs a chart.
 
 close_attempt_popup ($url, $message='')
 Output a page with an optional message, and JavaScript code to close the current window and redirect the parent window to a new URL.
 
 connection_warning ()
 Output the connection warning messages, which are initially hidden, and only revealed by JavaScript if necessary.
 
 countdown_timer (quiz_attempt $attemptobj, $timenow)
 Return the HTML of the quiz timer.
 
 during_attempt_tertiary_nav ($quizviewurl)
 Render the tertiary navigation for pages during the attempt.
 
 finish_review_link (quiz_attempt $attemptobj)
 Returns either a link or button.
 
 get_compact_logo_url ($maxwidth=300, $maxheight=300)
 Return the site's compact logo URL, if any.
 
 get_logo_url ($maxwidth=null, $maxheight=200)
 Return the site's logo URL, if any.
 
 graph (moodle_url $url, $title)
 Output a graph, or a message saying that GD is required.
 
 has_started ()
 Returns true is output has already started, and false if not.
 
 image_url ($imagename, $component='moodle')
 Return the moodle_url for an image.
 
 initialise_timer ($timerstartvalue, $ispreview)
 Initialise the JavaScript required to initialise the countdown timer.
 
 navigation_panel (navigation_panel_base $panel)
 Outputs the navigation block panel.
 
 no_questions_message ($canedit, $editurl)
 Generate a message saying that this quiz has no questions, with a button to go to the edit page, if the user has the right capability.
 
 no_review_message ($message)
 Displayed where there might normally be a review link, to explain why the review is not available at this time.
 
 pix_url ($imagename, $component='moodle')
 Return the direct URL for an image from the pix folder.
 
 questions (quiz_attempt $attemptobj, $reviewing, $slots, $page, $showall, display_options $displayoptions)
 Renders each question.
 
 quiz_attempt_summary_link_to_reports ($quiz, $cm, $context, $returnzero=false, $currentgroup=0)
 Returns the same as {.
 
 quiz_intro ($quiz, $cm)
 Output the quiz intro.
 
 quiz_notices ($messages)
 Returns any notices.
 
 quiz_override_summary_links (stdClass $quiz, cm_info|stdClass $cm, $currentgroup=0)
 Render a summary of the number of group and user overrides, with corresponding links.
 
 redo_question_button ($slot, $disabled)
 Render a button which allows students to redo a question in the attempt.
 
 render (renderable $widget)
 Renders the provided widget and returns the HTML to display it.
 
 render_from_template ($templatename, $context)
 Renders a template by name with the given context.
 
 restart_preview_button ($url)
 Create a preview link.
 
 review_form ($page, $showall, $displayoptions, $content, $attemptobj)
 Renders the main bit of the review page.
 
 review_link ($url, $reviewinpopup, $popupoptions)
 Output either a link to the review page for an attempt, or a button to open the review in a popup window.
 
 review_next_navigation (quiz_attempt $attemptobj, $page, $lastpage, $showall=null)
 Creates the navigation links/buttons at the bottom of the review attempt page.
 
 review_page (quiz_attempt $attemptobj, $slots, $page, $showall, $lastpage, display_options $displayoptions, $summarydata)
 Builds the review page.
 
 review_question_not_allowed (quiz_attempt $attemptobj, $message)
 Renders the review question pop-up.
 
 review_question_page (quiz_attempt $attemptobj, $slot, $seq, display_options $displayoptions, $summarydata)
 Renders the review question pop-up.
 
 review_summary_table ($summarydata, $page)
 Outputs the table containing data from summary data array.
 
 should_display_main_logo ($headinglevel=1)
 Whether we should display the main logo.
 
 should_display_navbar_logo ()
 Whether we should display the logo in the navbar.
 
 start_attempt_button ($buttontext, moodle_url $url, preflight_check_form $preflightcheckform=null, $popuprequired=false, $popupoptions=null)
 Generates the view attempt button.
 
 start_attempt_page (quiz_settings $quizobj, preflight_check_form $mform)
 Render the 'start attempt' page.
 
 summary_page ($attemptobj, $displayoptions)
 Create the summary page.
 
 summary_page_controls ($attemptobj)
 Creates any controls the page should have.
 
 summary_table ($attemptobj, $displayoptions)
 Generates the table of summarydata.
 
 view_information ($quiz, $cm, $context, $messages, bool $quizhasquestions=false)
 Output the page information.
 
 view_page ($course, $quiz, $cm, $context, $viewobj)
 Generates the view page.
 
 view_page_buttons (view_page $viewobj)
 Work out, and render, whatever buttons, and surrounding info, should appear at the end of the review page.
 
 view_page_guest ($course, $quiz, $cm, $context, $messages, $viewobj)
 Outputs an error message for any guests accessing the quiz.
 
 view_page_notenrolled ($course, $quiz, $cm, $context, $messages, $viewobj)
 Outputs and error message for anyone who is not enrolled on the course.
 
 view_page_tertiary_nav (view_page $viewobj)
 Render the tertiary navigation for the view page.
 
 view_result_info ($quiz, $context, $cm, $viewobj)
 Generates data pertaining to quiz results.
 
 view_table ($quiz, $context, $viewobj)
 Generates the table of data.
 
 view_table_heading ()
 Generates the table heading.
 

Static Public Member Functions

static prepare_classes ($classes)
 Given an array or space-separated list of classes, prepares and returns the HTML class attribute value.
 

Protected Member Functions

 attempt_navigation_buttons ($page, $lastpage, $navmethod='free')
 Display the prev/next buttons that go at the bottom of each page of the attempt.
 
 filter_review_summary_table ($summarydata, $page)
 Filters the summarydata array.
 
 get_mustache ()
 Return an instance of the mustache class.
 
 render_links_to_other_attempts (links_to_other_attempts $links)
 Renders a list of links the other attempts.
 
 render_mod_quiz_links_to_other_attempts (links_to_other_attempts $links)
 Deprecated version of render_links_to_other_attempts.
 
 render_navigation_question_button (navigation_question_button $button)
 Display a quiz navigation button.
 
 render_navigation_section_heading (navigation_section_heading $heading)
 Display a quiz navigation heading.
 
 render_quiz_nav_question_button (navigation_question_button $button)
 Deprecated version of render_navigation_question_button.
 
 render_quiz_nav_section_heading (navigation_section_heading $heading)
 Deprecated version of render_navigation_section_heading.
 

Protected Attributes

xhtml_container_stack $opencontainers
 The xhtml_container_stack to use.
 
renderer_base core_renderer $output
 A reference to the current renderer.
 
moodle_page $page
 The Moodle page the renderer has been created to assist with.
 
string $target
 The requested rendering target.
 
array $templatecache = []
 $templatecache The mustache template cache.
 

Detailed Description

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ __call()

plugin_renderer_base::__call ( $method,
$arguments )
inherited

Magic method used to pass calls otherwise meant for the standard renderer to it to ensure we don't go causing unnecessary grief.

Parameters
string$method
array$arguments
Return values
mixed

◆ access_messages()

mod_quiz\output\renderer::access_messages ( $messages)

Print each message in an array, surrounded by <p>, </p> tags.

Parameters
array$messagesthe array of message strings.
Return values
stringHTML to output.

◆ add_action_handler()

renderer_base::add_action_handler ( component_action $action,
$id = null )
inherited

Adds a JS action for the element with the provided id.

This method adds a JS event for the provided component action to the page and then returns the id that the event has been attached to. If no id has been provided then a new ID is generated by html_writer::random_id()

Parameters
component_action$action
string$id
Return values
stringid of element, either original submitted or random new if not supplied

◆ attempt_form()

mod_quiz\output\renderer::attempt_form ( $attemptobj,
$page,
$slots,
$id,
$nextpage )

Outputs the form for making an attempt.

Parameters
quiz_attempt$attemptobj
int$pageCurrent page number
array$slotsArray of integers relating to questions
int$idID of the attempt
int$nextpageNext page number

◆ attempt_navigation_buttons()

mod_quiz\output\renderer::attempt_navigation_buttons ( $page,
$lastpage,
$navmethod = 'free' )
protected

Display the prev/next buttons that go at the bottom of each page of the attempt.

Parameters
int$pagethe page number. Starts at 0 for the first page.
bool$lastpageis this the last page in the quiz?
string$navmethodOptional quiz attribute, 'free' (default) or 'sequential'
Return values
stringHTML fragment.

◆ attempt_page()

mod_quiz\output\renderer::attempt_page ( $attemptobj,
$page,
$accessmanager,
$messages,
$slots,
$id,
$nextpage )

Attempt Page.

Parameters
quiz_attempt$attemptobjInstance of quiz_attempt
int$pageCurrent page number
access_manager$accessmanagerInstance of access_manager
array$messagesAn array of messages
array$slotsContains an array of integers that relate to questions
int$idThe ID of an attempt
int$nextpageThe number of the next page
Return values
stringHTML to output.

◆ attempt_state()

mod_quiz\output\renderer::attempt_state ( $attemptobj)

Generate a brief textual description of the current state of an attempt.

Parameters
quiz_attempt$attemptobjthe attempt
Return values
stringthe appropriate lang string to describe the state.

◆ chart()

mod_quiz\output\renderer::chart ( \core\chart_base $chart,
$title,
$attrs = [] )

Outputs a chart.

Parameters
core\chart_base$chartThe chart.
string$titleThe title to display above the graph.
array$attrsextra container html attributes.
Return values
stringHTML of the graph.

◆ close_attempt_popup()

mod_quiz\output\renderer::close_attempt_popup ( $url,
$message = '' )

Output a page with an optional message, and JavaScript code to close the current window and redirect the parent window to a new URL.

Parameters
moodle_url$urlthe URL to redirect the parent window to.
string$messagemessage to display before closing the window. (optional)
Return values
stringHTML to output.

◆ countdown_timer()

mod_quiz\output\renderer::countdown_timer ( quiz_attempt $attemptobj,
$timenow )

Return the HTML of the quiz timer.

Parameters
quiz_attempt$attemptobjinstance of quiz_attempt
int$timenowtimestamp to use as 'now'.
Return values
stringHTML content.

◆ during_attempt_tertiary_nav()

mod_quiz\output\renderer::during_attempt_tertiary_nav ( $quizviewurl)

Render the tertiary navigation for pages during the attempt.

Parameters
string | moodle_url$quizviewurlurl of the view.php page for this quiz.
Return values
stringHTML to output.

◆ filter_review_summary_table()

mod_quiz\output\renderer::filter_review_summary_table ( $summarydata,
$page )
protected

Filters the summarydata array.

Parameters
array$summarydatacontains row data for table
int$pagethe current page number
Return values
arrayupdated version of the $summarydata array.

◆ finish_review_link()

mod_quiz\output\renderer::finish_review_link ( quiz_attempt $attemptobj)

Returns either a link or button.

Parameters
quiz_attempt$attemptobjinstance of quiz_attempt

◆ get_compact_logo_url()

renderer_base::get_compact_logo_url ( $maxwidth = 300,
$maxheight = 300 )
inherited

Return the site's compact logo URL, if any.

Parameters
int$maxwidthThe maximum width, or null when the maximum width does not matter.
int$maxheightThe maximum height, or null when the maximum height does not matter.
Return values
moodle_url|false

◆ get_logo_url()

renderer_base::get_logo_url ( $maxwidth = null,
$maxheight = 200 )
inherited

Return the site's logo URL, if any.

Parameters
int$maxwidthThe maximum width, or null when the maximum width does not matter.
int$maxheightThe maximum height, or null when the maximum height does not matter.
Return values
moodle_url|false

◆ get_mustache()

renderer_base::get_mustache ( )
protectedinherited

Return an instance of the mustache class.

Since
2.9
Return values
Mustache_Engine

◆ graph()

mod_quiz\output\renderer::graph ( moodle_url $url,
$title )

Output a graph, or a message saying that GD is required.

Parameters
moodle_url$urlthe URL of the graph.
string$titlethe title to display above the graph.
Return values
stringHTML of the graph.

◆ has_started()

renderer_base::has_started ( )
inherited

Returns true is output has already started, and false if not.

Return values
booleantrue if the header has been printed.

◆ image_url()

renderer_base::image_url ( $imagename,
$component = 'moodle' )
inherited

Return the moodle_url for an image.

The exact image location and extension is determined automatically by searching for gif|png|jpg|jpeg, please note there can not be diferent images with the different extension. The imagename is for historical reasons a relative path name, it may be changed later for core images. It is recommended to not use subdirectories in plugin and theme pix directories.

There are three types of images: 1/ theme images - stored in theme/mytheme/pix/, use component 'theme' 2/ core images - stored in /pix/, overridden via theme/mytheme/pix_core/ 3/ plugin images - stored in mod/mymodule/pix, overridden via theme/mytheme/pix_plugins/mod/mymodule/, example: image_url('comment', 'mod_glossary')

Parameters
string$imagenamethe pathname of the image
string$componentfull plugin name (aka component) or 'theme'
Return values
moodle_url

◆ initialise_timer()

mod_quiz\output\renderer::initialise_timer ( $timerstartvalue,
$ispreview )

Initialise the JavaScript required to initialise the countdown timer.

Parameters
int$timerstartvaluetime remaining, in seconds.
bool$ispreviewtrue if this is a preview attempt.

◆ navigation_panel()

mod_quiz\output\renderer::navigation_panel ( navigation_panel_base $panel)

Outputs the navigation block panel.

Parameters
navigation_panel_base$panel

◆ no_questions_message()

mod_quiz\output\renderer::no_questions_message ( $canedit,
$editurl )

Generate a message saying that this quiz has no questions, with a button to go to the edit page, if the user has the right capability.

Parameters
bool$caneditcan the current user edit the quiz?
moodle_url$editurlURL of the edit quiz page.
Return values
stringHTML to output.
Deprecated
since Moodle 4.0 MDL-71915 - please do not use this function any more.

◆ no_review_message()

mod_quiz\output\renderer::no_review_message ( $message)

Displayed where there might normally be a review link, to explain why the review is not available at this time.

Parameters
string$messageoptional message explaining why the review is not possible.
Return values
stringHTML to output.

◆ pix_url()

renderer_base::pix_url ( $imagename,
$component = 'moodle' )
inherited

Return the direct URL for an image from the pix folder.

Use this function sparingly and never for icons. For icons use pix_icon or the pix helper in a mustache template.

Deprecated
since Moodle 3.3
Parameters
string$imagenamethe name of the icon.
string$componentspecification of one plugin like in get_string()
Return values
moodle_url

◆ prepare_classes()

static renderer_base::prepare_classes ( $classes)
staticinherited

Given an array or space-separated list of classes, prepares and returns the HTML class attribute value.

Parameters
mixed$classesSpace-separated string or array of classes
Return values
stringHTML class attribute value

◆ questions()

mod_quiz\output\renderer::questions ( quiz_attempt $attemptobj,
$reviewing,
$slots,
$page,
$showall,
display_options $displayoptions )

Renders each question.

Parameters
quiz_attempt$attemptobjinstance of quiz_attempt
bool$reviewing
array$slotsarray of integers relating to questions
int$pagecurrent page number
bool$showallif true shows attempt on single page
display_options$displayoptionsinstance of display_options

◆ quiz_attempt_summary_link_to_reports()

mod_quiz\output\renderer::quiz_attempt_summary_link_to_reports ( $quiz,
$cm,
$context,
$returnzero = false,
$currentgroup = 0 )

Returns the same as {.

See also
quiz_num_attempt_summary()} but wrapped in a link to the quiz reports.
Parameters
stdClass$quizthe quiz object. Only $quiz->id is used at the moment.
stdClass$cmthe cm object. Only $cm->course, $cm->groupmode and $cm->groupingid fields are used at the moment.
context$contextthe quiz context.
bool$returnzeroif false (default), when no attempts have been made '' is returned instead of 'Attempts: 0'.
int$currentgroupif there is a concept of current group where this method is being called (e.g. a report) pass it in here. Default 0 which means no current group.
Return values
stringHTML fragment for the link.

◆ quiz_intro()

mod_quiz\output\renderer::quiz_intro ( $quiz,
$cm )

Output the quiz intro.

Parameters
stdClass$quizthe quiz settings.
stdClass$cmthe course_module object.
Return values
stringHTML to output.

◆ quiz_notices()

mod_quiz\output\renderer::quiz_notices ( $messages)

Returns any notices.

Parameters
array$messages

◆ quiz_override_summary_links()

mod_quiz\output\renderer::quiz_override_summary_links ( stdClass $quiz,
cm_info|stdClass $cm,
$currentgroup = 0 )

Render a summary of the number of group and user overrides, with corresponding links.

Parameters
stdClass$quizthe quiz settings.
cm_info | stdClass$cmthe cm object.
int$currentgroupcurrently selected group, if there is one.
Return values
stringHTML fragment for the link.

◆ redo_question_button()

mod_quiz\output\renderer::redo_question_button ( $slot,
$disabled )

Render a button which allows students to redo a question in the attempt.

Parameters
int$slotthe number of the slot to generate the button for.
bool$disabledif true, output the button disabled.
Return values
stringHTML fragment.

◆ render()

plugin_renderer_base::render ( renderable $widget)
inherited

Renders the provided widget and returns the HTML to display it.

Parameters
renderable$widgetinstance with renderable interface
Return values
string

Reimplemented from renderer_base.

Reimplemented in core_courseformat\output\section_renderer, and tool_policy\output\renderer.

◆ render_from_template()

renderer_base::render_from_template ( $templatename,
$context )
inherited

Renders a template by name with the given context.

The provided data needs to be array/stdClass made up of only simple types. Simple types are array,stdClass,bool,int,float,string

Since
2.9
Parameters
array | stdClass$contextContext containing data for the template.
Return values
string|boolean

◆ render_links_to_other_attempts()

mod_quiz\output\renderer::render_links_to_other_attempts ( links_to_other_attempts $links)
protected

Renders a list of links the other attempts.

Parameters
links_to_other_attempts$links
Return values
stringHTML fragment.

◆ render_mod_quiz_links_to_other_attempts()

mod_quiz\output\renderer::render_mod_quiz_links_to_other_attempts ( links_to_other_attempts $links)
protected

Deprecated version of render_links_to_other_attempts.

Parameters
links_to_other_attempts$links
Return values
stringHTML fragment.
Deprecated
since Moodle 4.2. Please use render_links_to_other_attempts instead.
Todo
MDL-76612 Final deprecation in Moodle 4.6

◆ render_navigation_question_button()

mod_quiz\output\renderer::render_navigation_question_button ( navigation_question_button $button)
protected

Display a quiz navigation button.

Parameters
navigation_question_button$button
Return values
stringHTML fragment.

◆ render_navigation_section_heading()

mod_quiz\output\renderer::render_navigation_section_heading ( navigation_section_heading $heading)
protected

Display a quiz navigation heading.

Parameters
navigation_section_heading$headingthe heading.
Return values
stringHTML fragment.

◆ render_quiz_nav_question_button()

mod_quiz\output\renderer::render_quiz_nav_question_button ( navigation_question_button $button)
protected

Deprecated version of render_navigation_question_button.

Parameters
navigation_question_button$button
Return values
stringHTML fragment.
Deprecated
since Moodle 4.2. Please use render_links_to_other_attempts instead.
Todo
MDL-76612 Final deprecation in Moodle 4.6

◆ render_quiz_nav_section_heading()

mod_quiz\output\renderer::render_quiz_nav_section_heading ( navigation_section_heading $heading)
protected

Deprecated version of render_navigation_section_heading.

Parameters
navigation_section_heading$headingthe heading.
Return values
stringHTML fragment.
Deprecated
since Moodle 4.2. Please use render_links_to_other_attempts instead.
Todo
MDL-76612 Final deprecation in Moodle 4.6

◆ restart_preview_button()

mod_quiz\output\renderer::restart_preview_button ( $url)

Create a preview link.

Parameters
moodle_url$urlURL to restart the attempt.

◆ review_form()

mod_quiz\output\renderer::review_form ( $page,
$showall,
$displayoptions,
$content,
$attemptobj )

Renders the main bit of the review page.

Parameters
int$pagecurrent page number
bool$showallif true display attempt on one page
display_options$displayoptionsinstance of display_options
string$contentthe rendered display of each question
quiz_attempt$attemptobjinstance of quiz_attempt
Return values
stringHTML to display.

◆ review_link()

mod_quiz\output\renderer::review_link ( $url,
$reviewinpopup,
$popupoptions )

Output either a link to the review page for an attempt, or a button to open the review in a popup window.

Parameters
moodle_url$urlof the target page.
bool$reviewinpopupwhether a pop-up is required.
array$popupoptionsoptions to pass to the popup_action constructor.
Return values
stringHTML to output.

◆ review_next_navigation()

mod_quiz\output\renderer::review_next_navigation ( quiz_attempt $attemptobj,
$page,
$lastpage,
$showall = null )

Creates the navigation links/buttons at the bottom of the review attempt page.

Note, the name of this function is no longer accurate, but when the design changed, it was decided to keep the old name for backwards compatibility.

Parameters
quiz_attempt$attemptobjinstance of quiz_attempt
int$pagethe current page
bool$lastpageif true current page is the last page
bool | null$showallif true, the URL will be to review the entire attempt on one page, and $page will be ignored. If null, a sensible default will be chosen.
Return values
stringHTML fragment.

◆ review_page()

mod_quiz\output\renderer::review_page ( quiz_attempt $attemptobj,
$slots,
$page,
$showall,
$lastpage,
display_options $displayoptions,
$summarydata )

Builds the review page.

Parameters
quiz_attempt$attemptobjan instance of quiz_attempt.
array$slotsof slots to be displayed.
int$pagethe current page number
bool$showallwhether to show entire attempt on one page.
bool$lastpageif true the current page is the last page.
display_options$displayoptionsinstance of display_options.
array$summarydatacontains all table data
Return values
stringHTML to display.

◆ review_question_not_allowed()

mod_quiz\output\renderer::review_question_not_allowed ( quiz_attempt $attemptobj,
$message )

Renders the review question pop-up.

Parameters
quiz_attempt$attemptobjan instance of quiz_attempt.
string$messageWhy the review is not allowed.
Return values
stringhtml to output.

◆ review_question_page()

mod_quiz\output\renderer::review_question_page ( quiz_attempt $attemptobj,
$slot,
$seq,
display_options $displayoptions,
$summarydata )

Renders the review question pop-up.

Parameters
quiz_attempt$attemptobjan instance of quiz_attempt.
int$slotwhich question to display.
int$seqwhich step of the question attempt to show. null = latest.
display_options$displayoptionsinstance of display_options.
array$summarydatacontains all table data
Return values
stringHTML to display.

◆ review_summary_table()

mod_quiz\output\renderer::review_summary_table ( $summarydata,
$page )

Outputs the table containing data from summary data array.

Parameters
array$summarydatacontains row data for table
int$pagecontains the current page number
Return values
stringHTML to display.

◆ should_display_main_logo()

renderer_base::should_display_main_logo ( $headinglevel = 1)
inherited

Whether we should display the main logo.

Deprecated
since Moodle 4.0
Todo
final deprecation. To be removed in Moodle 4.4 MDL-73165.
Parameters
int$headinglevelThe heading level we want to check against.
Return values
bool

◆ should_display_navbar_logo()

renderer_base::should_display_navbar_logo ( )
inherited

Whether we should display the logo in the navbar.

We will when there are no main logos, and we have compact logo.

Return values
bool

◆ start_attempt_button()

mod_quiz\output\renderer::start_attempt_button ( $buttontext,
moodle_url $url,
preflight_check_form $preflightcheckform = null,
$popuprequired = false,
$popupoptions = null )

Generates the view attempt button.

Parameters
string$buttontextthe label to display on the button.
moodle_url$urlThe URL to POST to in order to start the attempt.
preflight_check_form | null$preflightcheckformdeprecated.
bool$popuprequiredwhether the attempt needs to be opened in a pop-up.
array$popupoptionsthe options to use if we are opening a popup.
Return values
stringHTML fragment.

◆ start_attempt_page()

mod_quiz\output\renderer::start_attempt_page ( quiz_settings $quizobj,
preflight_check_form $mform )

Render the 'start attempt' page.

The student gets here if their interaction with the preflight check from fails in some way (e.g. they typed the wrong password).

Parameters
mod_quiz\quiz_settings$quizobj
preflight_check_form$mform
Return values
string

◆ summary_page()

mod_quiz\output\renderer::summary_page ( $attemptobj,
$displayoptions )

Create the summary page.

Parameters
quiz_attempt$attemptobj
display_options$displayoptions

◆ summary_page_controls()

mod_quiz\output\renderer::summary_page_controls ( $attemptobj)

Creates any controls the page should have.

Parameters
quiz_attempt$attemptobj

◆ summary_table()

mod_quiz\output\renderer::summary_table ( $attemptobj,
$displayoptions )

Generates the table of summarydata.

Parameters
quiz_attempt$attemptobj
display_options$displayoptions

◆ view_information()

mod_quiz\output\renderer::view_information ( $quiz,
$cm,
$context,
$messages,
bool $quizhasquestions = false )

Output the page information.

Parameters
stdClass$quizthe quiz settings.
cm_info | stdClass$cmthe course_module object.
context$contextthe quiz context.
array$messagesany access messages that should be described.
bool$quizhasquestionsdoes quiz has questions added.
Return values
stringHTML to output.

◆ view_page()

mod_quiz\output\renderer::view_page ( $course,
$quiz,
$cm,
$context,
$viewobj )

Generates the view page.

Parameters
stdClass$coursethe course settings row from the database.
stdClass$quizthe quiz settings row from the database.
stdClass$cmthe course_module settings row from the database.
context_module$contextthe quiz context.
view_page$viewobj
Return values
stringHTML to display

◆ view_page_buttons()

mod_quiz\output\renderer::view_page_buttons ( view_page $viewobj)

Work out, and render, whatever buttons, and surrounding info, should appear at the end of the review page.

Parameters
view_page$viewobjthe information required to display the view page.
Return values
stringHTML to output.

◆ view_page_guest()

mod_quiz\output\renderer::view_page_guest ( $course,
$quiz,
$cm,
$context,
$messages,
$viewobj )

Outputs an error message for any guests accessing the quiz.

Parameters
stdClass$coursethe course settings row from the database.
stdClass$quizthe quiz settings row from the database.
stdClass$cmthe course_module settings row from the database.
context_module$contextthe quiz context.
array$messagesArray containing any messages
view_page$viewobj

◆ view_page_notenrolled()

mod_quiz\output\renderer::view_page_notenrolled ( $course,
$quiz,
$cm,
$context,
$messages,
$viewobj )

Outputs and error message for anyone who is not enrolled on the course.

Parameters
stdClass$coursethe course settings row from the database.
stdClass$quizthe quiz settings row from the database.
stdClass$cmthe course_module settings row from the database.
context_module$contextthe quiz context.
array$messagesArray containing any messages
view_page$viewobj

◆ view_page_tertiary_nav()

mod_quiz\output\renderer::view_page_tertiary_nav ( view_page $viewobj)

Render the tertiary navigation for the view page.

Parameters
view_page$viewobjthe information required to display the view page.
Return values
stringHTML to output.

◆ view_result_info()

mod_quiz\output\renderer::view_result_info ( $quiz,
$context,
$cm,
$viewobj )

Generates data pertaining to quiz results.

Parameters
stdClass$quizArray containing quiz data
context_module$contextThe quiz context.
stdClass | cm_info$cmThe course module information.
view_page$viewobj
Return values
stringHTML to display.

◆ view_table()

mod_quiz\output\renderer::view_table ( $quiz,
$context,
$viewobj )

Generates the table of data.

Parameters
stdClass$quizthe quiz settings.
context_module$contextthe quiz context.
view_page$viewobj

Member Data Documentation

◆ $output

renderer_base core_renderer plugin_renderer_base::$output
protectedinherited

A reference to the current renderer.

The renderer provided here will be determined by the page but will in 90% of cases by the core_renderer


The documentation for this class was generated from the following file: