|
| 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.
|
|
| 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.
|
|
◆ add_attempt_grades_if_appropriate()
Add the grade information to this summary information.
This is a helper used by {
- See also
- create_for_attempt()}.
- Parameters
-
quiz_attempt | $attemptobj | the attempt to summarise. |
display_options | $options | options for what can be seen. |
- Return values
-
float|null | the overall attempt grade, if it exists, else null. Raw value, not formatted. |
◆ add_item()
mod_quiz\output\attempt_summary_information::add_item |
( |
string | $shortname, |
|
|
string|renderable | $title, |
|
|
string|renderable | $content ) |
Add an item to the summary.
- Parameters
-
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. |
◆ add_item_after()
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.
- Parameters
-
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. |
◆ add_item_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.
- Parameters
-
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. |
◆ create_for_attempt()
static mod_quiz\output\attempt_summary_information::create_for_attempt |
( |
quiz_attempt | $attemptobj, |
|
|
display_options | $options, |
|
|
?int | $pageforlinkingtootherattempts = null, |
|
|
?bool | $showall = null ) |
|
static |
Initialise an instance of this class for a particular quiz attempt.
- Parameters
-
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. |
- Return values
-
◆ create_from_legacy_array()
static mod_quiz\output\attempt_summary_information::create_from_legacy_array |
( |
array | $items | ) |
|
|
static |
To aid conversion of old code.
This converts the old array format into an instance of this class.
- Parameters
-
array | $items | array of $shortname => [$title, $content]. |
- Return values
-
◆ export_for_template()
mod_quiz\output\attempt_summary_information::export_for_template |
( |
renderer_base | $output | ) |
|
Function to export the renderer data in a format that is suitable for a mustache template.
This means:
- No complex types - only stdClass, array, int, string, float, bool
- Any additional info that is required for the template is pre-calculated (e.g. capability checks).
- Parameters
-
renderer_base | $output | Used to do a final render of any components that need to be rendered for export. |
- Return values
-
Implements templatable.
◆ filter_keeping_only()
mod_quiz\output\attempt_summary_information::filter_keeping_only |
( |
array | $shortnames | ) |
|
Filter the data held, to keep only the information with the given shortnames.
- Parameters
-
array | $shortnames | items to keep. |
◆ get_template_name()
core\output\named_templatable::get_template_name |
( |
\renderer_base | $renderer | ) |
|
|
inherited |
◆ insert_new_item_at_position()
mod_quiz\output\attempt_summary_information::insert_new_item_at_position |
( |
string | $shortname, |
|
|
string|renderable | $title, |
|
|
string|renderable | $content, |
|
|
int | $position ) |
|
protected |
Add an item to the summary just before the given position.
- Parameters
-
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. |
◆ remove_item()
mod_quiz\output\attempt_summary_information::remove_item |
( |
string | $shortname | ) |
|
Remove an item, if present.
- Parameters
-
◆ $summarydata
array [] array mod_quiz\output\attempt_summary_information::$summarydata = [] |
|
protected |
The rows of summary data.
{
- See also
- add_item()} should make the structure clear.
The documentation for this class was generated from the following file:
- mod/quiz/classes/output/attempt_summary_information.php