◆ 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. |
◆ 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 |
◆ $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