Skip to content

Commit 76f88c7

Browse files
committed
Course settings: add parameter to enable student to be assigned as course teacher -refs BT#21353
1 parent a83430e commit 76f88c7

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

main/inc/lib/usermanager.lib.php

+12-4
Original file line numberDiff line numberDiff line change
@@ -7855,10 +7855,18 @@ public static function getExpirationDateByRole($status)
78557855

78567856
public static function getAllowedRolesAsTeacher(): array
78577857
{
7858-
return [
7859-
COURSEMANAGER,
7860-
SESSIONADMIN,
7861-
];
7858+
if (api_get_configuration_value('course_allow_student_role_to_be_teacher')) {
7859+
return [
7860+
STUDENT,
7861+
COURSEMANAGER,
7862+
SESSIONADMIN,
7863+
];
7864+
} else {
7865+
return [
7866+
COURSEMANAGER,
7867+
SESSIONADMIN,
7868+
];
7869+
}
78627870
}
78637871

78647872
/**

main/install/configuration.dist.php

+3
Original file line numberDiff line numberDiff line change
@@ -2530,3 +2530,6 @@
25302530

25312531
// Add the user first connexion column to the page main/admin/user_list.php
25322532
// $_configuration['admin_user_list_add_first_connexion_column'] = false;
2533+
2534+
// Set the following parameter to true to enable student to be assign as teacher of a course
2535+
//$_configuration['course_allow_student_role_to_be_teacher'] = false;

0 commit comments

Comments
 (0)