Record of Section membership

Jump to solution
John_Gaspar
Community Participant

Is there a way to see the different sections a student has been a member of at different times during a semester?

We use sections for lecture, tutorial, lab, etc groupings. These  sections are created by data feeds from the timetable but it is also possible to manually add,  edit and delete sections and members. If someone is currently in Section X is  there an easily accessible record of sections they were previously members of?

Labels (2)
0 Likes
2 Solutions
James
Community Champion

@John_Gaspar 

There is a limited history available.

The List enrollments endpoint of the Enrollments API will allow you to specify state[]=deleted, which will return information about previous enrollments. If you leave off the state[], it returns information for active and invited enrollments only, which would show you where the students currently are but not where they had been. There are other enrollment states listed in the documentation.

That API call will return a lot of information. The created_at field would be an ISO-8601 datetime of when the student was added to the section.

The updated_at field should be the last time the object was modified. For enrollments that are deleted, the updated_at field would be the time the enrollment was deleted. However, in my data, every single one of my deleted entries had the exact same date and time (down to the second), so I would not put a lot of stock into that. There is a last_activity_at field that had dates and times after the enrolment had been deleted.

In my testing for this response, enrollments that I removed did show the correct updated_at field, so I don't know why they were all the same for the others. Maybe there was something that reset the dates internally on the Canvas database servers. If the numbers look right, then you can use them, but if they don't, the be careful.

The information is keyed to the section, user, and role type. By that I mean that if I remove a user and then add them back to the same section in the same role, then it keeps the same enrollment ID and just changes the state and they are no longer deleted (they are now active). If I then delete the enrollment again, they go back to the deleted state. The created_at is still the original time that the enrollment was created but the updated_at is the date of the last change.

That means that there is a history, but only of the last time the enrollment entered that state. For the user I removed, re-added, and then removed, the only records I have are when they first were added and when they were last changed (the final removal). I have no way of knowing that they were in the section, then out, then back in, and finally back out.

For most people, it probably won't matter, but I wanted you to be aware of that limitation. First time and last time only, but no history of changes between those times.

In general, Canvas does not make available logs of changes. You would need to gather that information as it happened (using Canvas Services Live Events) if that was important to you. Live Events is event driven so it only gets triggered when something happens. The other way to get that data is by polling the data. Each day, you could download the enrollments, and keep track of changes. Both of those need to be set up ahead of time, though. There's no easy way to go back and retrieve it after the fact.

I don't know what your technical skills are. You asked for easily accessible. To some people, that means a button they can click in Canvas and the answer to that is no, there is not. To others, they are comfortable with the Canvas API and in that case, it is a fairly easy API call to make.

View solution in original post

chadscott
Community Contributor

@John_Gaspar @James' explanation is great as always. I will say there is one possible caveat. It depends on how your institution lists the enrollments. If they populate the "start_at" and "end_at" fields, that may be useful for section enrollments as that's what we do. When a student moves from one section to another, we have that shown in those fields. This would be visible in the "list enrollments" for a user API call. I do know that not many institutions use those fields, however. Just another idea to explore.

Cheers,
Chad Scott

View solution in original post