Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
|
Public Member Functions | |
__construct (protected cm_info readonly cm_info $cm,) | |
Activity Overview Base class constructor. | |
get_actions_overview () | |
Retrieves the actions overview for the activity. | |
get_completion_overview () | |
Retrieves the completion overview for the activity. | |
get_due_date_overview () | |
Retrieves the due date overview for the activity. | |
get_extra_overview_items () | |
Get the plugin specific overview items for the activity. | |
get_grades_overviews () | |
Retrieves the grades overview items for the activity. | |
get_name_overview () | |
Get the name of the activity. | |
Static Public Member Functions | |
static | redirect_to_overview_page (int $courseid, string $modname) |
Redirects to the overview page for the activity. | |
Protected Member Functions | |
get_grade_item_names (array $items) | |
Retrieves the grade item names for the activity. | |
Protected Attributes | |
cm_info module_context | $context |
The course module. | |
stdClass stdClass | $course |
$course | |
courseformat courseformat | $format |
$format the course format | |
Activity Overview Base class constructor.
Overview integrations are meant to use dependency injection. Don't create instances of this class directly, use the factory instead.
core_courseformat\local\overview\overviewfactory\create($cm);
Plugins can override the constructor adding more dependencies such as:
However, it is important to note all original dependencies must be kept.
cm_info | $cm | The course module information (loaded by the factory). |
$cm | The course module. |
core_courseformat\activityoverviewbase::get_actions_overview | ( | ) |
Retrieves the actions overview for the activity.
overviewitem|null | null if module does not have a main action item. |
Reimplemented in mod_assign\courseformat\overview, mod_choice\courseformat\overview, mod_data\courseformat\overview, mod_feedback\courseformat\overview, mod_glossary\courseformat\overview, mod_h5pactivity\courseformat\overview, and mod_lesson\courseformat\overview.
core_courseformat\activityoverviewbase::get_completion_overview | ( | ) |
Retrieves the completion overview for the activity.
overviewitem|null | null if completion is not enabled. |
Reimplemented in mod_choice\courseformat\overview.
core_courseformat\activityoverviewbase::get_due_date_overview | ( | ) |
Retrieves the due date overview for the activity.
overviewitem|null | null if module does not have a due date. |
Reimplemented in mod_assign\courseformat\overview, mod_choice\courseformat\overview, mod_data\courseformat\overview, mod_feedback\courseformat\overview, and mod_lesson\courseformat\overview.
core_courseformat\activityoverviewbase::get_extra_overview_items | ( | ) |
Get the plugin specific overview items for the activity.
Plugins can override this method to provide their own overview items.
The resulting array must be indexed by item shortname.
overviewitem[] | Array of overview items indexed by item shortname. |
Reimplemented in core_courseformat\local\overview\resourceoverview, mod_assign\courseformat\overview, mod_choice\courseformat\overview, mod_data\courseformat\overview, mod_feedback\courseformat\overview, mod_glossary\courseformat\overview, mod_h5pactivity\courseformat\overview, mod_lesson\courseformat\overview, and mod_workshop\courseformat\overview.
|
protected |
Retrieves the grade item names for the activity.
By default, the overview will display the grade if the activities has only one grade item. The name of the grade item will be 'Grade'. For plugins with multiple grade items, the plugin must override this method and provide names for each grade item that want to be displayed.
grade_item[] | $items |
array<integer,string> | the grade item names indexed by item id. |
Reimplemented in mod_workshop\courseformat\overview.
core_courseformat\activityoverviewbase::get_grades_overviews | ( | ) |
Retrieves the grades overview items for the activity.
Most activities will have none or one grade. However, some activities may have multiple grades, such as workshop or quiz.
It is not recommended to override this method unless the plugin has specific requirements. Instead, plugins should override get_grade_item_names to provide the grade item names.
overviewitem[] | Array of overview items representing the grades. |
|
static |
Redirects to the overview page for the activity.
int | $courseid | The course id. |
string | $modname | The module name. |