User Script to Bulk Update Enrollment States in a Course

Code-with-Ski
Community Participant
0
5

I have developed a user script that will allow an admin user or teacher with the appropriate permissions to update the enrollment states of enrollments in a course in bulk.  By default, enrollments associated with an SIS Import will not be loaded in as options to update.  This user script is inspired by the Bulk Remove Students Tool that was developed by @chadscott 

To use the user script, you will need to use a tool for loading user scripts (such as TamperMonkey Chrome Web Store Listing) or add it as a part of the theme in your Canvas environment (if you are an Account Admin).  If using a tool for loading user scripts, be sure to update the @match web address (as needed) on line 7 in the header comment.  Users using the Canvas hosted domain name shouldn't need to make any adjustments.  The Bulk Update Enrollment States Raw Source Code will need to be installed for use with your tool for user scripts or added to your JavaScript Canvas theme file.

This user script is part of the Code with Ski User Scripts Repository.  It is recommended to review and test the code before making significant updates to your course enrollments.  Be sure to check with your school administration/IT staff before using any user scripts in case they have security and/or review guidelines that must be followed before use.

The script adds an option under the 3-dot People options menu, to "Update Enrollment States."

update enrollment states menu optionupdate enrollment states menu option

 

Clicking that option will open the dialog to "Bulk Update Enrollment States." You will want to select the type of user roles you want to update, the specific section (or all sections) of users you want to update, and the enrollment state change that you want to perform.  After selecting the options for the update you want to make, click the "Load Enrollments" button.

bulk update enrollment states dialog select options and load enrollmentsbulk update enrollment states dialog select options and load enrollments

The loading messages area will update to provide you with the status on loading the relevant users based on the update settings you selected.  Each relevant enrollment will be added to the table.  In the table, there is a check all/uncheck all button in the header row.  By default, all of the loaded enrollments are selected to be updated.  If there are enrollments that you want to exclude, you can uncheck them and they won't be updated.

loaded enrollments to updateloaded enrollments to update

 

When you have finished reviewing the enrollments to update, click "Update" and then confirm to begin processing the updates.  The loading messages will provide status updates on updating the enrollments.  Be sure to stay on the page and don't reload until it is complete, or it will stop the process, and you will need to run it again for any enrollments that weren't updated yet.

confirm the updateconfirm the update

 

Rows that were updated will be removed from the table. If there were any errors, those rows will still appear in the table along with any you didn't select for updates.  The loading messages will include a log of any updates that had an error.

finished updating enrollmentsfinished updating enrollments

 

After you close the dialog, you can refresh the page to see the updates reflected on the People page. In the example, I bulk updated the students from active to inactive.

student enrollments updated to inactivestudent enrollments updated to inactive