Moodle  2.2.1
http://www.collinsharper.com
mod_quiz_renderer Class Reference
Inheritance diagram for mod_quiz_renderer:
Collaboration diagram for mod_quiz_renderer:

Public Member Functions

 review_page (quiz_attempt $attemptobj, $slots, $page, $showall, $lastpage, mod_quiz_display_options $displayoptions, $summarydata)
 review_question_page (quiz_attempt $attemptobj, $slot, $seq, mod_quiz_display_options $displayoptions, $summarydata)
 review_question_not_allowed ($message)
 review_summary_table ($summarydata, $page)
 questions (quiz_attempt $attemptobj, $reviewing, $slots, $page, $showall, mod_quiz_display_options $displayoptions)
 review_form ($page, $showall, $displayoptions, $content, $attemptobj)
 finish_review_link ($url)
 review_next_navigation (quiz_attempt $attemptobj, $page, $lastpage)
 countdown_timer ()
 restart_preview_button ($url)
 navigation_panel (quiz_nav_panel_base $panel)
 start_attempt_page (quiz $quizobj, mod_quiz_preflight_check_form $mform)
 attempt_page ($attemptobj, $page, $accessmanager, $messages, $slots, $id, $nextpage)
 quiz_notices ($messages)
 attempt_form ($attemptobj, $page, $slots, $id, $nextpage)
 initialise_timer ($timerstartvalue)
 close_attempt_popup ($url, $message= '')
 access_messages ($messages)
 summary_page ($attemptobj, $displayoptions)
 summary_table ($attemptobj, $displayoptions)
 summary_page_controls ($attemptobj)
 view_page ($course, $quiz, $cm, $context, $viewobj)
 view_page_buttons (mod_quiz_view_object $viewobj)
 start_attempt_button ($buttontext, moodle_url $url, $startattemptwarning, $popuprequired, $popupoptions)
 no_questions_message ($canedit, $editurl)
 view_page_guest ($course, $quiz, $cm, $context, $messages)
 view_page_notenrolled ($course, $quiz, $cm, $context, $messages)
 view_information ($quiz, $cm, $context, $messages)
 quiz_intro ($quiz, $cm)
 view_table_heading ()
 view_table ($quiz, $context, $viewobj)
 view_best_score ($viewobj)
 view_result_info ($quiz, $context, $cm, $viewobj)
 review_link ($url, $reviewinpopup, $popupoptions)
 no_review_message ($message)
 quiz_attempt_summary_link_to_reports ($quiz, $cm, $context, $returnzero=false, $currentgroup=0)

Protected Member Functions

 filter_summary_table ($summarydata, $page)
 render_quiz_nav_question_button (quiz_nav_question_button $button)
 render_mod_quiz_links_to_other_attempts (mod_quiz_links_to_other_attempts $links)

Detailed Description

The renderer for the quiz module.

Definition at line 36 of file renderer.php.


Member Function Documentation

access_messages ( messages)

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

Parameters:
array$messagesthe array of message strings.
bool$returnif true, return a string, instead of outputting.
Returns:
string HTML to output.

Definition at line 515 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

attempt_form ( attemptobj,
page,
slots,
id,
nextpage 
)

Ouputs 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

Definition at line 422 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

attempt_page ( attemptobj,
page,
accessmanager,
messages,
slots,
id,
nextpage 
)

Attempt Page

Parameters:
quiz_attempt$attemptobjInstance of quiz_attempt
int$pageCurrent page number
quiz_access_manager$accessmanagerInstance of quiz_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

Definition at line 390 of file renderer.php.

Here is the call graph for this function:

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)
Returns:
string HTML to output.

Definition at line 486 of file renderer.php.

Here is the call graph for this function:

Return the HTML of the quiz timer.

Returns:
string HTML content.

Definition at line 264 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

filter_summary_table ( summarydata,
page 
) [protected]

Filters the summarydata array.

