MDL-69497 mod_assign: amend preference definitions for current user.

Ensure they can always be updated when using the grader.
This commit is contained in:
Paul Holden
2023-12-01 10:55:33 +00:00
parent caacef2ea2
commit bb118b2328
+10 -5
View File
@@ -1781,24 +1781,29 @@ function mod_assign_core_calendar_event_timestart_updated(\calendar_event $event
/**
* Return a list of all the user preferences used by mod_assign.
*
* @return array
* @uses core_user::is_current_user
*
* @return array[]
*/
function mod_assign_user_preferences() {
function mod_assign_user_preferences(): array {
$preferences = array();
$preferences['assign_filter'] = array(
'type' => PARAM_ALPHA,
'null' => NULL_NOT_ALLOWED,
'default' => ''
'default' => '',
'permissioncallback' => [core_user::class, 'is_current_user'],
);
$preferences['assign_workflowfilter'] = array(
'type' => PARAM_ALPHA,
'null' => NULL_NOT_ALLOWED,
'default' => ''
'default' => '',
'permissioncallback' => [core_user::class, 'is_current_user'],
);
$preferences['assign_markerfilter'] = array(
'type' => PARAM_ALPHANUMEXT,
'null' => NULL_NOT_ALLOWED,
'default' => ''
'default' => '',
'permissioncallback' => [core_user::class, 'is_current_user'],
);
return $preferences;