cancel
Showing results for 
Search instead for 
Did you mean: 
fabiocunha
Community Participant

How to change quiz attributes via API

Jump to solution

Hi,

I want to know if is it possible to change some attributes inside a quiz.

In this case, for example, I want to mark the checkbox "Manter os envios anônimos", it must be equivalent to "Keep submissions anonymous" or something like that. Please check the image below:

Canvas Image Example

But I need do to that via API, I use a Python Library from to access Canvas.

GitHub - ucfopen/canvasapi: Python API wrapper for Instructure's Canvas LMS. Easily manage courses, ... 

I use the code below to access the course name, 

canvas = Canvas(API_URL, API_KEY)
course = canvas.get_course(8718)
print(course.name)

but I don't know how to change the attributes(or parameters) inside a quiz.

How can I do that using the Python library?

Regards,

Fabio

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
fabiocunha
Community Participant

I was able to resolve the question.

course = canvas.get_course(8718)
print(course.name)
quiz = course.get_quiz(58321)
resultQuiz = quiz.edit( quiz={ 'anonymous_submissions': 'true',
   "due_at": "2020-05-22T23:59:00",
   "lock_at": "2020-05-22T23:59:00"
})

View solution in original post

0 Kudos
1 Reply
fabiocunha
Community Participant

I was able to resolve the question.

course = canvas.get_course(8718)
print(course.name)
quiz = course.get_quiz(58321)
resultQuiz = quiz.edit( quiz={ 'anonymous_submissions': 'true',
   "due_at": "2020-05-22T23:59:00",
   "lock_at": "2020-05-22T23:59:00"
})

View solution in original post

0 Kudos