Parameters:
array$summarydatacontains row data for table
int$pagethe current page number
Returns:
$summarydata containing filtered row data

Definition at line 115 of file renderer.php.

Here is the caller graph for this function:

finish_review_link ( url)

Returns either a liink or button

Parameters:
$urlcontains a url for the review link

Definition at line 231 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

initialise_timer ( timerstartvalue)

Output the JavaScript required to initialise the countdown timer.

Parameters:
int$timerstartvaluetime remaining, in seconds.

Definition at line 474 of file renderer.php.

Here is the call graph for this function:

Outputs the navigation block panel

Parameters:
quiz_nav_panel_base$panelinstance of quiz_nav_panel_base

Definition at line 284 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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:
object$quizthe quiz settings.
object$cmthe course_module object.
object$contextthe quiz context.
Returns:
string HTML to output.

Definition at line 732 of file renderer.php.

Here is the caller graph for this function:

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.
Returns:
string HTML to output.

Definition at line 1078 of file renderer.php.

Here is the call graph for this function:

questions ( quiz_attempt attemptobj,
reviewing,
slots,
page,
showall,
mod_quiz_display_options displayoptions 
)

Renders each question

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

Definition at line 180 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

quiz_attempt_summary_link_to_reports ( quiz,
cm,
context,
returnzero = false,
currentgroup = 0 
)

Returns the same as quiz_num_attempt_summary() but wrapped in a link to the quiz reports.

Parameters:
object$quizthe quiz object. Only $quiz->id is used at the moment.
object$cmthe cm object. Only $cm->course, $cm->groupmode and $cm->groupingid fields are used at the moment.
object$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.
Returns:
string HTML fragment for the link.

Definition at line 1098 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

quiz_intro ( quiz,
cm 
)

Output the quiz intro.

Parameters:
object$quizthe quiz settings.
object$cmthe course_module object.
Returns:
string HTML to output.

Definition at line 820 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

quiz_notices ( messages)

Returns any notices.

Parameters:
array$messages

Definition at line 405 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

outputs the link the other attempts.

Parameters:
mod_quiz_links_to_other_attempts$links

Definition at line 355 of file renderer.php.

Here is the call graph for this function:

Returns the quizzes navigation button

Parameters:
quiz_nav_question_button$button

Definition at line 314 of file renderer.php.

Here is the call graph for this function:

Create a preview link

Parameters:
$urlcontains a url to the given page

Definition at line 275 of file renderer.php.

review_form ( page,
showall,
displayoptions,
content,
attemptobj 
)

Renders the main bit of the review page.

Parameters:
array$summarydatacontain row data for table
int$pagecurrent page number
mod_quiz_display_options$displayoptionsinstance of mod_quiz_display_options
$contentcontains each question
quiz_attempt$attemptobjinstance of quiz_attempt
bool$showallif true display attempt on one page

Definition at line 200 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.
Returns:
string HTML to output.

Definition at line 1060 of file renderer.php.

Here is the call graph for this function:

review_next_navigation ( quiz_attempt attemptobj,
page,
lastpage 
)

Creates a next page arrow or the finishing link

Parameters:
quiz_attempt$attemptobjinstance of quiz_attempt
int$pagethe current page
bool$lastpageif true current page is the last page

Definition at line 251 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

review_page ( quiz_attempt attemptobj,
slots,
page,
showall,
lastpage,
mod_quiz_display_options displayoptions,
summarydata 
)

Builds the review page

Parameters:
quiz_attempt$attemptobjan instance of quiz_attempt.
array$slotsan array of intgers relating to questions.
int$pagethe current page number
bool$showallwhether to show entire attempt on one page.
bool$lastpageif true the current page is the last page.
mod_quiz_display_options$displayoptionsinstance of mod_quiz_display_options.
array$summarydatacontains all table data
Returns:
$output containing html data.

Definition at line 49 of file renderer.php.

Here is the call graph for this function:

Renders the review question pop-up.

Parameters:
string$messageWhy the review is not allowed.
Returns:
string html to output.

