|
Moodle
2.2.1
http://www.collinsharper.com
|


The renderer for the quiz module.
Definition at line 36 of file renderer.php.
| access_messages | ( | $ | messages | ) |
Print each message in an array, surrounded by <p>, </p> tags.
| array | $messages | the array of message strings. |
| bool | $return | if true, return a string, instead of outputting. |
Definition at line 515 of file renderer.php.


| attempt_form | ( | $ | attemptobj, |
| $ | page, | ||
| $ | slots, | ||
| $ | id, | ||
| $ | nextpage | ||
| ) |
Ouputs the form for making an attempt
| quiz_attempt | $attemptobj | |
| int | $page | Current page number |
| array | $slots | Array of integers relating to questions |
| int | $id | ID of the attempt |
| int | $nextpage | Next page number |
Definition at line 422 of file renderer.php.


| attempt_page | ( | $ | attemptobj, |
| $ | page, | ||
| $ | accessmanager, | ||
| $ | messages, | ||
| $ | slots, | ||
| $ | id, | ||
| $ | nextpage | ||
| ) |
Attempt Page
| quiz_attempt | $attemptobj | Instance of quiz_attempt |
| int | $page | Current page number |
| quiz_access_manager | $accessmanager | Instance of quiz_access_manager |
| array | $messages | An array of messages |
| array | $slots | Contains an array of integers that relate to questions |
| int | $id | The ID of an attempt |
| int | $nextpage | The number of the next page |
Definition at line 390 of file renderer.php.

| 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.
| moodle_url | $url | the URL to redirect the parent window to. |
| string | $message | message to display before closing the window. (optional) |
Definition at line 486 of file renderer.php.

| countdown_timer | ( | ) |
Return the HTML of the quiz timer.
Definition at line 264 of file renderer.php.


| filter_summary_table | ( | $ | summarydata, |
| $ | page | ||
| ) | [protected] |
Filters the summarydata array.
| array | $summarydata | contains row data for table |
| int | $page | the current page number |
Definition at line 115 of file renderer.php.

| finish_review_link | ( | $ | url | ) |
Returns either a liink or button
| $url | contains a url for the review link |
Definition at line 231 of file renderer.php.


| initialise_timer | ( | $ | timerstartvalue | ) |
Output the JavaScript required to initialise the countdown timer.
| int | $timerstartvalue | time remaining, in seconds. |
Definition at line 474 of file renderer.php.

| navigation_panel | ( | quiz_nav_panel_base $ | panel | ) |
Outputs the navigation block panel
| quiz_nav_panel_base | $panel | instance of quiz_nav_panel_base |
Definition at line 284 of file renderer.php.


| 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.
| object | $quiz | the quiz settings. |
| object | $cm | the course_module object. |
| object | $context | the quiz context. |
Definition at line 732 of file renderer.php.

| no_review_message | ( | $ | message | ) |
Displayed where there might normally be a review link, to explain why the review is not available at this time.
| string | $message | optional message explaining why the review is not possible. |
Definition at line 1078 of file renderer.php.

| questions | ( | quiz_attempt $ | attemptobj, |
| $ | reviewing, | ||
| $ | slots, | ||
| $ | page, | ||
| $ | showall, | ||
| mod_quiz_display_options $ | displayoptions | ||
| ) |
Renders each question
| quiz_attempt | $attemptobj | instance of quiz_attempt |
| bool | $reviewing | |
| array | $slots | array of intgers relating to questions |
| int | $page | current page number |
| bool | $showall | if true shows attempt on single page |
| mod_quiz_display_options | $displayoptions | instance of mod_quiz_display_options |
Definition at line 180 of file renderer.php.


| 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.
| object | $quiz | the quiz object. Only $quiz->id is used at the moment. |
| object | $cm | the cm object. Only $cm->course, $cm->groupmode and $cm->groupingid fields are used at the moment. |
| object | $context | the quiz context. |
| bool | $returnzero | if false (default), when no attempts have been made '' is returned instead of 'Attempts: 0'. |
| int | $currentgroup | if 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. |
Definition at line 1098 of file renderer.php.


