◆ apply_grade_penalty_to_user()
static core_grades\penalty_manager::apply_grade_penalty_to_user |
( |
int | $userid, |
|
|
grade_item | $gradeitem, |
|
|
int | $submissiondate, |
|
|
int | $duedate, |
|
|
bool | $previewonly = false ) |
|
static |
Apply grade penalties to a user.
Grade penalties are determined by the enabled penalty plugin. This function should be called each time a module creates or updates a grade item for a user.
- Parameters
-
int | $userid | The user ID |
grade_item | $gradeitem | grade item |
int | $submissiondate | submission date |
int | $duedate | due date |
bool | $previewonly | do not update the grade if true, only return the penalty |
- Return values
-
penalty_container | Information about the applied penalty. |
◆ disable_module()
static core_grades\penalty_manager::disable_module |
( |
string | $module | ) |
|
|
static |
Disable the grade penalty feature for a module.
- Parameters
-
string | $module | The module name (e.g. 'assign'). |
◆ disable_modules()
static core_grades\penalty_manager::disable_modules |
( |
array | $modules | ) |
|
|
static |
Disable the grade penalty feature for multiple modules.
- Parameters
-
array | $modules | List of module names. |
◆ enable_module()
static core_grades\penalty_manager::enable_module |
( |
string | $module | ) |
|
|
static |
Enable the grade penalty feature for a module.
- Parameters
-
string | $module | The module name (e.g. 'assign'). |
◆ enable_modules()
static core_grades\penalty_manager::enable_modules |
( |
array | $modules | ) |
|
|
static |
Enable the grade penalty feature for multiple modules.
- Parameters
-
array | $modules | List of module names. |
◆ extend_navigation_course()
static core_grades\penalty_manager::extend_navigation_course |
( |
navigation_node | $navigation, |
|
|
stdClass | $course, |
|
|
context | $coursecontext ) |
|
static |
Allow penalty plugin to extend course navigation.
- Parameters
-
navigation_node | $navigation | The navigation node |
stdClass | $course | The course object |
context | $coursecontext | The course context |
◆ extend_navigation_module()
Allow penalty plugin to extend navigation module.
- Parameters
-
- Return values
-
◆ get_enabled_modules()
static core_grades\penalty_manager::get_enabled_modules |
( |
| ) |
|
|
static |
List the modules that currently have the grade penalty feature enabled.
- Return values
-
array | List of enabled modules. |
◆ get_supported_modules()
static core_grades\penalty_manager::get_supported_modules |
( |
| ) |
|
|
static |
List the modules that support the grade penalty feature.
- Return values
-
array | list of supported modules. |
◆ is_penalty_enabled_for_module()
static core_grades\penalty_manager::is_penalty_enabled_for_module |
( |
string | $module | ) |
|
|
static |
Check if the module has the grade penalty feature enabled.
- Parameters
-
string | $module | The module name (e.g. 'assign'). |
- Return values
-
bool | Whether grade penalties are enabled for the module. |
◆ recalculate_penalty()
static core_grades\penalty_manager::recalculate_penalty |
( |
context | $context, |
|
|
int | $usermodified = 0 ) |
|
static |
Recalculate grade penalties.
- Parameters
-
context | $context | The context |
int | $usermodified | The user who triggered the recalculation return void |
◆ show_penalty_indicator()
static core_grades\penalty_manager::show_penalty_indicator |
( |
grade_grade | $grade | ) |
|
|
static |
Returns the penalty indicator HTML code if a penalty is applied to the grade.
Otherwise, returns an empty string.
- Parameters
-
- Return values
-
string | HTML code for penalty indicator |
The documentation for this class was generated from the following file:
- grade/classes/penalty_manager.php