What would be the best way to get name, ID, and group for all students in only one section of a class? #590
-
I am interested in organizing downloads for all students in one section based upon their group. I have a course object
I can do something like:
to get a list of all of the students (name, id, group), but this takes a while and is excessive since I only need the students from one section. Likewise, it doesn't actually give me any information regarding what section the students are in. From the API I see I can get get a
and I can get the users in that section
But this has the opposite problem. I get all students in one section, but I don't get any information on their group. Right now, for a quick workaround I am getting all the students and then finding the intersection between all students and only the students I want from a Is there some better way that I am missing? Thank you for the excellent library! It has been tremendously helpful to me. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can get the group information if you use the enrollments = section.get_enrollments(include='group_ids') Any value from the Canvas REST API docs can get passed as a |
Beta Was this translation helpful? Give feedback.
You can get the group information if you use the
include
kwarg in your sections approach (which is what I would do):Any value from the Canvas REST API docs can get passed as a
**kwarg
to include more data.