| quiz_intro | ( | $ | quiz, |
| $ | cm | ||
| ) |
Output the quiz intro.
| object | $quiz | the quiz settings. |
| object | $cm | the course_module object. |
Definition at line 820 of file renderer.php.


| quiz_notices | ( | $ | messages | ) |
Returns any notices.
| array | $messages |
Definition at line 405 of file renderer.php.


| render_mod_quiz_links_to_other_attempts | ( | mod_quiz_links_to_other_attempts $ | links | ) | [protected] |
outputs the link the other attempts.
| mod_quiz_links_to_other_attempts | $links |
Definition at line 355 of file renderer.php.

| render_quiz_nav_question_button | ( | quiz_nav_question_button $ | button | ) | [protected] |
Returns the quizzes navigation button
| quiz_nav_question_button | $button |
Definition at line 314 of file renderer.php.

| restart_preview_button | ( | $ | url | ) |
Create a preview link
| $url | contains 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.
| array | $summarydata | contain row data for table |
| int | $page | current page number |
| mod_quiz_display_options | $displayoptions | instance of mod_quiz_display_options |
| $content | contains each question | |
| quiz_attempt | $attemptobj | instance of quiz_attempt |
| bool | $showall | if true display attempt on one page |
Definition at line 200 of file renderer.php.


| 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.
| moodle_url | $url | of the target page. |
| bool | $reviewinpopup | whether a pop-up is required. |
| array | $popupoptions | options to pass to the popup_action constructor. |
Definition at line 1060 of file renderer.php.

| review_next_navigation | ( | quiz_attempt $ | attemptobj, |
| $ | page, | ||
| $ | lastpage | ||
| ) |
Creates a next page arrow or the finishing link
| quiz_attempt | $attemptobj | instance of quiz_attempt |
| int | $page | the current page |
| bool | $lastpage | if true current page is the last page |
Definition at line 251 of file renderer.php.


| review_page | ( | quiz_attempt $ | attemptobj, |
| $ | slots, | ||
| $ | page, | ||
| $ | showall, | ||
| $ | lastpage, | ||
| mod_quiz_display_options $ | displayoptions, | ||
| $ | summarydata | ||
| ) |
Builds the review page
| quiz_attempt | $attemptobj | an instance of quiz_attempt. |
| array | $slots | an array of intgers relating to questions. |
| int | $page | the current page number |
| bool | $showall | whether to show entire attempt on one page. |
| bool | $lastpage | if true the current page is the last page. |
| mod_quiz_display_options | $displayoptions | instance of mod_quiz_display_options. |
| array | $summarydata | contains all table data |
Definition at line 49 of file renderer.php.

| review_question_not_allowed | ( | $ | message | ) |
Renders the review question pop-up.
| string | $message | Why the review is not allowed. |
Definition at line 99 of file renderer.php.

| review_question_page | ( | quiz_attempt $ | attemptobj, |
| $ | slot, | ||
| $ | seq, | ||
| mod_quiz_display_options $ | displayoptions, | ||
| $ | summarydata | ||
| ) |
Renders the review question pop-up.
| quiz_attempt | $attemptobj | an instance of quiz_attempt. |
| int | $slot | which question to display. |
| int | $seq | which step of the question attempt to show. null = latest. |
| mod_quiz_display_options | $displayoptions | instance of mod_quiz_display_options. |
| array | $summarydata | contains all table data |
Definition at line 75 of file renderer.php.

| review_summary_table | ( | $ | summarydata, |
| $ | page | ||
| ) |
Outputs the table containing data from summary data array
| array | $summarydata | contains row data for table |
| int | $page | contains the current page number |
Definition at line 136 of file renderer.php.


| start_attempt_button | ( | $ | buttontext, |
| moodle_url $ | url, | ||
| $ | startattemptwarning, | ||
| $ | popuprequired, | ||
| $ | popupoptions | ||
| ) |
Generates the view attempt button
| int | $course | The course ID |
| array | $quiz | Array containging quiz date |
| int | $cm | The Course Module ID |
| int | $context | The page Context ID |
| mod_quiz_view_object | $viewobj | |
| string | $buttontext |
Definition at line 692 of file renderer.php.


