How to upload a list of assignments as instructor?

Jump to solution
samson
Community Novice

I have multiple assignments I'd like to create via a file upload. Is it possible as instructor to upload new assignments as a CSV file?

1 Solution
James
Community Champion

 @samson  

No, it is not possible to upload a list of assignments directly into Canvas for creation.

There is the ability to make an assignment with the settings you would like and then duplicate it, possibly multiple times. You would need to go back and edit the titles and due dates. More information is available in this lesson from the Canvas Instructor Guide: How do I duplicate an assignment? 

The closest that Canvas has to scripting this is to use the Canvas REST API and the create an assignment endpoint. With access to curl and an access token from Canvas, you could script the information that is in your CSV file to do this. Unless you have some programming skills, I would create the curl command while it's still in Excel. Then you can copy/paste those into a command line somewhere and have it make the calls to create the assignments.

The REST API requires some technical skills that you may or may not have. The call to create an assignment often confuses people because there needs to be a literal assignment in the form field names: it's assignment[name] not just name. There is more help available in the Canvas Community if you run into issues.

There is a learning curve to using the REST API. If you don't have the technical skills it will be quicker to make an assignment and duplicate it within Canvas. If the assignments are substantially different, then you can just create them individually within Canvas, but then reuse the assignments in other courses (even in future terms) by importing the course content.

Another possibility is to use the built-in GraphQL editor. It's found by going to your base Canvas instance and adding /graphiql to the URL path. It doesn't allow you to create multiple assignments at one time, but you can copy/paste from Excel directly without having to learn the API.

Here's an example that creates a 10 point assignment called "Daily Takeaway 1" with the assignment description of "What did you take away from today's class?" The times need entered in ISO8601 format using UTC time. The courseID is my sandbox course, you'll need to change that. There are other properties that you can set by using the graphql explorer. The assignment block at the end is because it gave me an error if I didn't return something, so I just returned the Canvas ID of the assignment that was created. I also wrapped the input property so it was more readable.

mutation newassignment {
__typename
createAssignment(input: {
courseId: "896851",
name: "Daily Takeaway 1",
description: "What did you take away from today's class?",
dueAt: "2020-01-02T02:40:00Z",
pointsPossible: 10,
submissionTypes: online_text_entry,
gradingType: points}) {
assignment {
_id
}
}
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Here's what the assignment looks like in Canvas.

333888_pastedImage_3.png

You could use Excel to create a structure like the above and then copy/paste into the /graphiql interface and execute it. Then you copy/paste the next one. Repeat until you have all of your assignments created.

I think the programmatic way using the REST API is easier than the GraphQL approach and it can be automated. I'm biased because I've done a lot of work with the API and can write a short program. I've used it that way myself with some PHP code to create multiple assignments based off the due dates and section number -- so essentially what you're asking about, just not a CSV file.

For people lacking the technical skills, it needs done through the web interface as there is no CSV upload capability.

View solution in original post