How do I copy quiz/lab due dates/times?

Jump to solution
Community Member

Each week, I have labs and quizzes that open up at different times for different sections. For example, section A might have their quiz and lab become available at 9:10 AM, be due at 11:05AM, and be available until 11:59PM. Section B might have their quiz and lab become available at 4:05PM, be due at 6:00PM, and be available until 11:59PM. Propagate this through the remaining sections, and as you might imagine it gets extremely tedious and cumbersome to repeatedly type. Copying quizzes doesn't seem to be a possibility, at least not with saving due dates and times, and duplicating a Canvas assignment also does not save the due dates and times. 

Is there an easier way to do this without having to repeatedly add the due dates and availability times? I teach a rather large class with many labs (upwards of 15 a semester).

1 Solution
Community Champion


It depends on how your course and sections are set up in Canvas.

If you have multiple courses, one course for each section, then you might find my adjust all due dates Google Sheet a solution.

I would duplicate the sheet after you have one course set up properly and then you can use it to adjust the other classes. I've done this with my classes -- not multiple sections -- to add the starting time and ending time to all of the assignments. I put the starting time in row 1 off to the right of the data and then create a formula which is the existing due date for the row plus the time from the column. I do that for the due_at, unlock_at, and lock_at columns. Once I have those right, I do a copy and then paste special as values over the original dates. Then I can update the assignments in Canvas.

If you have one Canvas course with multiple sections, then things get a lot tougher. My script does not support differentiated assignments.

Through the web interface, using differentiated assignments and manually assigning to each section and then repeating for each assignment is the only way to go. Once you have it assigned to each section, you could edit the times using the bulk due date editing capability (I wrote my spreadsheet before Canvas had this feature), but since you've already assigned them, it's unlikely you would want to do this.

If you can do some programming, or know someone who can, Canvas has an Assignment Overrides API that allows you to set the dates for differentiated assignments. In particular, the Create an assignment override allows you to do this. There are various flavors of overrides, including some batch tools that allow you to specify more than one override at a time.

Showing sample code would be difficult as the solution is going to be highly tailored to your needs. It may change depending on whether all of your labs are due on the same day or on different days.

What I would do is something like this.

  1. Create a configuration that contained the section IDs and the starting / ending times for each assignment. That might include a day offset if some labs meet on different days. In that case you have to worry about non-class  days and it gets much more complicated. What I did for my classes (just one time for everyone, though) was to create a spreadsheet of the days the class meets and then I used a relative date, + 1 class period, rather than +1 calendar day.
  2. Get a list of assignments. I would include[] the all_dates or the overrides so you can see what's already been done.
  3. Iterate through the assignments and compare each title to a regular expression. If you're lucky, all of your labs and quizzes match some pattern. Otherwise, you might be able to use assignment categories. Basically, you need to know which assignments need the times adjusted.
  4. Iterate through each of the sections, using the start of the day from the existing base due date and then using the configuration settings to adjust the different times.
  5. Create / update the overrides as needed.

View solution in original post