google-classroom

Adding a Topic ID to a Google Classroom assignment

牧云@^-^@ 提交于 2021-02-08 10:27:18
问题 I'm trying to create an assignment using Google Apps script and place it under a topic that is also created in the same script. I have no problem creating an assignment when no topicId is specified, but as soon as I try to specify a topicId , I receive the following error when I run the script: API call to classroom.courses.courseWork.create failed with error: Invalid JSON payload received. Unknown name "Test Topic" Here is my code: function makeStuff() { var topic = { name: "Test Topic" };

500 Internal Server Error when trying to delete certain courses

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-08 05:13:37
问题 Example: Courses.Get successfully gets the course like this: Request GET https://classroom.googleapis.com/v1/courses/1053592526?key={YOUR_API_KEY} Response 200 - HIDE HEADERS - cache-control: private content-encoding: gzip content-length: 232 content-type: application/json; charset=UTF-8 date: Wed, 27 Apr 2016 11:45:29 GMT server: ESF vary: Origin, X-Origin, Referer { "id": "1053592526", "name": "Test course 18", "ownerId": "118150671162893595524", "creationTime": "2016-03-11T12:49:19.459Z",

How do I edit scopes? // Google Classroom control permission scopes in google apps scripts for student access

时光总嘲笑我的痴心妄想 提交于 2021-02-07 04:01:52
问题 I am a high school teacher writing a Google Apps Script against Google Classroom. I want to create a spreadsheet like view of my students grades that my students can access with their credentials. I have successfully written the code so that I can run it with my privileges by explicitly placing the student's Id in the code. Additionally, I have successfully written the code in Python where I can explicitly set just the two scopes a student needs to access this (and only this) information.

Google Classroom Create topic returning 403 authentication error

你。 提交于 2021-01-29 12:56:20
问题 I'm developing a php application using Google Classroom. I have a problem to create a topic for a course: I can view the list of topics, but I can't create one. This is the error: Google_Service_Exception Object ( [errors:protected] => Array ( [0] => Array ( [message] => The caller does not have permission [domain] => global [reason] => forbidden ) ) [message:protected] => { "error": { "code": 403, "message": "The caller does not have permission", "errors": [ { "message": "The caller does not

java.io.FileNotFoundException: Resource not found: /credentials.json on Java QuickStart for Classroom API

喜夏-厌秋 提交于 2021-01-29 06:36:43
问题 I have implemented the Java QuickStart for the Classroom API and am getting an error message "java.io.FileNotFoundException: Resource not found: /credentials.json" at run-time. I copied my credentials.json file to the Project res directory, but continue to get this error. Any suggestions? 回答1: I tried it in a different way than I found on other websites, and it worked for me. replace below code: InputStream in = GoogleSheetAPIHandler.class.getClass().getResourceAsStream(CREDENTIALS_FILE_PATH)

Problem listing assignments of a student in Google Classroom

狂风中的少年 提交于 2021-01-29 05:11:59
问题 I am starting to use Classroom API to enhance local apps in our school. In order to make a report for a class, I want to list all student assignments and gradings. I use loops to go through all courses for a student, then all coursework for every course, and then all submissions for every coursework. Here is the piece of code that I use: function fListWorkStudent(idStudent) { // Variables var pageToken = null; var optionalArgs = { pageToken: pageToken, courseStates: 'ACTIVE', studentId:

What Admin Roles settings to set to be able to access Google Classroom API for the domain?

ε祈祈猫儿з 提交于 2021-01-28 19:26:39
问题 We are trying to create a separate Admin role to assign to users to be able to call the Google Classroom API (domain). If we set them to be 'super admin' it works but we do not want to give these users super admin permissions. Anyone knows any guide or the settings to set on this? 回答1: Answer: There is no role apart from Super Admin that will let a user make all these actions. You can check that by assigning custom admin roles to the user. Even if all possible privileges are checked, if the

Can I randomize items in MultipleChoiceItem?

微笑、不失礼 提交于 2021-01-28 11:32:21
问题 I'm new to GoogleAppsScript and now making quizzes in google form and spreadsheet by using GAS. I want to shuffle items in a MultipleChoiceItem when the google form is reloaded. A part of my current scirpt, slightly modified form this code, is presented below. //vars from spreadsheet var form = FormApp.openById(id); var ss = SpreadsheetApp.openById(question_bank_ID); var text = sheet.getSheetValues(questions[i]+1, 2, 1, 1)[0][0]; var options = sheet.getSheetValues(questions[i]+1, 5, 1, 5)[0];

Avoid exposure of API key and client ID when using Google Classroom browser API

旧巷老猫 提交于 2021-01-27 20:04:11
问题 I'm trying to use the Google Classroom Browser API. I referred to the page at https://developers.google.com/classroom/quickstart/js for the Quick Start for this API, but unfortunately it seems to expose my Client ID and API key in the script within the HTML. Here's a link to the sample page provided by Google: https://github.com/gsuitedevs/browser-samples/blob/master/classroom/quickstart/index.html The Client ID and API key are exposed on lines 34 and 35: // Client ID and API key from the