if ($users = get_role_users($roleid, $context, true, '', 'u.lastname ASC', $canseehidden)) {
foreach ($users as $teacher) {
$fullname = fullname($teacher, has_capability('moodle/site:viewfullnames', $context));
- $namesarray[] = format_string($role->name).': <a href="'.$CFG->wwwroot.'/user/view.php?id='.
+ $namesarray[] = format_string(role_get_name($role, $context)).': <a href="'.$CFG->wwwroot.'/user/view.php?id='.
$teacher->id.'&course='.SITEID.'">'.$fullname.'</a>';
}
}