I'm trying to use Google Classroom's Rest resources (https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions#StudentSubmission) to implement a student posting an answer to a "Simple Question" assignment (i.e.: An assignment which takes only a string as the answer) As of now I'm using the following body for my patch calls:
StudentSubmission studentSubmission = new StudentSubmission();
studentSubmission.setMultipleChoiceSubmission(new MultipleChoiceSubmission().setAnswer(answer));
classroomService.courses().courseWork().studentSubmissions().patch(courseId, courseWorkId, id, studentSubmission).execute();
And the result is an Error 400 - Invalid JSON payload received..
{
"code": 400,
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest"
}
],
"errors": [
{
"domain": "global",
"message": "updateMask: updateMask may only contain \"draftGrade\" or \"assignedGrade\".",
"reason": "badRequest"
}
],
I can successfully submit the assignment using courses.courseWork.studentSubmissions.turnIn, but when submitting short answer and multiple choice questions, I end up submitting blank answers!
How do I submit answers to short answer and multiple choice questions through the classroom api.
Is there a way to make this happen - i.e.: for a third party software to update an answer from a student's assignment? Thanks in advance!