Hey there!
I'm wondering if it's currently possible to pull the average (mean, high, and low) scores for assignments from the Canvas API.
Is this currently supported functionality?
@iamtheyammer
You mentioned box and whiskers, but then asked for the averages and the answer to one is yes and no to the other. The five number summary (minimum, first quartile, median, third quartile, and maximum) are available through the Get course-level assignment data endpoint of the Analytics API.
That API call returns the values for all of the graded assignments in a course. It gives an array, one item for each assignment. Here's what one of them looks like.
<SPAN class="punctuation token">{</SPAN><BR /> <SPAN class="string token">"assignment_id"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">24792049</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"title"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Quiz 1.2 Sampling & Experiments"</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"due_at"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"2020-01-29T05:59:00Z"</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"muted"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"points_possible"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">13</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"non_digital_submission"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">false</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"max_score"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">11</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"min_score"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"first_quartile"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">7.25</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"median"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">9</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"third_quartile"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">10</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"tardiness_breakdown"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN><BR /> <SPAN class="string token">"missing"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0.02272727272727273</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"late"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"on_time"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0.9772727272727273</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"floating"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"total"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">44</SPAN><BR /> <SPAN class="punctuation token">}</SPAN><BR /><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
You will need to be careful, though. If anyone got a 0 because they didn't take it, then that shows up as the minimum score. In my example, not the 2.27% that are missing (that's one student for this class: 44*0.02272727=1). That's why I have 0's, but that's not really what I want. However, including the average would incorporate that 0 and lower the average.
If you want to exclude 0 for missing, then you'll need to download the submissions and calculate the values directly. This can be done through the Submissions API. When I fetch that data, you want to look for 0 with missing: true. A value of missing: false and a 0 would be someone who took my quiz but got 0 points.
The above is for assignments, including quizzes.
If you want quiz-specific information, you can use the Fetching the latest quiz statistics endpoint of the Quiz Statistics API. Note that this uses the quiz ID and not the assignment ID. This includes a lot of information (not just averages, minimums, and maximums), but only for quizzes that have few students or attempts. This lesson in the Canvas Instructor Guide explains what the limitations are (see the blue box at the top): Once I publish a quiz, what kinds of quiz statistics are available?
Here's the results for that same quiz.
<SPAN class="string token">"submission_statistics"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN><BR /> <SPAN class="string token">"scores"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN><BR /> <SPAN class="number token">68</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">72</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">76</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">79</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">81</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">85</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">87</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><BR /> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"score_average"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">10.1625</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"score_high"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">11.35</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"score_low"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">8.9</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"score_stdev"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0.7712611425451237</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"correct_count_average"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">8.75</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"incorrect_count_average"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1.875</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"duration_average"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1005.75</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"unique_count"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">8</SPAN><BR /><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
This sounds promising because it gave the mean and the standard deviation. However, this may not be reliable even if it is available. It's only giving me the results for 8 students, even though there were 44 who took it.
In order to get all of the results, you need to add the undocumented query parameter all_versions=1 to your request. When I do that, I have all 43 student's scores.
The good news is that it doesn't include the 0 for the student who didn't take the quiz, so the average and standard deviation are only for the non-missing assignments.
<SPAN class="string token">"submission_statistics"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN><BR /> <SPAN class="string token">"scores"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN><BR /> <SPAN class="number token">36</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">40</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">48</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">52</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">55</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">57</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">60</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">61</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">63</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">66</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="number token">67</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">68</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">69</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">70</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">72</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">73</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">74</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">76</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">77</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">79</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">3</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="number token">80</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">81</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">82</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">83</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">84</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">85</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">87</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">89</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">90</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">3</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">92</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">98</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">2</SPAN><BR /> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"score_average"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">8.917857142857137</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"score_high"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">12.8</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"score_low"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">4.3</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"score_stdev"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1.99229790132999</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"correct_count_average"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">7.597402597402597</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"incorrect_count_average"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">3.207792207792208</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"duration_average"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1070.792207792208</SPAN><SPAN class="punctuation token">,</SPAN><BR /> <SPAN class="string token">"unique_count"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">43</SPAN><BR /><SPAN class="punctuation token">}</SPAN><BR /><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
The bad news is that adding all_versions=1 still fails if you exceed the limits of the quiz reporting detailed in the Instructor Guide and that it is only valid for quizzes and not other types of assignments.
Canvas Data Services sent out an alert that a course was concluded (because the course was concluded) and the status of each user in the UI is set to complete, however, the enrollments API endpoint shows the status of each user in the course as active. Is this a common issue? Have I misinterpreted how the individual…
How can one track Canvas Media use without having the reports available from Canvas Studio? Checking API endpoints and the Data 2 schema, there do not seem to be dedicated Canvas Media endpoints. Am I missing some? A method I've considered is using the body field of the wiki_pages table, as this contains the html code of…
Hello, I'm trying to utilize an API call to pull completed certificates and was hoping to download and store the certs as a backup. I can successfully run the API call but it will not allow me to view the certificate unless I access the URL while signed into an account where it's "my" cert. Is there a permissions setting…
UI for weekly progression idea that rest in the Schedule tab of the **K-12 UI** of Canvas it's incomplete and I really would not take it and push it into instance but I am going to post it here because in the past people like @James && @robotcars || @Steve_25 have had terrific input in the past... maybe w/their eyes and…
I have a new React + Flask webapp. It has its own login for users to start using the app. I have added this as an external tool in Canvas. What I want initially is to see of canvas users can start using the webapp without having to login if they click on the external tool link in a canvas course. I have 2 methods…