I have created an assignment on the google classroom website which I would like to grade using the Google Classroom API. Based on the documentation this can be achieved with the following.
studentSubmission = {
'assignedGrade': 99,
'draftGrade': 80
}
service.courses().courseWork().studentSubmissions().patch(
courseId=<course ID or alias>,
courseWorkId=<courseWork ID>,
id=<studentSubmission ID>,
updateMask='assignedGrade,draftGrade',
body=studentSubmission).execute()
The problem is I'm running to a permission error "@ProjectPermissionDenied The Developer Console project is not permitted to make this request." It is my understanding that this error occurs because the website is using a different Developer Console project than the one I am using the make API requests.
I am using the same Google account to authenticate the API and create coursework in Google Classroom. I have also confirmed I have all the required scopes and tested the API in the browser using the "Try this API" method and received the same permission error.
Since creating assignments through the website is necessary for my use case, I was wondering whether there was a way to get around the permission error so an assignment created on the website can be graded through the API?