I have been able to move some data from google classroom to a spreadsheet using google script. Specifically anything in classroom courses or course work. I get a permission error when I try to access and thing in coursework.
(method listAssigments works fine needs refinement works slow) (method listGrades gives and permission error at var submissions)
I have set up the API as describe in getting started, but have not added any other authorization.
I originally thought it was because I created it in Google classroom, but when I use the site https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/list The try this works fine. When I put the request directly to the web I get the error again.
I know it can work several add-ons get in information, but I can not find any example code that is not python. I am trying to make a simple spreadsheet that will sort the grade as I need them for my grade book. Any work around would be fine. Though I would like to be able to push grades back to google as well. Adding participation points is really slow in classroom, I would rather just copy down and change any anomalies or paste in grade for an another spreadsheet.
I will add the code in case it helps, but I believe it must be some sort of additional authentication or permission needed to provide or add.
function listGrades(courseWorkId, course) {
var courseId = course.id
var ss = SpreadsheetApp.getActive().getSheetByName(course.name);
var submissions = Classroom.Courses.CourseWork.StudentSubmissions.list(4140802199, 4801051201);
var grade = submissions.studentSubmissions[0].assignedGrade
}
function listAssigments(course) {
var courseId = course.id
var courseWork = Classroom.Courses.CourseWork.list(courseId).courseWork
var ss = SpreadsheetApp.getActive().getSheetByName(course.name);
for(var i = 0; i < courseWork.length; i++) {
var tittle = courseWork[i].title
var points = courseWork[i].creationTime
var id = courseWork[i].id
var id = courseWork[i]
ss.getRange(2, i+5).setValue(tittle);
ss.getRange(3, i+5).setValue(points);
ss.getRange(1, i+5).setValue(id);
}