Definition at line 99 of file renderer.php.

Here is the call graph for this function:

review_question_page ( quiz_attempt attemptobj,
slot,
seq,
mod_quiz_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.
mod_quiz_display_options$displayoptionsinstance of mod_quiz_display_options.
array$summarydatacontains all table data
Returns:
$output containing html data.

Definition at line 75 of file renderer.php.

Here is the call graph for this function:

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

Definition at line 136 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

start_attempt_button ( buttontext,
moodle_url url,
startattemptwarning,
popuprequired,
popupoptions 
)

Generates the view attempt button

Parameters:
int$courseThe course ID
array$quizArray containging quiz date
int$cmThe Course Module ID
int$contextThe page Context ID
mod_quiz_view_object$viewobj
string$buttontext

Definition at line 692 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 368 of file renderer.php.

Here is the call graph for this function:

summary_page ( attemptobj,
displayoptions 
)

Create the summary page

Parameters:
quiz_attempt$attemptobj
mod_quiz_display_options$displayoptions

Definition at line 532 of file renderer.php.

Here is the call graph for this function:

summary_page_controls ( attemptobj)

Creates any controls a the page should have.

Parameters:
quiz_attempt$attemptobj

Definition at line 597 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

summary_table ( attemptobj,
displayoptions 
)

Generates the table of summarydata

Parameters:
quiz_attempt$attemptobj
mod_quiz_display_options$displayoptions

Definition at line 549 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

view_best_score ( viewobj)

Prints the students best score

Parameters:
mod_quiz_view_object$viewobj

Definition at line 987 of file renderer.php.

Here is the caller graph for this function:

view_information ( quiz,
cm,
context,
messages 
)

Output the page information

Parameters:
object$quizthe quiz settings.
object$cmthe course_module object.
object$contextthe quiz context.
array$messagesany access messages that should be described.
Returns:
string HTML to output.

Definition at line 790 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

view_page ( course,
quiz,
cm,
context,
viewobj 
)

Generates the view page

Parameters:
int$courseThe id of the course
array$quizArray conting quiz data
int$cmCourse Module ID
int$contextThe page context ID
array$infomessagesinformation about this quiz
mod_quiz_view_object$viewobj
string$buttontexttext for the start/continue attempt button, if it should be shown.
array$infomessagesfurther information about why the student cannot attempt this quiz now, if appicable this quiz

Definition at line 641 of file renderer.php.

Here is the call graph for this function:

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

Parameters:
mod_quiz_view_object$viewobjthe information required to display the view page.
Returns:
string HTML to output.

Definition at line 658 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

view_page_guest ( course,
quiz,
cm,
context,
messages 
)

Outputs an error message for any guests accessing the quiz

Parameters:
int$courseThe course ID
array$quizArray contingin quiz data
int$cmCourse Module ID
int$contextThe page contect ID
array$messagesArray containing any messages

Definition at line 751 of file renderer.php.

Here is the call graph for this function:

view_page_notenrolled ( course,
quiz,
cm,
context,
messages 
)

Outputs and error message for anyone who is not enrolle don the course

Parameters:
int$courseThe course ID
array$quizArray contingin quiz data
int$cmCourse Module ID
int$contextThe page contect ID
array$messagesArray containing any messages

Definition at line 770 of file renderer.php.

Here is the call graph for this function:

view_result_info ( quiz,
context,
cm,
viewobj 
)

Generates data pertaining to quiz results

Parameters:
array$quizArray containing quiz data
int$contextThe page context ID
int$cmThe Course Module Id
mod_quiz_view_object$viewobj

Definition at line 1004 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

view_table ( quiz,
context,
viewobj 
)

Generates the table of data

Parameters:
array$quizArray contining quiz data
int$contextThe page context ID
mod_quiz_view_object$viewobj

Definition at line 844 of file renderer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Generates the table heading.

Definition at line 833 of file renderer.php.

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations