✨Tutorial: Anonymize Canvas Submissions in Google Workspace
An easy way to (de)anonymize assignment names to enable AI integration.
[image created with Dall-E 3 via ChatGPT Plus]
Welcome to AutomatED: the newsletter on how to teach better with tech.
In every send, I share what I have learned — and am learning — about AI and tech in the university classroom. What works, what doesn't, and why.
In this Premium edition, I present a Tutorial explaining how to use Google Workspace’s built-in script functionality to anonymize and then de-anonymize the filenames of student submissions that you bulk download and upload to the Canvas learning management system (LMS).
This functionality would be an essential part of any AI-enhanced bulk grading or feedback workflows involving Canvas, barring the instructor getting explicit student consent, using local LLMs, or otherwise negating the need for anonymization.
Next month, I’ll provide a parallel Tutorial for those who prefer to use Microsoft 365 (although none of the following relies on any paid features of Google Workspace).
Note: The methods I explain here (and will explain next month) can be modified with a little effort to handle Blackboard Ultra bulk downloads and uploads. If you need help with this use case, just reach out.
Table of Contents
Canvas ↔️ (De)anonymizer ↔️ Third-Party AI
Canvas presents its users with a problem: if you download your students’ submissions in bulk, each is named with identifying information. Even if the content of the submissions is anonymous, the filenames are not.
They will have the students’ names at the start, then an underscore, then an underscore between a pair of numbers that uniquely identify students in Canvas, then another underscore, then the title they’ve given to the file they uploaded as their submission.
SmithJohn_123456_abc123_Essay1.docx
So, even if you tell your students to not put any identifying information into the content or filenames of their submissions — e.g. they are to leave their papers anonymous for grading purposes — the filenames generated by Canvas give them away.
This Tutorial addresses this problem with ease. Setup takes about an hour and then it’s smooth sailing from then on.
But why might you want to solve this problem?
One clear reason would be that you want to bulk grade or give feedback on student submissions with a third-party AI tool. I covered this sort of use case in my ✨Premium Tutorials on how to use AI with Canvas and on using ChatGPT Vision to grade handwritten student work. In short, AI can assist in providing more comprehensive and efficient feedback on student submissions, integrating seamlessly with Canvas's grading system.
In any case, you might want to review my ✨Premium Guide on ethically using AI with student data, which covers a range of considerations and options for doing so. In essence, the present Tutorial is focused on one way to implement one solution to data privacy issues in the context of using AI with student data.
📥 Step 1: Bulk Download from Canvas
In this section, I'll explain Step 1 of a five-step approach consisting of the following:
downloading student submissions from Canvas
anonymizing their filenames
using AI to improve your feedback (e.g.)
de-anonymizing their filenames
and re-uploading the annotated submissions
In the next section, I will explain the second and fourth parts of the process. After that, I cover the fifth.
I start with the first part because you need to first understand how Canvas names bulk downloaded files — otherwise you won’t have a grip on how to anonymize them or why my solution works.
To download your students’ submissions from Canvas, you can download them individually or in bulk. Bulk downloads are most efficient, especially if you are planning on dumping them into some other software or third-party AI to grade or otherwise process them.
The following bulk download method allows you to efficiently gather all student work in one place, setting the stage for the next anonymizing step that I explain in the next section.
Here's how to perform a bulk download:
Access Your Canvas Course: Log into Canvas and navigate to your course site.
Go to Assignments: Click on "Assignments" in the left-hand menu of your course page.
Select the Assignment: Click on the specific assignment you want to grade.
Locate Download Option: On the assignment page, look to the far right. You should see a "Download Submissions" link just below the SpeedGrader link.
Initiate Download: Click the "Download" link. Canvas will compress all submissions into a single .zip file.
Save the File: Choose a location on your computer to save the .zip file. It's a good idea to create a dedicated folder for each assignment.
Extract Contents, if desired: Once the download is complete, open the .zip file on your computer to access the individual student submissions.
If you extract the contents of the .zip file, you'll notice that the student submissions are named with the student's name (and then some numbers and the assignment name), unless you had specified anonymous grading for the assignment.
SmithJohn_123456_abc123_Essay1.docx
As noted, this is a problem because you should not share student submissions that are personally identified with third-party AI tools.
We need to rename the submissions while keeping track of their original filenames, because it is their original filenames that Canvas looks for when we re-upload them later.
In the next section, I explain how.
🔒 Step 2: Anonymize
For this anonymizing step and the later de-anonymizing step, you’ll create a workflow in your Google Drive to process student assignment submissions using Google Apps Script. It will have the following components:
Four folders in Google Drive:
Step 1 - Upload Initial Zip Files Here
Step 2 - Download Anonymized Zip Files Here
Step 3 - Upload Graded Zip Files Here
Step 4 - Download De-Anonymized Zip Files Here
A Google Sheet named "Assignment Anonymization Manager" with a custom menu containing two options:
Anonymize Zip Files
De-Anonymize Zip Files
The first of these menu options will run a script to anonymize the zip files in the Step 1 folder and place them in the Step 2 folder, and the second will run a script to de-anonymize the zip files in the Step 3 folder and place them in the Step 4 folder.
Let’s go through each part of this process, action by action.
Step 2a: Create Folders in Google Drive
Create a Project Folder:
In your Google Drive, create a new folder for this project. Name it "Anonymization Project".
Create Subfolders:
Inside the project folder, create the following four subfolders:
Step 1 - Upload Initial Zip Files Here
Step 2 - Download Anonymized Zip Files Here
Step 3 - Upload Graded Zip Files Here
Step 4 - Download De-Anonymized Zip Files Here
Record Folder IDs:
For each folder, you'll need its unique Folder ID:
Open the folder.
In the URL bar at the top of your browser, find the part after
folders/
. This is its unique “FolderID.”Copy the FolderID for each folder (e.g. to a GDoc or Notepad txt file) and keep them handy.
A fake FolderID for illustration purposes
Step 2b: Create the Google Sheet
Create a New Google Sheet:
In your project folder, create a new Google Sheet.
Name it "Assignment Anonymization Manager".
Set Up the Mapping Sheet:
Open the Google Sheet.
Rename Sheet1 to "Mapping" (right click on the worksheet name, if on Windows).
In the "Mapping" sheet, add the following headers in row 1 (you can just add the text to the cells; you needn’t convert the worksheet to a table):
A1:
StudentName
B1:
StudentID
C1:
LMSID
D1:
SISUserID
E1:
SISLoginID
F1:
FakeID
G1:
AssignmentName
Step 2c: Copy and Edit Apps Script
Access Apps Script:
In the Google Sheet, go to the menu bar at the top and click on Extensions > Apps Script.
This will open the Apps Script editor in a new tab.
Name the Project:
In the Apps Script editor, click on Untitled project at the top and name it "Anonymization Scripts".
Copy the Below Script:
In the Apps Script editor, you'll see a file named
Code.gs
that will already be open (the four-row starting code filling your screen is the contents of this file).Delete the existing code in
Code.gs
(it should say “function myFunction …”).Copy the entire script below and paste it into
Code.gs
(if you want to better understand how the script works, you can look at the comments after each ‘//’ or you can just paste it into ChatGPT or another LLM and ask about its structure and purpose):
Subscribe to Premium to read the rest.
Become a paying subscriber of AutomatED to get access to this post and other perks.
Already a paying subscriber? Sign In.
A subscription gets you:
- • Two New Premium Pieces Per Month
- • Access to all AI Tutorials, like our Tutorial on Building (Better) Custom GPTs
- • Access to all AI Pedagogy Guides, like our Guide on Designing Assignments in the AI Era
- • Access to Exclusive AI Tools
- • Discounts on Webinars