AnsweredAssumed Answered

Add grade using canvas submission API

Question asked by Abhishek Gupta on Apr 3, 2017
Latest reply on Apr 4, 2017 by Colin Murtaugh

Hi All,

 

I am Abhishek Gupta, a TA at UC Davis.

I am trying to build an application that update grades for students for a particular assignment.

I am was able to query student id's.

However, I have trouble updating the grades. I have looked at the Submissions - Canvas LMS REST API Documentation 

and tried it. My request returns a 200 code and a JSON object but the grade is not updated.

 

Below is the python code for updating grade for a single student for an assignment:


GRADE_URL = 'https://canvas.ucdavis.edu/api/v1/courses/' + course_id + '/assignments/' + assignment_id + '/submissions/' + user_id
#make the form data
data = { 'submission':{
                                    'posted_grade': 8.0
                                   }
             }
#make the PUT request

userGrade = requests.put(GRADE_URL, headers = self.headers, data = data)

 

Any help in this regard will be much appreciated!post grades

Outcomes