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

Getting list of Quiz Statistics

Hi all,

In my application, I'm making separate API calls for each Quiz object to get its Statistics.

And as a result of this, if the number of Quiz is large, sometimes it takes minutes to load the page.

Would there be a better way to achieve this without creating separate API calls for each Quiz to speed up the process?

FYI, I'm using python SDK to make requests.

Thank you!

Labels (1)
0 Kudos
1 Reply
Community Member

I'm uploading the function that I created inside that returns the statistics object:

# function declaration

def get_statistics(self, **kwargs):
   response = self._requester.request(
   response_json = response.json()
   response_json['quiz_statistics'][0]['course_id'] = self.course_id

   return QuizStatistics(self._requester, response_json['quiz_statistics'][0])

# QuizStatistics class declaration

class QuizStatistics(CanvasObject):
   def __str__(self):
   return "{} ({})".format(self.url,