Skip to content

Commit

Permalink
Course settings: add parameter to enable student to be assigned as co…
Browse files Browse the repository at this point in the history
…urse teacher -refs BT#21353
  • Loading branch information
NicoDucou committed Jan 15, 2024
1 parent a83430e commit 76f88c7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
16 changes: 12 additions & 4 deletions main/inc/lib/usermanager.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -7855,10 +7855,18 @@ public static function getExpirationDateByRole($status)

public static function getAllowedRolesAsTeacher(): array
{
return [
COURSEMANAGER,
SESSIONADMIN,
];
if (api_get_configuration_value('course_allow_student_role_to_be_teacher')) {
return [
STUDENT,
COURSEMANAGER,
SESSIONADMIN,
];
} else {
return [
COURSEMANAGER,
SESSIONADMIN,
];
}
}

/**
Expand Down
3 changes: 3 additions & 0 deletions main/install/configuration.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2530,3 +2530,6 @@

// Add the user first connexion column to the page main/admin/user_list.php
// $_configuration['admin_user_list_add_first_connexion_column'] = false;

// Set the following parameter to true to enable student to be assign as teacher of a course
//$_configuration['course_allow_student_role_to_be_teacher'] = false;

0 comments on commit 76f88c7

Please sign in to comment.