I see now that get_users_by_capability sort default is last access--so thanks for that tip. I can't get get_role_users to work--for some reason (I'm not using this as a lib function)
However, what I need is a function that gets users by capability by contextid. I still don't understand why this function doesn't do that--are you sure the sql is correct?. For example, for a certificate that has two teachers set (at the context level), in my role_assignments table I see those two users set for the teacher role (3) for that context (40). This is what I want to get--only those two users -- instead I am getting all of the users set for that role in the course.
Any more ideas?
Roles and permissions
Need help understanding $context
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.