Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]
Defines the renderer for the quiz module.
Copyright: | 2011 The Open University |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 1493 lines (61 kb) |
Included or required: | 0 times |
Referenced: | 1 time |
Includes or requires: | 0 files |
mod_quiz_renderer:: (48 methods):
review_page()
review_question_page()
review_question_not_allowed()
filter_review_summary_table()
review_summary_table()
questions()
review_form()
finish_review_link()
review_next_navigation()
countdown_timer()
restart_preview_button()
navigation_panel()
render_quiz_nav_question_button()
render_quiz_nav_section_heading()
render_mod_quiz_links_to_other_attempts()
start_attempt_page()
attempt_page()
during_attempt_tertiary_nav()
quiz_notices()
attempt_form()
attempt_navigation_buttons()
redo_question_button()
initialise_timer()
close_attempt_popup()
access_messages()
summary_page()
summary_table()
summary_page_controls()
view_page()
view_page_tertiary_nav()
view_page_buttons()
start_attempt_button()
no_questions_message()
view_page_guest()
view_page_notenrolled()
view_information()
quiz_intro()
view_table_heading()
view_table()
attempt_state()
view_result_info()
review_link()
no_review_message()
quiz_attempt_summary_link_to_reports()
quiz_override_summary_links()
chart()
graph()
connection_warning()
mod_quiz_links_to_other_attempts:: (0 methods):
mod_quiz_view_object:: (1 method):
__get()
Class: mod_quiz_renderer - X-Ref
The renderer for the quiz module.review_page(quiz_attempt $attemptobj, $slots, $page, $showall,$lastpage, mod_quiz_display_options $displayoptions,$summarydata) X-Ref |
Builds the review page return: $output containing html data. param: quiz_attempt $attemptobj an instance of quiz_attempt. param: array $slots an array of intgers relating to questions. param: int $page the current page number param: bool $showall whether to show entire attempt on one page. param: bool $lastpage if true the current page is the last page. param: mod_quiz_display_options $displayoptions instance of mod_quiz_display_options. param: array $summarydata contains all table data |
review_question_page(quiz_attempt $attemptobj, $slot, $seq,mod_quiz_display_options $displayoptions, $summarydata) X-Ref |
Renders the review question pop-up. return: $output containing html data. param: quiz_attempt $attemptobj an instance of quiz_attempt. param: int $slot which question to display. param: int $seq which step of the question attempt to show. null = latest. param: mod_quiz_display_options $displayoptions instance of mod_quiz_display_options. param: array $summarydata contains all table data |
review_question_not_allowed(quiz_attempt $attemptobj, $message) X-Ref |
Renders the review question pop-up. return: string html to output. param: quiz_attempt $attemptobj an instance of quiz_attempt. param: string $message Why the review is not allowed. |
filter_review_summary_table($summarydata, $page) X-Ref |
Filters the summarydata array. return: $summarydata containing filtered row data param: array $summarydata contains row data for table param: int $page the current page number |
review_summary_table($summarydata, $page) X-Ref |
Outputs the table containing data from summary data array param: array $summarydata contains row data for table param: int $page contains the current page number |
questions(quiz_attempt $attemptobj, $reviewing, $slots, $page, $showall,mod_quiz_display_options $displayoptions) X-Ref |
Renders each question param: quiz_attempt $attemptobj instance of quiz_attempt param: bool $reviewing param: array $slots array of intgers relating to questions param: int $page current page number param: bool $showall if true shows attempt on single page param: mod_quiz_display_options $displayoptions instance of mod_quiz_display_options |
review_form($page, $showall, $displayoptions, $content, $attemptobj) X-Ref |
Renders the main bit of the review page. param: array $summarydata contain row data for table param: int $page current page number param: mod_quiz_display_options $displayoptions instance of mod_quiz_display_options param: $content contains each question param: quiz_attempt $attemptobj instance of quiz_attempt param: bool $showall if true display attempt on one page |
finish_review_link(quiz_attempt $attemptobj) X-Ref |
Returns either a liink or button param: quiz_attempt $attemptobj instance of quiz_attempt |
review_next_navigation(quiz_attempt $attemptobj, $page, $lastpage, $showall = null) X-Ref |
Creates the navigation links/buttons at the bottom of the reivew 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. return: string HTML fragment. param: quiz_attempt $attemptobj instance of quiz_attempt param: int $page the current page param: bool $lastpage if true current page is the last page param: bool|null $showall if true, the URL will be to review the entire attempt on one page, |
countdown_timer(quiz_attempt $attemptobj, $timenow) X-Ref |
Return the HTML of the quiz timer. return: string HTML content. |
restart_preview_button($url) X-Ref |
Create a preview link param: moodle_url $url contains a url to the given page |
navigation_panel(quiz_nav_panel_base $panel) X-Ref |
Outputs the navigation block panel param: quiz_nav_panel_base $panel instance of quiz_nav_panel_base |
render_quiz_nav_question_button(quiz_nav_question_button $button) X-Ref |
Display a quiz navigation button. return: string HTML fragment. param: quiz_nav_question_button $button |
render_quiz_nav_section_heading(quiz_nav_section_heading $heading) X-Ref |
Display a quiz navigation heading. return: string HTML fragment. param: quiz_nav_section_heading $heading the heading. |
render_mod_quiz_links_to_other_attempts(mod_quiz_links_to_other_attempts $links) X-Ref |
outputs the link the other attempts. param: mod_quiz_links_to_other_attempts $links |
start_attempt_page(quiz $quizobj, mod_quiz_preflight_check_form $mform) X-Ref |
No description |
attempt_page($attemptobj, $page, $accessmanager, $messages, $slots, $id,$nextpage) X-Ref |
Attempt Page return: string HTML to output. param: quiz_attempt $attemptobj Instance of quiz_attempt param: int $page Current page number param: quiz_access_manager $accessmanager Instance of quiz_access_manager param: array $messages An array of messages param: array $slots Contains an array of integers that relate to questions param: int $id The ID of an attempt param: int $nextpage The number of the next page |
during_attempt_tertiary_nav($quizviewurl) X-Ref |
Render the tertiary navigation for pages during the attempt. return: string HTML to output. param: string|moodle_url $quizviewurl url of the view.php page for this quiz. |
quiz_notices($messages) X-Ref |
Returns any notices. param: array $messages |
attempt_form($attemptobj, $page, $slots, $id, $nextpage) X-Ref |
Ouputs the form for making an attempt param: quiz_attempt $attemptobj param: int $page Current page number param: array $slots Array of integers relating to questions param: int $id ID of the attempt param: int $nextpage Next page number |
attempt_navigation_buttons($page, $lastpage, $navmethod = 'free') X-Ref |
Display the prev/next buttons that go at the bottom of each page of the attempt. return: string HTML fragment. param: int $page the page number. Starts at 0 for the first page. param: bool $lastpage is this the last page in the quiz? param: string $navmethod Optional quiz attribute, 'free' (default) or 'sequential' |
redo_question_button($slot, $disabled) X-Ref |
Render a button which allows students to redo a question in the attempt. return: string HTML fragment. param: int $slot the number of the slot to generate the button for. param: bool $disabled if true, output the button disabled. |
initialise_timer($timerstartvalue, $ispreview) X-Ref |
Output the JavaScript required to initialise the countdown timer. param: int $timerstartvalue time remaining, in seconds. |
close_attempt_popup($url, $message = '') X-Ref |
Output a page with an optional message, and JavaScript code to close the current window and redirect the parent window to a new URL. return: string HTML to output. param: moodle_url $url the URL to redirect the parent window to. param: string $message message to display before closing the window. (optional) |
access_messages($messages) X-Ref |
Print each message in an array, surrounded by <p>, </p> tags. return: string HTML to output. param: array $messages the array of message strings. param: bool $return if true, return a string, instead of outputting. |
summary_page($attemptobj, $displayoptions) X-Ref |
Create the summary page param: quiz_attempt $attemptobj param: mod_quiz_display_options $displayoptions |
summary_table($attemptobj, $displayoptions) X-Ref |
Generates the table of summarydata param: quiz_attempt $attemptobj param: mod_quiz_display_options $displayoptions |
summary_page_controls($attemptobj) X-Ref |
Creates any controls a the page should have. param: quiz_attempt $attemptobj |
view_page($course, $quiz, $cm, $context, $viewobj) X-Ref |
Generates the view page return: string HTML to display param: stdClass $course the course settings row from the database. param: stdClass $quiz the quiz settings row from the database. param: stdClass $cm the course_module settings row from the database. param: context_module $context the quiz context. param: mod_quiz_view_object $viewobj |
view_page_tertiary_nav(mod_quiz_view_object $viewobj) X-Ref |
Render the tertiary navigation for the view page. return: string HTML to output. param: mod_quiz_view_object $viewobj the information required to display the view page. |
view_page_buttons(mod_quiz_view_object $viewobj) X-Ref |
Work out, and render, whatever buttons, and surrounding info, should appear at the end of the review page. return: string HTML to output. param: mod_quiz_view_object $viewobj the information required to display the view page. |
start_attempt_button($buttontext, moodle_url $url,mod_quiz_preflight_check_form $preflightcheckform = null,$popuprequired = false, $popupoptions = null) X-Ref |
Generates the view attempt button return: string HTML fragment. param: string $buttontext the label to display on the button. param: moodle_url $url The URL to POST to in order to start the attempt. param: mod_quiz_preflight_check_form $preflightcheckform deprecated. param: bool $popuprequired whether the attempt needs to be opened in a pop-up. param: array $popupoptions the options to use if we are opening a popup. |
no_questions_message($canedit, $editurl) X-Ref |
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. return: string HTML to output. param: bool $canedit can the current user edit the quiz? param: moodle_url $editurl URL of the edit quiz page. |
view_page_guest($course, $quiz, $cm, $context, $messages, $viewobj) X-Ref |
Outputs an error message for any guests accessing the quiz param: stdClass $course the course settings row from the database. param: stdClass $quiz the quiz settings row from the database. param: stdClass $cm the course_module settings row from the database. param: context_module $context the quiz context. param: array $messages Array containing any messages param: mod_quiz_view_object $viewobj |
view_page_notenrolled($course, $quiz, $cm, $context, $messages, $viewobj) X-Ref |
Outputs and error message for anyone who is not enrolle don the course param: stdClass $course the course settings row from the database. param: stdClass $quiz the quiz settings row from the database. param: stdClass $cm the course_module settings row from the database. param: context_module $context the quiz context. param: array $messages Array containing any messages param: mod_quiz_view_object $viewobj |
view_information($quiz, $cm, $context, $messages, bool $quizhasquestions = false) X-Ref |
Output the page information return: string HTML to output. param: object $quiz the quiz settings. param: object $cm the course_module object. param: context $context the quiz context. param: array $messages any access messages that should be described. param: bool $quizhasquestions does quiz has questions added. |
quiz_intro($quiz, $cm) X-Ref |
Output the quiz intro. return: string HTML to output. param: object $quiz the quiz settings. param: object $cm the course_module object. |
view_table_heading() X-Ref |
Generates the table heading. |
view_table($quiz, $context, $viewobj) X-Ref |
Generates the table of data param: array $quiz Array contining quiz data param: int $context The page context ID param: mod_quiz_view_object $viewobj |
attempt_state($attemptobj) X-Ref |
Generate a brief textual desciption of the current state of an attempt. return: string the appropriate lang string to describe the state. param: quiz_attempt $attemptobj the attempt param: int $timenow the time to use as 'now'. |
view_result_info($quiz, $context, $cm, $viewobj) X-Ref |
Generates data pertaining to quiz results param: array $quiz Array containing quiz data param: int $context The page context ID param: int $cm The Course Module Id param: mod_quiz_view_object $viewobj |
review_link($url, $reviewinpopup, $popupoptions) X-Ref |
Output either a link to the review page for an attempt, or a button to open the review in a popup window. return: string HTML to output. param: moodle_url $url of the target page. param: bool $reviewinpopup whether a pop-up is required. param: array $popupoptions options to pass to the popup_action constructor. |
no_review_message($message) X-Ref |
Displayed where there might normally be a review link, to explain why the review is not available at this time. return: string HTML to output. param: string $message optional message explaining why the review is not possible. |
quiz_attempt_summary_link_to_reports($quiz, $cm, $context,$returnzero = false, $currentgroup = 0) X-Ref |
Returns the same as {@link quiz_num_attempt_summary()} but wrapped in a link to the quiz reports. return: string HTML fragment for the link. param: stdClass $quiz the quiz object. Only $quiz->id is used at the moment. param: stdClass $cm the cm object. Only $cm->course, $cm->groupmode and $cm->groupingid param: context $context the quiz context. param: bool $returnzero if false (default), when no attempts have been made '' is returned param: int $currentgroup if there is a concept of current group where this method is being |
quiz_override_summary_links(stdClass $quiz, stdClass $cm, $currentgroup = 0) X-Ref |
Render a summary of the number of group and user overrides, with corresponding links. return: string HTML fragment for the link. param: stdClass $quiz the quiz settings. param: stdClass|cm_info $cm the cm object. param: int $currentgroup currently selected group, if there is one. |
chart(\core\chart_base $chart, $title, $attrs = []) X-Ref |
Outputs a chart. return: string HTML fragment for the graph. param: \core\chart_base $chart The chart. param: string $title The title to display above the graph. param: array $attrs extra container html attributes. |
graph(moodle_url $url, $title) X-Ref |
Output a graph, or a message saying that GD is required. return: string HTML fragment for the graph. param: moodle_url $url the URL of the graph. param: string $title the title to display above the graph. |
connection_warning() X-Ref |
Output the connection warning messages, which are initially hidden, and only revealed by JavaScript if necessary. |
Class: mod_quiz_links_to_other_attempts - X-Ref