Moodle PHP Documentation 5.0
Moodle 5.0.1+ (Build: 20250711) (61af040cd5f)
|
Public Member Functions | |
add_attempt_grades_if_appropriate (quiz_attempt $attemptobj, display_options $options,) | |
Add the grade information to this summary information. | |
add_item (string $shortname, string|renderable $title, string|renderable $content) | |
Add an item to the summary. | |
add_item_after (string $shortname, string|renderable $title, string|renderable $content, string $addafter,) | |
Add an item to the summary just after the given item. | |
add_item_before (string $shortname, string|renderable $title, string|renderable $content, string $addbefore,) | |
Add an item to the summary just before the given item. | |
export_for_template (renderer_base $output) | |
Function to export the renderer data in a format that is suitable for a mustache template. | |
export_for_template (renderer_base $output) | |
filter_keeping_only (array $shortnames) | |
Filter the data held, to keep only the information with the given shortnames. | |
get_template_name (renderer_base $renderer) | |
Get the name of the template to use for this templatable. | |
get_template_name (renderer_base $renderer) | |
remove_item (string $shortname) | |
Remove an item, if present. | |
set_caption (string $caption) | |
Set the caption for the summary table. | |
Static Public Member Functions | |
static | create_for_attempt (quiz_attempt $attemptobj, display_options $options, ?int $pageforlinkingtootherattempts=null, ?bool $showall=null,) |
Initialise an instance of this class for a particular quiz attempt. | |
static | create_from_legacy_array (array $items) |
To aid conversion of old code. | |
Protected Member Functions | |
insert_new_item_at_position (string $shortname, string|renderable $title, string|renderable $content, int $position,) | |
Add an item to the summary just before the given position. | |
Protected Attributes | |
string string | $caption = '' |
The caption for attempt summary table. | |
array[] array | $summarydata = [] |
The rows of summary data. | |
mod_quiz\output\attempt_summary_information::add_attempt_grades_if_appropriate | ( | quiz_attempt | $attemptobj, |
display_options | $options ) |
Add the grade information to this summary information.
This is a helper used by {
quiz_attempt | $attemptobj | the attempt to summarise. |
display_options | $options | options for what can be seen. |
float|null | the overall attempt grade, if it exists, else null. Raw value, not formatted. |
mod_quiz\output\attempt_summary_information::add_item | ( | string | $shortname, |
string|renderable | $title, | ||
string|renderable | $content ) |
Add an item to the summary.
string | $shortname | unique identifier of this item (not displayed). |
string | renderable | $title | the title of this item. |
string | renderable | $content | the content of this item. |
mod_quiz\output\attempt_summary_information::add_item_after | ( | string | $shortname, |
string|renderable | $title, | ||
string|renderable | $content, | ||
string | $addafter ) |
Add an item to the summary just after the given item.
If that item is not present, then just add at the end.
string | $shortname | unique identifier of this item (not displayed). |
string | renderable | $title | the title of this item. |
string | renderable | $content | the content of this item. |
string | $addafter | identifier of the other item to add this before. |
mod_quiz\output\attempt_summary_information::add_item_before | ( | string | $shortname, |
string|renderable | $title, | ||
string|renderable | $content, | ||
string | $addbefore ) |
Add an item to the summary just before the given item.
If that item is not present, then add as the first item.
string | $shortname | unique identifier of this item (not displayed). |
string | renderable | $title | the title of this item. |
string | renderable | $content | the content of this item. |
string | $addbefore | identifier of the other item to add this before. |
|
static |
Initialise an instance of this class for a particular quiz attempt.
quiz_attempt | $attemptobj | the attempt to summarise. |
display_options | $options | options for what can be seen. |
int | null | $pageforlinkingtootherattempts | if null, no links to other attempsts will be created. If specified, the URL of this particular page of the attempt, otherwise the URL will go to the first page. If -1, deduce $page from $slot. |
bool | null | $showall | if 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. |
self | summary information. |
|
static |
To aid conversion of old code.
This converts the old array format into an instance of this class.
array | $items | array of $shortname => [$title, $content]. |
static |
|
inherited |
Function to export the renderer data in a format that is suitable for a mustache template.
This means:
renderer_base | $output | Used to do a final render of any components that need to be rendered for export. |
stdClass|array |
Implemented in core\output\action_menu, core\output\actions\component_action, core\output\activity_header, core\output\checkbox_toggleall, core\output\choicelist, core\output\chooser, core\output\chooser_item, core\output\chooser_section, core\output\comboboxsearch, core\output\context_header, core\output\custom_menu_item, core\output\dynamic_tabs, core\output\help_icon, core\output\initials_bar, core\output\paging_bar, core\output\pix_icon, core\output\pix_icon_font, core\output\progress_bar, core\output\select_menu, core\output\single_select, core\output\tabobject, core\output\tabtree, core\output\task_indicator, core\output\url_select, core_calendar\output\humandate, core_calendar\output\humantimeperiod, core_course\output\actionbar\group_selector_button, core_course\output\actionbar\group_selector_dropdown_form, core_course\output\actionbar\initials_dropdown_form, core_course\output\actionbar\user_selector_button, core_course\output\activity_completion, core_course\output\activity_dates, core_course\output\activity_icon, core_course\output\activitychooserbutton, core_course\output\completion_action_bar, core_courseformat\output\local\content\basecontrolmenu, core_courseformat\output\local\content\cm\controlmenu, core_courseformat\output\local\content\cm, core_courseformat\output\local\content\section, core_courseformat\output\local\overview\activityname, core_courseformat\output\local\overview\overviewtable, core_grades\output\penalty_indicator, core_question\output\add_bank_list, core_question\output\qbank_action_menu, core_question\output\question_bank_filter_ui, core_question\output\question_bank_list, core_question\output\question_category_selector, core_question\output\question_version_info, core_question\output\question_version_selection, core_question\output\switch_question_bank, core_question\output\view_banks, core_reportbuilder\output\custom_report, core_reportbuilder\output\dynamictabs\access, core_reportbuilder\output\dynamictabs\audience, core_reportbuilder\output\dynamictabs\editor, core_reportbuilder\output\dynamictabs\schedules, core_reportbuilder\output\report_action, and core_reportbuilder\output\system_report.
mod_quiz\output\attempt_summary_information::filter_keeping_only | ( | array | $shortnames | ) |
Filter the data held, to keep only the information with the given shortnames.
array | $shortnames | items to keep. |
|
inherited |
Get the name of the template to use for this templatable.
renderer_base | $renderer | The renderer requesting the template name |
string |
Implemented in core\output\choicelist, core\output\comboboxsearch, core_course\output\actionbar\group_selector_button, core_course\output\actionbar\group_selector_dropdown_form, core_course\output\actionbar\user_selector_button, core_courseformat\output\local\overview\activityname, and core_courseformat\output\local\overview\overviewtable.
|
protected |
Add an item to the summary just before the given position.
string | $shortname | unique identifier of this item (not displayed). |
string | renderable | $title | the title of this item. |
string | renderable | $content | the content of this item. |
int | $position | Numerical position to insert the item at. 0 means first. |
mod_quiz\output\attempt_summary_information::remove_item | ( | string | $shortname | ) |
Remove an item, if present.
string | $shortname |
mod_quiz\output\attempt_summary_information::set_caption | ( | string | $caption | ) |
Set the caption for the summary table.
string | $caption |
|
protected |
The rows of summary data.
{