#171 Only get teachers who are enrolled within the course

This commit is contained in:
Mark Nelson 2018-07-13 20:46:17 +08:00
parent f547e4b88c
commit 9e24bd0446

View file

@ -106,7 +106,7 @@ class element extends \mod_customcert\element {
$teachers = array();
// Now return all users who can manage the customcert in this context.
if ($users = get_users_by_capability($PAGE->context, 'mod/customcert:manage')) {
if ($users = get_enrolled_users($PAGE->context, 'mod/customcert:manage')) {
foreach ($users as $user) {
$teachers[$user->id] = fullname($user);
}