@jlubkinchavez wrote:
I think I've figured out a few things (through testing) about deleting and restoring enrollments, but it'd be great if anyone could confirm this has proven true for them:
- If a student needs to change course sections in the same course, it's important to delete the original enrollment (not conclude it) or else they will continue to receive notifications for the original section (e.g., announcements).
- There is no specific API call for undeleting an enrollment.
- If you re-enroll the same user in the same course section (use the call to create an enrollment), the new enrollment will 1. have the same enrollment id as the original enrollment and 2. restore the submissions/activity for that user. (Any insights on that last point in particular would be appreciated; I did see an assignment with grade and feedback restore, but not much time had passed and I didn't test other features like discussion boards or stats).
So from a very quick testing on my institution's test instance & on a course that is not managed by our SIS:
1) If a student is enrolled in two sections, each enrollment is a separate object and has its own enrollment ID attached to that. So you would need to conclude/delete the enrollment associated with section that you don't want.
2) There is not any way to undo deleting an enrollment. The "reactivate" endpoint is only for enrollments that were marked "deactivate"/"inactivate". Operating on any other type of enrollment will return an error message.
3) Yes, they will have the same enrollment ID no matter what you do to the old enrollment -- if you conclude or delete the enrollment, then re-enroll them into the same section, they will have the same enrollment ID as before. I suspect that either the enrollment ID or the user ID is associated with student submissions, which is why they show up once the enrollment is restored. For example, with cross-listing, when you cross-list a section into another course, you "lose" all submissions in the old course but they come back when you restore the section into the original course...so it would stand to reason that re-enrolling a student should work the same way...