|
cm_info module_context | $context |
| The course module.
|
|
stdClass stdClass | $course |
| $course
|
|
courseformat courseformat | $format |
| $format the course format
|
|
◆ __construct()
core_courseformat\activityoverviewbase::__construct |
( |
protected cm_info readonly cm_info | $cm | ) |
|
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:
- protected readonly moodle_database $db -> To access the database.
- protected readonly core\clock $clock -> The clock interface to handle time.
However, it is important to note all original dependencies must be kept.
- Parameters
-
cm_info | $cm | The course module information (loaded by the factory). |
- Parameters
-
◆ get_actions_overview()
core_courseformat\activityoverviewbase::get_actions_overview |
( |
| ) |
|
◆ get_completion_overview()
core_courseformat\activityoverviewbase::get_completion_overview |
( |
| ) |
|
Retrieves the completion overview for the activity.
- Return values
-
overviewitem|null | null if completion is not enabled. |
◆ get_due_date_overview()
core_courseformat\activityoverviewbase::get_due_date_overview |
( |
| ) |
|
◆ get_extra_overview_items()
core_courseformat\activityoverviewbase::get_extra_overview_items |
( |
| ) |
|
◆ get_grade_item_names()
core_courseformat\activityoverviewbase::get_grade_item_names |
( |
array | $items | ) |
|
|
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.
- Parameters
-
- Return values
-
array<integer,string> | the grade item names indexed by item id. |
Reimplemented in mod_workshop\courseformat\overview.
◆ get_grades_overviews()
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.
- Return values
-
overviewitem[] | Array of overview items representing the grades. |
◆ redirect_to_overview_page()
static core_courseformat\activityoverviewbase::redirect_to_overview_page |
( |
int | $courseid, |
|
|
string | $modname ) |
|
static |
Redirects to the overview page for the activity.
- Parameters
-
int | $courseid | The course id. |
string | $modname | The module name. |
The documentation for this class was generated from the following file:
- course/format/classes/activityoverviewbase.php