How to find who is a teacher in a course

How to find who is a teacher in a course

by Jonathan Babbitt -
Number of replies: 0
I am attempting to create an auto-generated header for each course that picks out the teacher's name, email, avatar, etc... Currently it will display the course name and ID since that is already present in the $context. My issue is that I do not know how to find who has the role of teacher in a course context. I have played a bit with get_roles_with_capability() but it doesn't seem to do what I want. I also looked through the database to see if I could find something that would correlate between a roleid and context id but came up dry. I know how to search for a specific user and find their role, but I don't know how to do it the other way around. Thanks.
Average of ratings: -