| start_attempt_page | ( | quiz $ | quizobj, |
| mod_quiz_preflight_check_form $ | mform | ||
| ) |
| summary_page | ( | $ | attemptobj, |
| $ | displayoptions | ||
| ) |
Create the summary page
| quiz_attempt | $attemptobj | |
| mod_quiz_display_options | $displayoptions |
Definition at line 532 of file renderer.php.

| summary_page_controls | ( | $ | attemptobj | ) |
Creates any controls a the page should have.
| quiz_attempt | $attemptobj |
Definition at line 597 of file renderer.php.


| summary_table | ( | $ | attemptobj, |
| $ | displayoptions | ||
| ) |
Generates the table of summarydata
| quiz_attempt | $attemptobj | |
| mod_quiz_display_options | $displayoptions |
Definition at line 549 of file renderer.php.


| view_best_score | ( | $ | viewobj | ) |
Prints the students best score
| mod_quiz_view_object | $viewobj |
Definition at line 987 of file renderer.php.

| view_information | ( | $ | quiz, |
| $ | cm, | ||
| $ | context, | ||
| $ | messages | ||
| ) |
Output the page information
| object | $quiz | the quiz settings. |
| object | $cm | the course_module object. |
| object | $context | the quiz context. |
| array | $messages | any access messages that should be described. |
Definition at line 790 of file renderer.php.


| view_page | ( | $ | course, |
| $ | quiz, | ||
| $ | cm, | ||
| $ | context, | ||
| $ | viewobj | ||
| ) |
Generates the view page
| int | $course | The id of the course |
| array | $quiz | Array conting quiz data |
| int | $cm | Course Module ID |
| int | $context | The page context ID |
| array | $infomessages | information about this quiz |
| mod_quiz_view_object | $viewobj | |
| string | $buttontext | text for the start/continue attempt button, if it should be shown. |
| array | $infomessages | further information about why the student cannot attempt this quiz now, if appicable this quiz |
Definition at line 641 of file renderer.php.

| view_page_buttons | ( | mod_quiz_view_object $ | viewobj | ) |
Work out, and render, whatever buttons, and surrounding info, should appear at the end of the review page.
| mod_quiz_view_object | $viewobj | the information required to display the view page. |
Definition at line 658 of file renderer.php.


| view_page_guest | ( | $ | course, |
| $ | quiz, | ||
| $ | cm, | ||
| $ | context, | ||
| $ | messages | ||
| ) |
Outputs an error message for any guests accessing the quiz
| int | $course | The course ID |
| array | $quiz | Array contingin quiz data |
| int | $cm | Course Module ID |
| int | $context | The page contect ID |
| array | $messages | Array containing any messages |
Definition at line 751 of file renderer.php.

| view_page_notenrolled | ( | $ | course, |
| $ | quiz, | ||
| $ | cm, | ||
| $ | context, | ||
| $ | messages | ||
| ) |
Outputs and error message for anyone who is not enrolle don the course
| int | $course | The course ID |
| array | $quiz | Array contingin quiz data |
| int | $cm | Course Module ID |
| int | $context | The page contect ID |
| array | $messages | Array containing any messages |
Definition at line 770 of file renderer.php.

| view_result_info | ( | $ | quiz, |
| $ | context, | ||
| $ | cm, | ||
| $ | viewobj | ||
| ) |
Generates data pertaining to quiz results
| array | $quiz | Array containing quiz data |
| int | $context | The page context ID |
| int | $cm | The Course Module Id |
| mod_quiz_view_object | $viewobj |
Definition at line 1004 of file renderer.php.


| view_table | ( | $ | quiz, |
| $ | context, | ||
| $ | viewobj | ||
| ) |
Generates the table of data
| array | $quiz | Array contining quiz data |
| int | $context | The page context ID |
| mod_quiz_view_object | $viewobj |
Definition at line 844 of file renderer.php.


Generates the table heading.
Definition at line 833 of file renderer.php.
