cancel
Showing results for 
Search instead for 
Did you mean: 
gbhenry
Community Member

Setting quiz due dates via Canvas API

Jump to solution
I can GET the quiz_assignment_overrides but can't figure out how to POST.  Here is an example of a quiz that I set up in Canvas with multiple sections and due dates.  I would like to be able to POST this information so it doesn't take as long.
 
{
    "quiz_assignment_overrides": [
        {
            "quiz_id"3165761,
            "due_dates": [
                {
                    "id"855848,
                    "due_at""2021-06-11T05:59:00Z",
                    "unlock_at"null,
                    "lock_at"null,
                    "title""Q0 A SM2Honors Henry.G SY21-22",
                    "set_type""CourseSection",
                    "set_id"1645475
                },
                {
                    "id"855849,
                    "due_at""2021-08-20T05:59:00Z",
                    "unlock_at"null,
                    "lock_at"null,
                    "title""Q1 A SM2Honors Henry.G SY21-22",
                    "set_type""CourseSection",
                    "set_id"1645483
                },
                {
                    "id"855850,
                    "due_at""2021-10-29T05:59:00Z",
                    "unlock_at"null,
                    "lock_at"null,
                    "title""Q2 A SM2Honors Henry.G SY21-22",
                    "set_type""CourseSection",
                    "set_id"1645491
                },
                {
                    "id"855851,
                    "due_at""2022-01-21T06:59:00Z",
                    "unlock_at"null,
                    "lock_at"null,
                    "title""Q3 A SM2Honors Henry.G SY21-22",
                    "set_type""CourseSection",
                    "set_id"1645501
                },
                {
                    "id"855853,
                    "due_at""2022-03-25T05:59:00Z",
                    "unlock_at"null,
                    "lock_at"null,
                    "title""Q4 A SM2Honors Henry.G SY21-22",
                    "set_type""CourseSection",
                    "set_id"1645508
                }
            ],
            "all_dates": [
                {
                    "id"855848,
                    "due_at""2021-06-11T05:59:00Z",
                    "unlock_at"null,
                    "lock_at"null,
                    "title""Q0 A SM2Honors Henry.G SY21-22",
                    "set_type""CourseSection",
                    "set_id"1645475
                },
                {
                    "id"855849,
                    "due_at""2021-08-20T05:59:00Z",
                    "unlock_at"null,
                    "lock_at"null,
                    "title""Q1 A SM2Honors Henry.G SY21-22",
                    "set_type""CourseSection",
                    "set_id"1645483
                },
                {
                    "id"855850,
                    "due_at""2021-10-29T05:59:00Z",
                    "unlock_at"null,
                    "lock_at"null,
                    "title""Q2 A SM2Honors Henry.G SY21-22",
                    "set_type""CourseSection",
                    "set_id"1645491
                },
                {
                    "id"855851,
                    "due_at""2022-01-21T06:59:00Z",
                    "unlock_at"null,
                    "lock_at"null,
                    "title""Q3 A SM2Honors Henry.G SY21-22",
                    "set_type""CourseSection",
                    "set_id"1645501
                },
                {
                    "id"855853,
                    "due_at""2022-03-25T05:59:00Z",
                    "unlock_at"null,
                    "lock_at"null,
                    "title""Q4 A SM2Honors Henry.G SY21-22",
                    "set_type""CourseSection",
                    "set_id"1645508
                }
            ]
        }
   ]
}
Labels (1)
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
James
Community Champion

@gbhenry 

The quiz assignment overrides API endpoints are read-only. To set an assignment override, even for quizzes, use the Assignments API instead. Note that when creating an override (POST),  you won't include the id since there won't be one yet. The documentation explains what needs sent.

View solution in original post

3 Replies
James
Community Champion

@gbhenry 

The quiz assignment overrides API endpoints are read-only. To set an assignment override, even for quizzes, use the Assignments API instead. Note that when creating an override (POST),  you won't include the id since there won't be one yet. The documentation explains what needs sent.

View solution in original post

gbhenry
Community Member

Thanks for your quick reply!  However, I'm still not able to get it working.  I had previously been successful creating a batch override for assignments using:

gbhenry_0-1623066025206.png

I can't get it working for quizzes.  If I try it with the same syntax, I get the error "assignment not found".  I tried changing the assignment_id parameter to quiz_id but received the error message that it had to be assignment_id.  I tried changing to quiz_assignment_overrides but that didn't work either.  Lastly, I tried changing to quiz_overrides with quiz_id.  I didn't get an error but it also didn't do anything.

Please help me!  Thanks!

gbhenry
Community Member

I figured it out.  I was using the quiz_id rather than the assignment_id associated with the quiz.  Thanks for the help!