google-classroom

Creating Classroom using App Script

自闭症网瘾萝莉.ら 提交于 2019-12-25 05:17:14
问题 I'm trying to create Google classrooms from a spreadsheet using App Script. I can create the classes successfully, but it's not adding the course materials (1 Doc) to the about page. This is the code I am using and I've tried using the API reference to no avail. Can someone please advise me on how to correctly format the courseMaterialSets to include a Google Doc from my drive. var create = Classroom.Courses.create({ "ownerId": '-My email address-', "name": getData[i][0], "section": getData[i

Authorization needed for classroom.profile.emails

喜你入骨 提交于 2019-12-25 04:36:07
问题 I'm working on a web app in Google Apps Script, and I'm having some trouble understanding how the authorization is handled. When accessing the web app as the user using the app, it prompts for authorization, and everything appears okay. However, I'm call userProfiles.get and looking for student email addresses, and it returns the profile without the email. function classRosters() { var teacher = Classroom.UserProfiles.get(Session.getActiveUser().getEmail()); var classList = Classroom.Courses

List more than 30 students in a class in Google Classroom API query

半腔热情 提交于 2019-12-23 23:03:08
问题 At this moment, I have a script that works correctly to list students of a class in Google Classroom, but it does NOT list ALL of the students, only the first 30. I need it to list ALL of the students, no matter how many there are. What I have now is the following: function listStudents() { var s = SpreadsheetApp.getActiveSpreadsheet(); var sh = s.getSheetByName('CLASS'); var r = sh.getDataRange(); var n = r.getNumRows(); var d = r.getValues(); for (x = 0; x < n; x++) { var i = d[x][0]; if(i

StudentSubmissions.Patch UpdateMask Error

孤者浪人 提交于 2019-12-23 05:52:04
问题 Trying to use the StudentSubmissions.Patch part of the Classroom API in Google Apps Script and keeping running across this error updateMask: updateMask may only contain "draftGrade" or "assignedGrade" Here is my code for that particular section: var studentSubmission = {'draft_grade':'88'} var patchC = Classroom.Courses.CourseWork.StudentSubmissions.patch(studentSubmission, courseId, cwId, submissionId); There is clearly something wrong with the way I am passing the StudentSubmission Resource

StudentSubmissions.Patch UpdateMask Error

孤者浪人 提交于 2019-12-23 05:51:32
问题 Trying to use the StudentSubmissions.Patch part of the Classroom API in Google Apps Script and keeping running across this error updateMask: updateMask may only contain "draftGrade" or "assignedGrade" Here is my code for that particular section: var studentSubmission = {'draft_grade':'88'} var patchC = Classroom.Courses.CourseWork.StudentSubmissions.patch(studentSubmission, courseId, cwId, submissionId); There is clearly something wrong with the way I am passing the StudentSubmission Resource

Google Classroom - Programmatically create assignment

情到浓时终转凉″ 提交于 2019-12-23 02:57:25
问题 I'm using google apps script to create assignment with an uploaded document for a classroom. However, there's an error. Execution failed: Invalid JSON payload received. Unknown name "share_mode" at 'course_work.materials[0]': Cannot find field. Invalid JSON payload received. Unknown name "id" at 'course_work.materials[0].drive_file': Cannot find field. Invalid JSON payload received. Unknown name "title" at 'course_work.materials[0].drive_file': Cannot find field. (line 2, file "TEST") [0.061

Can't Enabled Classroom API to project

半世苍凉 提交于 2019-12-20 07:28:59
问题 I'm trying to Enable Classroom API on my account (This was the email address I used when i signed up). When I click on the link in the directions Use this wizard to create or select a project in the Google Developers Console and automatically enable the API. https://console.developers.google.com/start/api?id=classroom I get the error message "The API you requested was not found. Dismiss" Any feedback would be much appreciated. 回答1: A problem with my account. I can now add Classroom API to my

Google Classroom API modifyAttachments

拜拜、爱过 提交于 2019-12-17 21:20:36
问题 When executing the courses.courseWork.studentSubmissions.modifyAttachments method in the Google Classroom API, a 403 error is returned when I try to add the attachment to the student's submission. GoogleJsonResponseException: { "code" : 403, "errors" : [ { "domain" : "global", "message" : "@ProjectPermissionDenied The Developer Console project is not permitted to make this request.", "reason" : "forbidden" } ], "message" : "@ProjectPermissionDenied The Developer Console project is not

How to set the content-id in a Google Classroom API V1 request

不问归期 提交于 2019-12-14 03:13:11
问题 I'm creating a lot of batched requests and I want to keep track of which ones are successful and which ones error. I'm using all kinds of different requests with the Google Classroom API V1. I want to set the content-ID to a unique value and reference it in the callbacks. Any help would be appreciated, especially in C#. Here is a sample for adding a course deletion to a batch request: requests[CurrentBatch].Queue<GoogleCourse>(serviceCredential.Service.Courses.Delete(course.Id), (content,

incorrect nextPageToken Bug in Google Classroom API V1

天涯浪子 提交于 2019-12-13 18:36:03
问题 When asking for a list of courses (or any list), if the list is empty a nextPageToken is still returned, there may be a very good reason for this, but maybe not. It makes it seem like there is still more information to get. I message saying "no more items" or something would be more useful. I think is happening because we had a lot of courses, then they were all deleted. I used this page to help test. https://developers.google.com/classroom/reference/rest/v1/courses/list 回答1: There is a known