. Looking at the documentation for the Quiz Submissions API it shows that a time_spent value is returned for each recorded attempt which appears to be what I need. The documentation for "Get all quiz submissions" https://canvas.instructure.com/doc/api/quiz_submissions.html#method.quizzes/quiz_submissions_api.ind... indicates (emphasis added):
However it appears that the API does not behave this way. When a student has more than one attempt, only the most recent attempt is actually returned. Looking at the source code for Canvas, the issue appears to be in https://github.com/instructure/canvas-lms/blob/master/app/controllers/quizzes/quiz_submissions_api_c... where there is an if statement that ensures all attempts are returned only if the requester is a student.
Can someone verify this behavior? Is this a bug with the documentation or with the API?