shortname: $strgroups", "$course->fullname", "wwwroot/course/view.php?id=$courseid\">$course->shortname ". "-> wwwroot/user/index.php?id=$courseid\">$strparticipants ". "-> wwwroot/group/groupui/index.php?id=$courseid\">$strgroups". "-> Display grouping", "", "", true, '', user_login_string($course, $USER)); $groupingsettings = groups_get_grouping_settings($groupingid); if (! isset($groupingsettings->name)) { print_error('errorinvalidgrouping', 'group', groups_home_url($courseid)); } else { // Print the name of the grouping $name = $groupingsettings->name; echo "

$name

\n"; } // Get the groups and group members for the grouping $groupids = groups_get_groups_in_grouping($groupingid); if ($groupids != false) { // Make sure the groups are in the right order foreach($groupids as $groupid) { $listgroups[$groupid] = groups_get_group_displayname($groupid); } natcasesort($listgroups); // Go through each group in turn and print the group name and then the members foreach($listgroups as $groupid=>$groupname) { echo "

$groupname

\n"; $userids = groups_get_members($groupid); if ($userids != false) { // Make sure the users are in the right order unset($listmembers); foreach($userids as $userid) { $listmembers[$userid] = groups_get_user_displayname($userid, $courseid); } natcasesort($listmembers); echo "
    \n"; foreach($listmembers as $userid=>$name) { echo "
  1. $name
  2. \n"; } echo "
\n"; } } } print_footer($course); } ?>