cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kj460
Community Participant

Student quiz score through an API call

Jump to solution

Hi everyone,

Does anyone know the way to get student's quiz score through an API call using student's ID?

It looks like there is a way to get the students who answered certain questions correctly for a specific quiz, but I'm having trouble finding the right API function to get specific student's quiz score.

Thank you in advance

1 Solution

Accepted Solutions
James
Community Champion

 @jdammeier2  

Not exactly, but yes. I haven't done it, but I've done everything that should be needed to do it.

One way, not recommended, would be to go into each assessment and download the student analysis to get the results. Then you write a program that matches questions based off the text of the question because the ID in the front will be different. I have found the student analysis to not be helpful for certain types of quiz questions, but you may be lucky.

A step up would be to use a program to obtain this information. You first need some way of identifying the common assessment. This could be as simple as is to go into each course and make a note of the assignment ID; a better way would be if you used a common name that you could match off of.

For the item analysis, you can obtain the student answers by using include[]=submission_history. This gives you the student responses for all attempts, but there is overhead associated with decoding it. It mostly contains the ID of the student response, you may need to find the actual responses somewhere else.

Here are some threads with additional information. I don't know that I've seen it written it all up in one place.

The last one was written before I discovered the include[]=submission_history trick.

View solution in original post

0 Kudos
6 Replies
bneporadny
Community Champion

Hi Kevin ,

I haven't used the quiz API's to pull quiz data for individual students so I can't help you there (maybe someone else can in the Canvas Developers‌ group). But I can tell you how I do this for my school.

On a daily basis I call the student submisisons‌ report and store that in a local database table and from there I am able to produce reports showing what students got on what quizzes/assignments. 

I did find one way to do this and that is to pull every submission for a particular quiz and then parse through the json‌ response looking for the particular students you're looking to get the quiz score on. This can be done by using the Get The Quiz Submission api‌ (Canvas LMS REST API Documentation ) 

Brian

James
Community Champion

 @kj460 ,

In addition to what  @bneporadny  wrote, you may be able to use the List submissions for multiple assignments endpoint of the Submissions API. You'll need to know the corresponding assignment ID for the quiz to do this. It's what the gradebook uses to download grades and is the API version of what he's getting through the student submissions report.

What I do is get the Quiz Submissions like he mentioned, then iterate through them. I was doing an analysis where I needed the grade for all of the students and for of the attempts, not just the last one. If submission.attempt > 1, then the student has multiple attempts. You can fetch the quiz submission for each attempt by adding an id and attempt to the quiz submissions call.

Out of curiosity, which call are you using to see which students got certain questions correct? I haven't been able to find a reliable way to extract student answers from Canvas, either through the API or through Canvas Data. The closest I've been able to come is with the Quiz Audit Log, so if you've found a way, I would love to know it.

jdammeier2
Community Participant

 @James ,

I am curious if you have worked on obtaining the student scores or an item analysis of common assessments used across multiple sections (not cross-listed) of the same course. I would love to use the API to be able to do an item analysis on department midterms or final exams. 

Thanks,

Jutin

James
Community Champion

 @jdammeier2  

Not exactly, but yes. I haven't done it, but I've done everything that should be needed to do it.

One way, not recommended, would be to go into each assessment and download the student analysis to get the results. Then you write a program that matches questions based off the text of the question because the ID in the front will be different. I have found the student analysis to not be helpful for certain types of quiz questions, but you may be lucky.

A step up would be to use a program to obtain this information. You first need some way of identifying the common assessment. This could be as simple as is to go into each course and make a note of the assignment ID; a better way would be if you used a common name that you could match off of.

For the item analysis, you can obtain the student answers by using include[]=submission_history. This gives you the student responses for all attempts, but there is overhead associated with decoding it. It mostly contains the ID of the student response, you may need to find the actual responses somewhere else.

Here are some threads with additional information. I don't know that I've seen it written it all up in one place.

The last one was written before I discovered the include[]=submission_history trick.

View solution in original post

0 Kudos

@James 

I've been having kind of the same issue, im trying to get a list of all of my students' scores but it returns a 2d array of titles and "undefined", I've been through most of the discussions about quizzes but I can't seem to get it to work. Do you know of a fix for that?

James
Community Champion

@MounirYoussef 

I'm not sure what you mean when you say "it" returned a 2d array of titles and undefined. There was a lot of different advice given in the posts and I'm not sure what exactly you're trying.

To double check, are you using classic quizzes (new quizzes doesn't have the API functionality yet), and are they graded quizzes (as opposed to practice quiz or ungraded survey)?