CaseyCattron
Community Member

Can I change the way Canvas names duplicated assignements?

Jump to solution

I am an instructor and it would be really helpful if I could alter the method Canvas uses for naming duplicated assignments currently it names them by just adding the word "Copy #" for example:

  • Assignment Name (original)
  • Assignment Name Copy (first duplicate)
  • Assignment Name Copy 2 (second duplicate)

I would like to change it because there are some assignments I have that end in a number and are repeated weekly or daily. So it would just be easier if it detected what number the previous assignment ended at and then in the duplicates changed that number incrementally. Like this:

  • Assignment Name 1 (original)
  • Assignment Name 2 (first duplicate)
  • Assignment Name 3 (second duplicate)

Or alternatively like this:

  • Assignment Name 1.1 (original)
  • Assignment Name 1.2(first duplicate)
  • Assignment Name 1.3 (second duplicate)

I can code some so if this would require a certain level of programming knowledge then that is fine.

Labels (1)
0 Kudos
1 Solution
GregoryBeyrer
Community Coach
Community Coach

Yes! We are fortunate in the Community to share this space with @James, who uses API and scripting to get all kinds of things done more efficiently than the point-click-wait involved in using a browser. He is generous in sharing his "Canvacements" with the Community, and one of them makes changing assignment names as easy as typing in a Google Sheet. Though the title indicates a different purpose, I tested this tonight and discovered that it works for names too:

Adjust All Assignment Dates on One Page

View solution in original post

2 Replies
GregoryBeyrer
Community Coach
Community Coach

Yes! We are fortunate in the Community to share this space with @James, who uses API and scripting to get all kinds of things done more efficiently than the point-click-wait involved in using a browser. He is generous in sharing his "Canvacements" with the Community, and one of them makes changing assignment names as easy as typing in a Google Sheet. Though the title indicates a different purpose, I tested this tonight and discovered that it works for names too:

Adjust All Assignment Dates on One Page

James
Community Champion

@CaseyCattron 

To follow up on what @GregoryBeyrer  said, you cannot tell Canvas to name them in a different manner through the web interface, but you can use the spreadsheet to change the names in bulk (and using formulas since it is in a spreadsheet).

You can also use the Assignments API with programming to modify things. You could even set it up to automate the duplication and renaming process. There is a duplicate assignment endpoint that will return a JSON object with an assignment object that contains the id and name of the duplicate. You could then call the edit an assignment endpoint with the id obtained from the duplicate assignment call and change the name. Since you're doing this programmatically, you would be able to know what the new name was supposed to be. This could then be a command line tool where you tell it the course ID, the assignment ID, and how many times to duplicate it. You could also hard code those values into your source and run it.

A person could probably write a userscript that runs in the browser that would modify the existing menu to add a new duplicate button that would automate the two steps. It would take the existing name, determine the pattern to see if it ended in a number and then follow that pattern. Ideally it would check to see if the new number already existed and increment it to make it unique as you indicated. Assignment names do not have to be unique in Canvas (you could have four versions of the final exam all called Final Exam) but it gets confusing to humans. You would also need to write the code to get the new assignment to appear on the assignment page with a working settings menu.

Another approach would be to write a script that gets a list of all of the assignments and then programmatically identifies the "Copy" or "Copy 1" and renames them. That script would be ran between the time you duplicate the assignment and the time you actually change the content.

That could be a standalone script or userscript that runs in the browser that adds a single button rather than modifying each assignment. Then you could modify the titles on the assignments page without having to worry about inserting new content and all of the assignments would already be loaded so you could get the information you need from the webpage rather than having to make an API call.

Ultimately, it comes down to your circumstances. If you're an instructional designer that does this a lot, then coding it would be worth it. If you are an instructor that duplicates a few assignments here and there and then copies the content from one term to the next, then changing them manually is going to be faster. There's a lot of space in between those two scenarios.

Coding is a time suck, so it may come down to you and how quickly it needs done. My bio here in the Community mentions hating repetition and spending 13 hours writing code to do something that could be done in 5 minutes, so I get the desire to automate. But sometimes you get given a new course on Friday afternoon that has to be ready to go on Tuesday (thank goodness for the holiday on Monday) that is now online because they couldn't find a teacher for it and there is nothing created (not even a good recent syllabus that identifies what topics are covered). In cases like that [welcome to my weekend], you forget about automation and just push through.