Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250706) (a6b17d8f6bd)
core_courseformat\activityoverviewbase Class Reference
Inheritance diagram for core_courseformat\activityoverviewbase:
core_courseformat\local\overview\resourceoverview mod_assign\courseformat\overview mod_data\courseformat\overview mod_feedback\courseformat\overview mod_glossary\courseformat\overview mod_h5pactivity\courseformat\overview mod_workshop\courseformat\overview

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
 

Constructor & Destructor Documentation

◆ __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$cmThe course module information (loaded by the factory).
Parameters
$cmThe course module.

Member Function Documentation

◆ get_actions_overview()

core_courseformat\activityoverviewbase::get_actions_overview ( )

Retrieves the actions overview for the activity.

Return values
overviewitem|nullnull if module does not have a main action item.

Reimplemented in mod_assign\courseformat\overview, mod_data\courseformat\overview, mod_feedback\courseformat\overview, mod_glossary\courseformat\overview, and mod_h5pactivity\courseformat\overview.

◆ get_completion_overview()

core_courseformat\activityoverviewbase::get_completion_overview ( )

Retrieves the completion overview for the activity.

Return values
overviewitem|nullnull if completion is not enabled.

◆ get_due_date_overview()

core_courseformat\activityoverviewbase::get_due_date_overview ( )

Retrieves the due date overview for the activity.

Return values
overviewitem|nullnull if module does not have a due date.

Reimplemented in mod_assign\courseformat\overview, mod_data\courseformat\overview, and mod_feedback\courseformat\overview.

◆ get_extra_overview_items()

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.

Return values
overviewitem[]Array of overview items indexed by item shortname.

Reimplemented in core_courseformat\local\overview\resourceoverview, mod_assign\courseformat\overview, mod_data\courseformat\overview, mod_feedback\courseformat\overview, mod_glossary\courseformat\overview, mod_h5pactivity\courseformat\overview, and mod_workshop\courseformat\overview.

◆ 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
grade_item[]$items
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$courseidThe course id.
string$modnameThe module name.

The documentation for this class was generated from the following file: