Getting $roleid and all group members $id

Getting $roleid and all group members $id

by Margarida ROMERO -
Number of replies: 1
hi there!

I'm developping an ad hoc module (Time Awareness Tool), and I've two questions:

1, how to get the auth user $roleid

2, by using the auth user $id, how to get all group members $id (the list of id of his course group collegues)

Merci d'avance smile !

Best regards from Nimes,
margarida
Average of ratings: -
In reply to Margarida ROMERO

Re: Getting $roleid and all group members $id

by Nidhi Tiwari -

$context = get_context_instance (CONTEXT_SYSTEM);
$roles = get_user_roles($context, $USER->id, false);
$role = key($roles);
$roleid = $roles[$role]->roleid;