mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Update Google Classroom types using new generator * Fix formatting * More fixes * . * Update types/gapi.client.classroom/tsconfig.json
14932 lines
629 KiB
TypeScript
14932 lines
629 KiB
TypeScript
/* This is stub file for gapi.client.classroom definition tests */
|
|
/* IMPORTANT.
|
|
* This file was automatically generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
* In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
**/
|
|
gapi.load('client', () => {
|
|
/** now we can use gapi.client */
|
|
gapi.client.load('classroom', 'v1', () => {
|
|
/** now we can use gapi.client.classroom */
|
|
|
|
/** don't forget to authenticate your client before sending any request to resources: */
|
|
/** declare client_id registered in Google Developers Console */
|
|
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
|
const scope = [
|
|
/** View and manage announcements in Google Classroom */
|
|
'https://www.googleapis.com/auth/classroom.announcements',
|
|
/** View announcements in Google Classroom */
|
|
'https://www.googleapis.com/auth/classroom.announcements.readonly',
|
|
/** Manage your Google Classroom classes */
|
|
'https://www.googleapis.com/auth/classroom.courses',
|
|
/** View your Google Classroom classes */
|
|
'https://www.googleapis.com/auth/classroom.courses.readonly',
|
|
/** Manage your course work and view your grades in Google Classroom */
|
|
'https://www.googleapis.com/auth/classroom.coursework.me',
|
|
/** View your course work and grades in Google Classroom */
|
|
'https://www.googleapis.com/auth/classroom.coursework.me.readonly',
|
|
/** Manage course work and grades for students in the Google Classroom classes you teach and view the course work and grades for classes you administer */
|
|
'https://www.googleapis.com/auth/classroom.coursework.students',
|
|
/** View course work and grades for students in the Google Classroom classes you teach or administer */
|
|
'https://www.googleapis.com/auth/classroom.coursework.students.readonly',
|
|
/** View your Google Classroom guardians */
|
|
'https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly',
|
|
/** View and manage guardians for students in your Google Classroom classes */
|
|
'https://www.googleapis.com/auth/classroom.guardianlinks.students',
|
|
/** View guardians for students in your Google Classroom classes */
|
|
'https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly',
|
|
/** View the email addresses of people in your classes */
|
|
'https://www.googleapis.com/auth/classroom.profile.emails',
|
|
/** View the profile photos of people in your classes */
|
|
'https://www.googleapis.com/auth/classroom.profile.photos',
|
|
/** Receive notifications about your Google Classroom data */
|
|
'https://www.googleapis.com/auth/classroom.push-notifications',
|
|
/** Manage your Google Classroom class rosters */
|
|
'https://www.googleapis.com/auth/classroom.rosters',
|
|
/** View your Google Classroom class rosters */
|
|
'https://www.googleapis.com/auth/classroom.rosters.readonly',
|
|
/** View your course work and grades in Google Classroom */
|
|
'https://www.googleapis.com/auth/classroom.student-submissions.me.readonly',
|
|
/** View course work and grades for students in the Google Classroom classes you teach or administer */
|
|
'https://www.googleapis.com/auth/classroom.student-submissions.students.readonly',
|
|
/** See, create, and edit topics in Google Classroom */
|
|
'https://www.googleapis.com/auth/classroom.topics',
|
|
/** View topics in Google Classroom */
|
|
'https://www.googleapis.com/auth/classroom.topics.readonly',
|
|
];
|
|
const immediate = false;
|
|
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
if (authResult && !authResult.error) {
|
|
/** handle successful authorization */
|
|
run();
|
|
} else {
|
|
/** handle authorization error */
|
|
}
|
|
});
|
|
});
|
|
|
|
async function run() {
|
|
/**
|
|
* Creates a course.
|
|
*
|
|
* The user specified in `ownerId` is the owner of the created course
|
|
* and added as a teacher.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* courses or for access errors.
|
|
* * `NOT_FOUND` if the primary teacher is not a valid user.
|
|
* * `FAILED_PRECONDITION` if the course owner's account is disabled or for
|
|
* the following request errors:
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if an alias was specified in the `id` and
|
|
* already exists.
|
|
*/
|
|
await gapi.client.classroom.courses.create({
|
|
}, {
|
|
alternateLink: "Test string",
|
|
calendarId: "Test string",
|
|
courseGroupEmail: "Test string",
|
|
courseMaterialSets: [
|
|
{
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
title: "Test string",
|
|
} ],
|
|
courseState: "Test string",
|
|
creationTime: "Test string",
|
|
description: "Test string",
|
|
descriptionHeading: "Test string",
|
|
enrollmentCode: "Test string",
|
|
guardiansEnabled: true,
|
|
id: "Test string",
|
|
name: "Test string",
|
|
ownerId: "Test string",
|
|
room: "Test string",
|
|
section: "Test string",
|
|
teacherFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
teacherGroupEmail: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of announcements that the requester is permitted to view.
|
|
*
|
|
* Course students may only view `PUBLISHED` announcements. Course teachers
|
|
* and domain administrators may view all announcements.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.list({
|
|
announcementStates: "Test string",
|
|
courseId: "Test string",
|
|
orderBy: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Creates an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create announcements in the requested course, share a
|
|
* Drive attachment, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
* * `FAILED_PRECONDITION` for the following request error:
|
|
* * AttachmentNotVisible
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
text: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Modifies assignee mode and options of an announcement.
|
|
*
|
|
* Only a teacher of the course that contains the announcement may
|
|
* call this method.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.modifyAssignees({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
assigneeMode: "Test string",
|
|
modifyIndividualStudentsOptions: {
|
|
addStudentIds: [
|
|
"Test string" ],
|
|
removeStudentIds: [
|
|
"Test string" ],
|
|
},
|
|
});
|
|
/**
|
|
* Updates one or more fields of an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding announcement or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `FAILED_PRECONDITION` if the requested announcement has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if the requested course or announcement does not exist
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
text: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or announcement, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or announcement does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an announcement.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding announcement item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding announcement, if the requesting user is not permitted
|
|
* to delete the requested course or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested announcement has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete
|
|
* students of this course or for access errors.
|
|
* * `NOT_FOUND` if no student of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.students.delete({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* students of this course or for access errors.
|
|
* * `NOT_FOUND` if no student of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.students.get({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of students of this course that the requester
|
|
* is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.courses.students.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Adds a user as a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* students in this course or for access errors.
|
|
* * `NOT_FOUND` if the requested course ID does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled,
|
|
* for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if the user is already a student or teacher in the
|
|
* course.
|
|
*/
|
|
await gapi.client.classroom.courses.students.create({
|
|
courseId: "Test string",
|
|
enrollmentCode: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
profile: {
|
|
emailAddress: "Test string",
|
|
id: "Test string",
|
|
name: {
|
|
familyName: "Test string",
|
|
fullName: "Test string",
|
|
givenName: "Test string",
|
|
},
|
|
permissions: [
|
|
{
|
|
permission: "Test string",
|
|
} ],
|
|
photoUrl: "Test string",
|
|
verifiedTeacher: true,
|
|
},
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create a topic in the requested course,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
name: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not allowed to delete the
|
|
* requested topic or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested topic has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course or topic exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding topic or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or topic does not exist
|
|
*/
|
|
await gapi.client.classroom.courses.topics.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
name: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or topic, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or topic does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns the list of topics that the requester is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Creates an alias for a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create the
|
|
* alias or for access errors.
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `ALREADY_EXISTS` if the alias already exists.
|
|
* * `FAILED_PRECONDITION` if the alias requested does not make sense for the
|
|
* requesting user or course (for example, if a user not in a domain
|
|
* attempts to access a domain-scoped alias).
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alias: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an alias of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to remove the
|
|
* alias or for access errors.
|
|
* * `NOT_FOUND` if the alias does not exist.
|
|
* * `FAILED_PRECONDITION` if the alias requested does not make sense for the
|
|
* requesting user or course (for example, if a user not in a domain
|
|
* attempts to delete a domain-scoped alias).
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.delete({
|
|
alias: "Test string",
|
|
courseId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of aliases for a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* course or for access errors.
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Modifies assignee mode and options of a coursework.
|
|
*
|
|
* Only a teacher of the course that contains the coursework may
|
|
* call this method.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.modifyAssignees({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
assigneeMode: "Test string",
|
|
modifyIndividualStudentsOptions: {
|
|
addStudentIds: [
|
|
"Test string" ],
|
|
removeStudentIds: [
|
|
"Test string" ],
|
|
},
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a course work.
|
|
*
|
|
* See google.classroom.v1.CourseWork for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `FAILED_PRECONDITION` if the requested course work has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
assignment: {
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
description: "Test string",
|
|
dueDate: {
|
|
day: 42,
|
|
month: 42,
|
|
year: 42,
|
|
},
|
|
dueTime: {
|
|
hours: 42,
|
|
minutes: 42,
|
|
nanos: 42,
|
|
seconds: 42,
|
|
},
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
maxPoints: 42,
|
|
multipleChoiceQuestion: {
|
|
choices: [
|
|
"Test string" ],
|
|
},
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
submissionModificationMode: "Test string",
|
|
title: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
workType: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns course work.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a course work.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the requesting user is not permitted
|
|
* to delete the requested course or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested course work has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of course work that the requester is permitted to view.
|
|
*
|
|
* Course students may only view `PUBLISHED` course work. Course teachers
|
|
* and domain administrators may view all course work.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.list({
|
|
courseId: "Test string",
|
|
courseWorkStates: "Test string",
|
|
orderBy: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates course work.
|
|
*
|
|
* The resulting course work (and corresponding student submissions) are
|
|
* associated with the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* make the request. Classroom API requests to modify course work and student
|
|
* submissions must be made with an OAuth client ID from the associated
|
|
* Developer Console project.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create course work in the requested course, share a
|
|
* Drive attachment, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
* * `FAILED_PRECONDITION` for the following request error:
|
|
* * AttachmentNotVisible
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
assignment: {
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
description: "Test string",
|
|
dueDate: {
|
|
day: 42,
|
|
month: 42,
|
|
year: 42,
|
|
},
|
|
dueTime: {
|
|
hours: 42,
|
|
minutes: 42,
|
|
nanos: 42,
|
|
seconds: 42,
|
|
},
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
maxPoints: 42,
|
|
multipleChoiceQuestion: {
|
|
choices: [
|
|
"Test string" ],
|
|
},
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
submissionModificationMode: "Test string",
|
|
title: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
workType: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* teachers in this course or for access errors.
|
|
* * `NOT_FOUND` if the requested course ID does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled,
|
|
* for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * CourseTeacherLimitReached
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if the user is already a teacher or student in the
|
|
* course.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
profile: {
|
|
emailAddress: "Test string",
|
|
id: "Test string",
|
|
name: {
|
|
familyName: "Test string",
|
|
fullName: "Test string",
|
|
givenName: "Test string",
|
|
},
|
|
permissions: [
|
|
{
|
|
permission: "Test string",
|
|
} ],
|
|
photoUrl: "Test string",
|
|
verifiedTeacher: true,
|
|
},
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete
|
|
* teachers of this course or for access errors.
|
|
* * `NOT_FOUND` if no teacher of this course has the requested ID or if the
|
|
* course does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher
|
|
* of this course.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.delete({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* teachers of this course or for access errors.
|
|
* * `NOT_FOUND` if no teacher of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.get({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of teachers of this course that the requester
|
|
* is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete the
|
|
* requested course or for access errors.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.delete({
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of announcements that the requester is permitted to view.
|
|
*
|
|
* Course students may only view `PUBLISHED` announcements. Course teachers
|
|
* and domain administrators may view all announcements.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.list({
|
|
announcementStates: "Test string",
|
|
courseId: "Test string",
|
|
orderBy: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Creates an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create announcements in the requested course, share a
|
|
* Drive attachment, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
* * `FAILED_PRECONDITION` for the following request error:
|
|
* * AttachmentNotVisible
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
text: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Modifies assignee mode and options of an announcement.
|
|
*
|
|
* Only a teacher of the course that contains the announcement may
|
|
* call this method.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.modifyAssignees({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
assigneeMode: "Test string",
|
|
modifyIndividualStudentsOptions: {
|
|
addStudentIds: [
|
|
"Test string" ],
|
|
removeStudentIds: [
|
|
"Test string" ],
|
|
},
|
|
});
|
|
/**
|
|
* Updates one or more fields of an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding announcement or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `FAILED_PRECONDITION` if the requested announcement has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if the requested course or announcement does not exist
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
text: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or announcement, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or announcement does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an announcement.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding announcement item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding announcement, if the requesting user is not permitted
|
|
* to delete the requested course or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested announcement has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete
|
|
* students of this course or for access errors.
|
|
* * `NOT_FOUND` if no student of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.students.delete({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* students of this course or for access errors.
|
|
* * `NOT_FOUND` if no student of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.students.get({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of students of this course that the requester
|
|
* is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.courses.students.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Adds a user as a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* students in this course or for access errors.
|
|
* * `NOT_FOUND` if the requested course ID does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled,
|
|
* for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if the user is already a student or teacher in the
|
|
* course.
|
|
*/
|
|
await gapi.client.classroom.courses.students.create({
|
|
courseId: "Test string",
|
|
enrollmentCode: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
profile: {
|
|
emailAddress: "Test string",
|
|
id: "Test string",
|
|
name: {
|
|
familyName: "Test string",
|
|
fullName: "Test string",
|
|
givenName: "Test string",
|
|
},
|
|
permissions: [
|
|
{
|
|
permission: "Test string",
|
|
} ],
|
|
photoUrl: "Test string",
|
|
verifiedTeacher: true,
|
|
},
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create a topic in the requested course,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
name: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not allowed to delete the
|
|
* requested topic or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested topic has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course or topic exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding topic or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or topic does not exist
|
|
*/
|
|
await gapi.client.classroom.courses.topics.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
name: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or topic, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or topic does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns the list of topics that the requester is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Creates an alias for a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create the
|
|
* alias or for access errors.
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `ALREADY_EXISTS` if the alias already exists.
|
|
* * `FAILED_PRECONDITION` if the alias requested does not make sense for the
|
|
* requesting user or course (for example, if a user not in a domain
|
|
* attempts to access a domain-scoped alias).
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alias: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an alias of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to remove the
|
|
* alias or for access errors.
|
|
* * `NOT_FOUND` if the alias does not exist.
|
|
* * `FAILED_PRECONDITION` if the alias requested does not make sense for the
|
|
* requesting user or course (for example, if a user not in a domain
|
|
* attempts to delete a domain-scoped alias).
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.delete({
|
|
alias: "Test string",
|
|
courseId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of aliases for a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* course or for access errors.
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Modifies assignee mode and options of a coursework.
|
|
*
|
|
* Only a teacher of the course that contains the coursework may
|
|
* call this method.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.modifyAssignees({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
assigneeMode: "Test string",
|
|
modifyIndividualStudentsOptions: {
|
|
addStudentIds: [
|
|
"Test string" ],
|
|
removeStudentIds: [
|
|
"Test string" ],
|
|
},
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a course work.
|
|
*
|
|
* See google.classroom.v1.CourseWork for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `FAILED_PRECONDITION` if the requested course work has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
assignment: {
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
description: "Test string",
|
|
dueDate: {
|
|
day: 42,
|
|
month: 42,
|
|
year: 42,
|
|
},
|
|
dueTime: {
|
|
hours: 42,
|
|
minutes: 42,
|
|
nanos: 42,
|
|
seconds: 42,
|
|
},
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
maxPoints: 42,
|
|
multipleChoiceQuestion: {
|
|
choices: [
|
|
"Test string" ],
|
|
},
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
submissionModificationMode: "Test string",
|
|
title: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
workType: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns course work.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a course work.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the requesting user is not permitted
|
|
* to delete the requested course or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested course work has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of course work that the requester is permitted to view.
|
|
*
|
|
* Course students may only view `PUBLISHED` course work. Course teachers
|
|
* and domain administrators may view all course work.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.list({
|
|
courseId: "Test string",
|
|
courseWorkStates: "Test string",
|
|
orderBy: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates course work.
|
|
*
|
|
* The resulting course work (and corresponding student submissions) are
|
|
* associated with the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* make the request. Classroom API requests to modify course work and student
|
|
* submissions must be made with an OAuth client ID from the associated
|
|
* Developer Console project.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create course work in the requested course, share a
|
|
* Drive attachment, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
* * `FAILED_PRECONDITION` for the following request error:
|
|
* * AttachmentNotVisible
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
assignment: {
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
description: "Test string",
|
|
dueDate: {
|
|
day: 42,
|
|
month: 42,
|
|
year: 42,
|
|
},
|
|
dueTime: {
|
|
hours: 42,
|
|
minutes: 42,
|
|
nanos: 42,
|
|
seconds: 42,
|
|
},
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
maxPoints: 42,
|
|
multipleChoiceQuestion: {
|
|
choices: [
|
|
"Test string" ],
|
|
},
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
submissionModificationMode: "Test string",
|
|
title: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
workType: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* teachers in this course or for access errors.
|
|
* * `NOT_FOUND` if the requested course ID does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled,
|
|
* for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * CourseTeacherLimitReached
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if the user is already a teacher or student in the
|
|
* course.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
profile: {
|
|
emailAddress: "Test string",
|
|
id: "Test string",
|
|
name: {
|
|
familyName: "Test string",
|
|
fullName: "Test string",
|
|
givenName: "Test string",
|
|
},
|
|
permissions: [
|
|
{
|
|
permission: "Test string",
|
|
} ],
|
|
photoUrl: "Test string",
|
|
verifiedTeacher: true,
|
|
},
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete
|
|
* teachers of this course or for access errors.
|
|
* * `NOT_FOUND` if no teacher of this course has the requested ID or if the
|
|
* course does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher
|
|
* of this course.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.delete({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* teachers of this course or for access errors.
|
|
* * `NOT_FOUND` if no teacher of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.get({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of teachers of this course that the requester
|
|
* is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Returns a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or for access errors.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.get({
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of announcements that the requester is permitted to view.
|
|
*
|
|
* Course students may only view `PUBLISHED` announcements. Course teachers
|
|
* and domain administrators may view all announcements.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.list({
|
|
announcementStates: "Test string",
|
|
courseId: "Test string",
|
|
orderBy: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Creates an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create announcements in the requested course, share a
|
|
* Drive attachment, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
* * `FAILED_PRECONDITION` for the following request error:
|
|
* * AttachmentNotVisible
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
text: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Modifies assignee mode and options of an announcement.
|
|
*
|
|
* Only a teacher of the course that contains the announcement may
|
|
* call this method.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.modifyAssignees({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
assigneeMode: "Test string",
|
|
modifyIndividualStudentsOptions: {
|
|
addStudentIds: [
|
|
"Test string" ],
|
|
removeStudentIds: [
|
|
"Test string" ],
|
|
},
|
|
});
|
|
/**
|
|
* Updates one or more fields of an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding announcement or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `FAILED_PRECONDITION` if the requested announcement has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if the requested course or announcement does not exist
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
text: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or announcement, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or announcement does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an announcement.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding announcement item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding announcement, if the requesting user is not permitted
|
|
* to delete the requested course or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested announcement has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete
|
|
* students of this course or for access errors.
|
|
* * `NOT_FOUND` if no student of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.students.delete({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* students of this course or for access errors.
|
|
* * `NOT_FOUND` if no student of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.students.get({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of students of this course that the requester
|
|
* is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.courses.students.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Adds a user as a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* students in this course or for access errors.
|
|
* * `NOT_FOUND` if the requested course ID does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled,
|
|
* for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if the user is already a student or teacher in the
|
|
* course.
|
|
*/
|
|
await gapi.client.classroom.courses.students.create({
|
|
courseId: "Test string",
|
|
enrollmentCode: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
profile: {
|
|
emailAddress: "Test string",
|
|
id: "Test string",
|
|
name: {
|
|
familyName: "Test string",
|
|
fullName: "Test string",
|
|
givenName: "Test string",
|
|
},
|
|
permissions: [
|
|
{
|
|
permission: "Test string",
|
|
} ],
|
|
photoUrl: "Test string",
|
|
verifiedTeacher: true,
|
|
},
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create a topic in the requested course,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
name: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not allowed to delete the
|
|
* requested topic or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested topic has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course or topic exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding topic or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or topic does not exist
|
|
*/
|
|
await gapi.client.classroom.courses.topics.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
name: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or topic, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or topic does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns the list of topics that the requester is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Creates an alias for a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create the
|
|
* alias or for access errors.
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `ALREADY_EXISTS` if the alias already exists.
|
|
* * `FAILED_PRECONDITION` if the alias requested does not make sense for the
|
|
* requesting user or course (for example, if a user not in a domain
|
|
* attempts to access a domain-scoped alias).
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alias: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an alias of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to remove the
|
|
* alias or for access errors.
|
|
* * `NOT_FOUND` if the alias does not exist.
|
|
* * `FAILED_PRECONDITION` if the alias requested does not make sense for the
|
|
* requesting user or course (for example, if a user not in a domain
|
|
* attempts to delete a domain-scoped alias).
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.delete({
|
|
alias: "Test string",
|
|
courseId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of aliases for a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* course or for access errors.
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Modifies assignee mode and options of a coursework.
|
|
*
|
|
* Only a teacher of the course that contains the coursework may
|
|
* call this method.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.modifyAssignees({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
assigneeMode: "Test string",
|
|
modifyIndividualStudentsOptions: {
|
|
addStudentIds: [
|
|
"Test string" ],
|
|
removeStudentIds: [
|
|
"Test string" ],
|
|
},
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a course work.
|
|
*
|
|
* See google.classroom.v1.CourseWork for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `FAILED_PRECONDITION` if the requested course work has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
assignment: {
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
description: "Test string",
|
|
dueDate: {
|
|
day: 42,
|
|
month: 42,
|
|
year: 42,
|
|
},
|
|
dueTime: {
|
|
hours: 42,
|
|
minutes: 42,
|
|
nanos: 42,
|
|
seconds: 42,
|
|
},
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
maxPoints: 42,
|
|
multipleChoiceQuestion: {
|
|
choices: [
|
|
"Test string" ],
|
|
},
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
submissionModificationMode: "Test string",
|
|
title: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
workType: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns course work.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a course work.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the requesting user is not permitted
|
|
* to delete the requested course or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested course work has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of course work that the requester is permitted to view.
|
|
*
|
|
* Course students may only view `PUBLISHED` course work. Course teachers
|
|
* and domain administrators may view all course work.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.list({
|
|
courseId: "Test string",
|
|
courseWorkStates: "Test string",
|
|
orderBy: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates course work.
|
|
*
|
|
* The resulting course work (and corresponding student submissions) are
|
|
* associated with the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* make the request. Classroom API requests to modify course work and student
|
|
* submissions must be made with an OAuth client ID from the associated
|
|
* Developer Console project.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create course work in the requested course, share a
|
|
* Drive attachment, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
* * `FAILED_PRECONDITION` for the following request error:
|
|
* * AttachmentNotVisible
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
assignment: {
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
description: "Test string",
|
|
dueDate: {
|
|
day: 42,
|
|
month: 42,
|
|
year: 42,
|
|
},
|
|
dueTime: {
|
|
hours: 42,
|
|
minutes: 42,
|
|
nanos: 42,
|
|
seconds: 42,
|
|
},
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
maxPoints: 42,
|
|
multipleChoiceQuestion: {
|
|
choices: [
|
|
"Test string" ],
|
|
},
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
submissionModificationMode: "Test string",
|
|
title: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
workType: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* teachers in this course or for access errors.
|
|
* * `NOT_FOUND` if the requested course ID does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled,
|
|
* for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * CourseTeacherLimitReached
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if the user is already a teacher or student in the
|
|
* course.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
profile: {
|
|
emailAddress: "Test string",
|
|
id: "Test string",
|
|
name: {
|
|
familyName: "Test string",
|
|
fullName: "Test string",
|
|
givenName: "Test string",
|
|
},
|
|
permissions: [
|
|
{
|
|
permission: "Test string",
|
|
} ],
|
|
photoUrl: "Test string",
|
|
verifiedTeacher: true,
|
|
},
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete
|
|
* teachers of this course or for access errors.
|
|
* * `NOT_FOUND` if no teacher of this course has the requested ID or if the
|
|
* course does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher
|
|
* of this course.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.delete({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* teachers of this course or for access errors.
|
|
* * `NOT_FOUND` if no teacher of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.get({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of teachers of this course that the requester
|
|
* is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of courses that the requesting user is permitted to view,
|
|
* restricted to those that match the request. Returned courses are ordered by
|
|
* creation time, with the most recently created coming first.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
* * `INVALID_ARGUMENT` if the query argument is malformed.
|
|
* * `NOT_FOUND` if any users specified in the query arguments do not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.list({
|
|
courseStates: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
studentId: "Test string",
|
|
teacherId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of announcements that the requester is permitted to view.
|
|
*
|
|
* Course students may only view `PUBLISHED` announcements. Course teachers
|
|
* and domain administrators may view all announcements.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.list({
|
|
announcementStates: "Test string",
|
|
courseId: "Test string",
|
|
orderBy: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Creates an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create announcements in the requested course, share a
|
|
* Drive attachment, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
* * `FAILED_PRECONDITION` for the following request error:
|
|
* * AttachmentNotVisible
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
text: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Modifies assignee mode and options of an announcement.
|
|
*
|
|
* Only a teacher of the course that contains the announcement may
|
|
* call this method.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.modifyAssignees({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
assigneeMode: "Test string",
|
|
modifyIndividualStudentsOptions: {
|
|
addStudentIds: [
|
|
"Test string" ],
|
|
removeStudentIds: [
|
|
"Test string" ],
|
|
},
|
|
});
|
|
/**
|
|
* Updates one or more fields of an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding announcement or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `FAILED_PRECONDITION` if the requested announcement has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if the requested course or announcement does not exist
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
text: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or announcement, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or announcement does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an announcement.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding announcement item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding announcement, if the requesting user is not permitted
|
|
* to delete the requested course or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested announcement has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete
|
|
* students of this course or for access errors.
|
|
* * `NOT_FOUND` if no student of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.students.delete({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* students of this course or for access errors.
|
|
* * `NOT_FOUND` if no student of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.students.get({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of students of this course that the requester
|
|
* is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.courses.students.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Adds a user as a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* students in this course or for access errors.
|
|
* * `NOT_FOUND` if the requested course ID does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled,
|
|
* for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if the user is already a student or teacher in the
|
|
* course.
|
|
*/
|
|
await gapi.client.classroom.courses.students.create({
|
|
courseId: "Test string",
|
|
enrollmentCode: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
profile: {
|
|
emailAddress: "Test string",
|
|
id: "Test string",
|
|
name: {
|
|
familyName: "Test string",
|
|
fullName: "Test string",
|
|
givenName: "Test string",
|
|
},
|
|
permissions: [
|
|
{
|
|
permission: "Test string",
|
|
} ],
|
|
photoUrl: "Test string",
|
|
verifiedTeacher: true,
|
|
},
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create a topic in the requested course,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
name: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not allowed to delete the
|
|
* requested topic or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested topic has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course or topic exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding topic or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or topic does not exist
|
|
*/
|
|
await gapi.client.classroom.courses.topics.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
name: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or topic, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or topic does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns the list of topics that the requester is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Creates an alias for a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create the
|
|
* alias or for access errors.
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `ALREADY_EXISTS` if the alias already exists.
|
|
* * `FAILED_PRECONDITION` if the alias requested does not make sense for the
|
|
* requesting user or course (for example, if a user not in a domain
|
|
* attempts to access a domain-scoped alias).
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alias: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an alias of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to remove the
|
|
* alias or for access errors.
|
|
* * `NOT_FOUND` if the alias does not exist.
|
|
* * `FAILED_PRECONDITION` if the alias requested does not make sense for the
|
|
* requesting user or course (for example, if a user not in a domain
|
|
* attempts to delete a domain-scoped alias).
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.delete({
|
|
alias: "Test string",
|
|
courseId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of aliases for a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* course or for access errors.
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Modifies assignee mode and options of a coursework.
|
|
*
|
|
* Only a teacher of the course that contains the coursework may
|
|
* call this method.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.modifyAssignees({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
assigneeMode: "Test string",
|
|
modifyIndividualStudentsOptions: {
|
|
addStudentIds: [
|
|
"Test string" ],
|
|
removeStudentIds: [
|
|
"Test string" ],
|
|
},
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a course work.
|
|
*
|
|
* See google.classroom.v1.CourseWork for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `FAILED_PRECONDITION` if the requested course work has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
assignment: {
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
description: "Test string",
|
|
dueDate: {
|
|
day: 42,
|
|
month: 42,
|
|
year: 42,
|
|
},
|
|
dueTime: {
|
|
hours: 42,
|
|
minutes: 42,
|
|
nanos: 42,
|
|
seconds: 42,
|
|
},
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
maxPoints: 42,
|
|
multipleChoiceQuestion: {
|
|
choices: [
|
|
"Test string" ],
|
|
},
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
submissionModificationMode: "Test string",
|
|
title: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
workType: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns course work.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a course work.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the requesting user is not permitted
|
|
* to delete the requested course or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested course work has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of course work that the requester is permitted to view.
|
|
*
|
|
* Course students may only view `PUBLISHED` course work. Course teachers
|
|
* and domain administrators may view all course work.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.list({
|
|
courseId: "Test string",
|
|
courseWorkStates: "Test string",
|
|
orderBy: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates course work.
|
|
*
|
|
* The resulting course work (and corresponding student submissions) are
|
|
* associated with the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* make the request. Classroom API requests to modify course work and student
|
|
* submissions must be made with an OAuth client ID from the associated
|
|
* Developer Console project.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create course work in the requested course, share a
|
|
* Drive attachment, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
* * `FAILED_PRECONDITION` for the following request error:
|
|
* * AttachmentNotVisible
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
assignment: {
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
description: "Test string",
|
|
dueDate: {
|
|
day: 42,
|
|
month: 42,
|
|
year: 42,
|
|
},
|
|
dueTime: {
|
|
hours: 42,
|
|
minutes: 42,
|
|
nanos: 42,
|
|
seconds: 42,
|
|
},
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
maxPoints: 42,
|
|
multipleChoiceQuestion: {
|
|
choices: [
|
|
"Test string" ],
|
|
},
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
submissionModificationMode: "Test string",
|
|
title: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
workType: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* teachers in this course or for access errors.
|
|
* * `NOT_FOUND` if the requested course ID does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled,
|
|
* for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * CourseTeacherLimitReached
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if the user is already a teacher or student in the
|
|
* course.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
profile: {
|
|
emailAddress: "Test string",
|
|
id: "Test string",
|
|
name: {
|
|
familyName: "Test string",
|
|
fullName: "Test string",
|
|
givenName: "Test string",
|
|
},
|
|
permissions: [
|
|
{
|
|
permission: "Test string",
|
|
} ],
|
|
photoUrl: "Test string",
|
|
verifiedTeacher: true,
|
|
},
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete
|
|
* teachers of this course or for access errors.
|
|
* * `NOT_FOUND` if no teacher of this course has the requested ID or if the
|
|
* course does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher
|
|
* of this course.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.delete({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* teachers of this course or for access errors.
|
|
* * `NOT_FOUND` if no teacher of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.get({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of teachers of this course that the requester
|
|
* is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields in a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to modify the
|
|
* requested course or for access errors.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
* * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or
|
|
* if no update mask is supplied.
|
|
* * `FAILED_PRECONDITION` for the following request errors:
|
|
* * CourseNotModifiable
|
|
*/
|
|
await gapi.client.classroom.courses.patch({
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
calendarId: "Test string",
|
|
courseGroupEmail: "Test string",
|
|
courseMaterialSets: [
|
|
{
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
title: "Test string",
|
|
} ],
|
|
courseState: "Test string",
|
|
creationTime: "Test string",
|
|
description: "Test string",
|
|
descriptionHeading: "Test string",
|
|
enrollmentCode: "Test string",
|
|
guardiansEnabled: true,
|
|
id: "Test string",
|
|
name: "Test string",
|
|
ownerId: "Test string",
|
|
room: "Test string",
|
|
section: "Test string",
|
|
teacherFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
teacherGroupEmail: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of announcements that the requester is permitted to view.
|
|
*
|
|
* Course students may only view `PUBLISHED` announcements. Course teachers
|
|
* and domain administrators may view all announcements.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.list({
|
|
announcementStates: "Test string",
|
|
courseId: "Test string",
|
|
orderBy: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Creates an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create announcements in the requested course, share a
|
|
* Drive attachment, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
* * `FAILED_PRECONDITION` for the following request error:
|
|
* * AttachmentNotVisible
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
text: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Modifies assignee mode and options of an announcement.
|
|
*
|
|
* Only a teacher of the course that contains the announcement may
|
|
* call this method.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.modifyAssignees({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
assigneeMode: "Test string",
|
|
modifyIndividualStudentsOptions: {
|
|
addStudentIds: [
|
|
"Test string" ],
|
|
removeStudentIds: [
|
|
"Test string" ],
|
|
},
|
|
});
|
|
/**
|
|
* Updates one or more fields of an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding announcement or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `FAILED_PRECONDITION` if the requested announcement has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if the requested course or announcement does not exist
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
text: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or announcement, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or announcement does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an announcement.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding announcement item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding announcement, if the requesting user is not permitted
|
|
* to delete the requested course or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested announcement has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete
|
|
* students of this course or for access errors.
|
|
* * `NOT_FOUND` if no student of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.students.delete({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* students of this course or for access errors.
|
|
* * `NOT_FOUND` if no student of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.students.get({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of students of this course that the requester
|
|
* is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.courses.students.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Adds a user as a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* students in this course or for access errors.
|
|
* * `NOT_FOUND` if the requested course ID does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled,
|
|
* for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if the user is already a student or teacher in the
|
|
* course.
|
|
*/
|
|
await gapi.client.classroom.courses.students.create({
|
|
courseId: "Test string",
|
|
enrollmentCode: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
profile: {
|
|
emailAddress: "Test string",
|
|
id: "Test string",
|
|
name: {
|
|
familyName: "Test string",
|
|
fullName: "Test string",
|
|
givenName: "Test string",
|
|
},
|
|
permissions: [
|
|
{
|
|
permission: "Test string",
|
|
} ],
|
|
photoUrl: "Test string",
|
|
verifiedTeacher: true,
|
|
},
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create a topic in the requested course,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
name: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not allowed to delete the
|
|
* requested topic or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested topic has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course or topic exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding topic or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or topic does not exist
|
|
*/
|
|
await gapi.client.classroom.courses.topics.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
name: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or topic, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or topic does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns the list of topics that the requester is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Creates an alias for a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create the
|
|
* alias or for access errors.
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `ALREADY_EXISTS` if the alias already exists.
|
|
* * `FAILED_PRECONDITION` if the alias requested does not make sense for the
|
|
* requesting user or course (for example, if a user not in a domain
|
|
* attempts to access a domain-scoped alias).
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alias: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an alias of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to remove the
|
|
* alias or for access errors.
|
|
* * `NOT_FOUND` if the alias does not exist.
|
|
* * `FAILED_PRECONDITION` if the alias requested does not make sense for the
|
|
* requesting user or course (for example, if a user not in a domain
|
|
* attempts to delete a domain-scoped alias).
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.delete({
|
|
alias: "Test string",
|
|
courseId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of aliases for a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* course or for access errors.
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Modifies assignee mode and options of a coursework.
|
|
*
|
|
* Only a teacher of the course that contains the coursework may
|
|
* call this method.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.modifyAssignees({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
assigneeMode: "Test string",
|
|
modifyIndividualStudentsOptions: {
|
|
addStudentIds: [
|
|
"Test string" ],
|
|
removeStudentIds: [
|
|
"Test string" ],
|
|
},
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a course work.
|
|
*
|
|
* See google.classroom.v1.CourseWork for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `FAILED_PRECONDITION` if the requested course work has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
assignment: {
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
description: "Test string",
|
|
dueDate: {
|
|
day: 42,
|
|
month: 42,
|
|
year: 42,
|
|
},
|
|
dueTime: {
|
|
hours: 42,
|
|
minutes: 42,
|
|
nanos: 42,
|
|
seconds: 42,
|
|
},
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
maxPoints: 42,
|
|
multipleChoiceQuestion: {
|
|
choices: [
|
|
"Test string" ],
|
|
},
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
submissionModificationMode: "Test string",
|
|
title: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
workType: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns course work.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a course work.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the requesting user is not permitted
|
|
* to delete the requested course or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested course work has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of course work that the requester is permitted to view.
|
|
*
|
|
* Course students may only view `PUBLISHED` course work. Course teachers
|
|
* and domain administrators may view all course work.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.list({
|
|
courseId: "Test string",
|
|
courseWorkStates: "Test string",
|
|
orderBy: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates course work.
|
|
*
|
|
* The resulting course work (and corresponding student submissions) are
|
|
* associated with the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* make the request. Classroom API requests to modify course work and student
|
|
* submissions must be made with an OAuth client ID from the associated
|
|
* Developer Console project.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create course work in the requested course, share a
|
|
* Drive attachment, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
* * `FAILED_PRECONDITION` for the following request error:
|
|
* * AttachmentNotVisible
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
assignment: {
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
description: "Test string",
|
|
dueDate: {
|
|
day: 42,
|
|
month: 42,
|
|
year: 42,
|
|
},
|
|
dueTime: {
|
|
hours: 42,
|
|
minutes: 42,
|
|
nanos: 42,
|
|
seconds: 42,
|
|
},
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
maxPoints: 42,
|
|
multipleChoiceQuestion: {
|
|
choices: [
|
|
"Test string" ],
|
|
},
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
submissionModificationMode: "Test string",
|
|
title: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
workType: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* teachers in this course or for access errors.
|
|
* * `NOT_FOUND` if the requested course ID does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled,
|
|
* for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * CourseTeacherLimitReached
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if the user is already a teacher or student in the
|
|
* course.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
profile: {
|
|
emailAddress: "Test string",
|
|
id: "Test string",
|
|
name: {
|
|
familyName: "Test string",
|
|
fullName: "Test string",
|
|
givenName: "Test string",
|
|
},
|
|
permissions: [
|
|
{
|
|
permission: "Test string",
|
|
} ],
|
|
photoUrl: "Test string",
|
|
verifiedTeacher: true,
|
|
},
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete
|
|
* teachers of this course or for access errors.
|
|
* * `NOT_FOUND` if no teacher of this course has the requested ID or if the
|
|
* course does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher
|
|
* of this course.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.delete({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* teachers of this course or for access errors.
|
|
* * `NOT_FOUND` if no teacher of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.get({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of teachers of this course that the requester
|
|
* is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Updates a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to modify the
|
|
* requested course or for access errors.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
* * `FAILED_PRECONDITION` for the following request errors:
|
|
* * CourseNotModifiable
|
|
*/
|
|
await gapi.client.classroom.courses.update({
|
|
id: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
calendarId: "Test string",
|
|
courseGroupEmail: "Test string",
|
|
courseMaterialSets: [
|
|
{
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
title: "Test string",
|
|
} ],
|
|
courseState: "Test string",
|
|
creationTime: "Test string",
|
|
description: "Test string",
|
|
descriptionHeading: "Test string",
|
|
enrollmentCode: "Test string",
|
|
guardiansEnabled: true,
|
|
id: "Test string",
|
|
name: "Test string",
|
|
ownerId: "Test string",
|
|
room: "Test string",
|
|
section: "Test string",
|
|
teacherFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
teacherGroupEmail: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of announcements that the requester is permitted to view.
|
|
*
|
|
* Course students may only view `PUBLISHED` announcements. Course teachers
|
|
* and domain administrators may view all announcements.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.list({
|
|
announcementStates: "Test string",
|
|
courseId: "Test string",
|
|
orderBy: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Creates an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create announcements in the requested course, share a
|
|
* Drive attachment, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
* * `FAILED_PRECONDITION` for the following request error:
|
|
* * AttachmentNotVisible
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
text: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Modifies assignee mode and options of an announcement.
|
|
*
|
|
* Only a teacher of the course that contains the announcement may
|
|
* call this method.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.modifyAssignees({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
assigneeMode: "Test string",
|
|
modifyIndividualStudentsOptions: {
|
|
addStudentIds: [
|
|
"Test string" ],
|
|
removeStudentIds: [
|
|
"Test string" ],
|
|
},
|
|
});
|
|
/**
|
|
* Updates one or more fields of an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding announcement or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `FAILED_PRECONDITION` if the requested announcement has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if the requested course or announcement does not exist
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
text: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns an announcement.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or announcement, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or announcement does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an announcement.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding announcement item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding announcement, if the requesting user is not permitted
|
|
* to delete the requested course or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested announcement has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.announcements.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete
|
|
* students of this course or for access errors.
|
|
* * `NOT_FOUND` if no student of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.students.delete({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* students of this course or for access errors.
|
|
* * `NOT_FOUND` if no student of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.students.get({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of students of this course that the requester
|
|
* is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.courses.students.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Adds a user as a student of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* students in this course or for access errors.
|
|
* * `NOT_FOUND` if the requested course ID does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled,
|
|
* for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if the user is already a student or teacher in the
|
|
* course.
|
|
*/
|
|
await gapi.client.classroom.courses.students.create({
|
|
courseId: "Test string",
|
|
enrollmentCode: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
profile: {
|
|
emailAddress: "Test string",
|
|
id: "Test string",
|
|
name: {
|
|
familyName: "Test string",
|
|
fullName: "Test string",
|
|
givenName: "Test string",
|
|
},
|
|
permissions: [
|
|
{
|
|
permission: "Test string",
|
|
} ],
|
|
photoUrl: "Test string",
|
|
verifiedTeacher: true,
|
|
},
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create a topic in the requested course,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
name: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not allowed to delete the
|
|
* requested topic or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested topic has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course or topic exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding topic or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or topic does not exist
|
|
*/
|
|
await gapi.client.classroom.courses.topics.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
name: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
});
|
|
/**
|
|
* Returns a topic.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or topic, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or topic does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns the list of topics that the requester is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.topics.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Creates an alias for a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create the
|
|
* alias or for access errors.
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `ALREADY_EXISTS` if the alias already exists.
|
|
* * `FAILED_PRECONDITION` if the alias requested does not make sense for the
|
|
* requesting user or course (for example, if a user not in a domain
|
|
* attempts to access a domain-scoped alias).
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alias: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an alias of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to remove the
|
|
* alias or for access errors.
|
|
* * `NOT_FOUND` if the alias does not exist.
|
|
* * `FAILED_PRECONDITION` if the alias requested does not make sense for the
|
|
* requesting user or course (for example, if a user not in a domain
|
|
* attempts to delete a domain-scoped alias).
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.delete({
|
|
alias: "Test string",
|
|
courseId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of aliases for a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* course or for access errors.
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.aliases.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Modifies assignee mode and options of a coursework.
|
|
*
|
|
* Only a teacher of the course that contains the coursework may
|
|
* call this method.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.modifyAssignees({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
assigneeMode: "Test string",
|
|
modifyIndividualStudentsOptions: {
|
|
addStudentIds: [
|
|
"Test string" ],
|
|
removeStudentIds: [
|
|
"Test string" ],
|
|
},
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a course work.
|
|
*
|
|
* See google.classroom.v1.CourseWork for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `FAILED_PRECONDITION` if the requested course work has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.patch({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
assignment: {
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
description: "Test string",
|
|
dueDate: {
|
|
day: 42,
|
|
month: 42,
|
|
year: 42,
|
|
},
|
|
dueTime: {
|
|
hours: 42,
|
|
minutes: 42,
|
|
nanos: 42,
|
|
seconds: 42,
|
|
},
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
maxPoints: 42,
|
|
multipleChoiceQuestion: {
|
|
choices: [
|
|
"Test string" ],
|
|
},
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
submissionModificationMode: "Test string",
|
|
title: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
workType: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns course work.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course or course work does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.get({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a course work.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the requesting user is not permitted
|
|
* to delete the requested course or for access errors.
|
|
* * `FAILED_PRECONDITION` if the requested course work has already been
|
|
* deleted.
|
|
* * `NOT_FOUND` if no course exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.delete({
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of course work that the requester is permitted to view.
|
|
*
|
|
* Course students may only view `PUBLISHED` course work. Course teachers
|
|
* and domain administrators may view all course work.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* the requested course or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.list({
|
|
courseId: "Test string",
|
|
courseWorkStates: "Test string",
|
|
orderBy: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates course work.
|
|
*
|
|
* The resulting course work (and corresponding student submissions) are
|
|
* associated with the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* make the request. Classroom API requests to modify course work and student
|
|
* submissions must be made with an OAuth client ID from the associated
|
|
* Developer Console project.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, create course work in the requested course, share a
|
|
* Drive attachment, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
* * `FAILED_PRECONDITION` for the following request error:
|
|
* * AttachmentNotVisible
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assigneeMode: "Test string",
|
|
assignment: {
|
|
studentWorkFolder: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
title: "Test string",
|
|
},
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
creationTime: "Test string",
|
|
creatorUserId: "Test string",
|
|
description: "Test string",
|
|
dueDate: {
|
|
day: 42,
|
|
month: 42,
|
|
year: 42,
|
|
},
|
|
dueTime: {
|
|
hours: 42,
|
|
minutes: 42,
|
|
nanos: 42,
|
|
seconds: 42,
|
|
},
|
|
id: "Test string",
|
|
individualStudentsOptions: {
|
|
studentIds: [
|
|
"Test string" ],
|
|
},
|
|
materials: [
|
|
{
|
|
driveFile: {
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
shareMode: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youtubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
maxPoints: 42,
|
|
multipleChoiceQuestion: {
|
|
choices: [
|
|
"Test string" ],
|
|
},
|
|
scheduledTime: "Test string",
|
|
state: "Test string",
|
|
submissionModificationMode: "Test string",
|
|
title: "Test string",
|
|
topicId: "Test string",
|
|
updateTime: "Test string",
|
|
workType: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course, course work, or student submission or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Updates one or more fields of a student submission.
|
|
*
|
|
* See google.classroom.v1.StudentSubmission for details
|
|
* of which fields may be updated and who may change them.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting developer project did not create
|
|
* the corresponding course work, if the user is not permitted to make the
|
|
* requested modification to the student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
alternateLink: "Test string",
|
|
assignedGrade: 42,
|
|
assignmentSubmission: {
|
|
attachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
},
|
|
associatedWithDeveloper: true,
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
courseWorkType: "Test string",
|
|
creationTime: "Test string",
|
|
draftGrade: 42,
|
|
id: "Test string",
|
|
late: true,
|
|
multipleChoiceSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
shortAnswerSubmission: {
|
|
answer: "Test string",
|
|
},
|
|
state: "Test string",
|
|
submissionHistory: [
|
|
{
|
|
gradeHistory: {
|
|
actorUserId: "Test string",
|
|
gradeChangeType: "Test string",
|
|
gradeTimestamp: "Test string",
|
|
maxPoints: 42,
|
|
pointsEarned: 42,
|
|
},
|
|
stateHistory: {
|
|
actorUserId: "Test string",
|
|
state: "Test string",
|
|
stateTimestamp: "Test string",
|
|
},
|
|
} ],
|
|
updateTime: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a student submission.
|
|
*
|
|
* Returning a student submission transfers ownership of attached Drive
|
|
* files to the student and may also update the submission state.
|
|
* Unlike the Classroom application, returning a student submission does not
|
|
* set assignedGrade to the draftGrade value.
|
|
*
|
|
* Only a teacher of the course that contains the requested student submission
|
|
* may call this method.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, return the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Reclaims a student submission on behalf of the student that owns it.
|
|
*
|
|
* Reclaiming a student submission transfers ownership of attached Drive
|
|
* files to the student and updates the submission state.
|
|
*
|
|
* Only the student that owns the requested student submission may call this
|
|
* method, and only for a student submission that has been turned in.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, unsubmit the requested student submission,
|
|
* or for access errors.
|
|
* * `FAILED_PRECONDITION` if the student submission has not been turned in.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Turns in a student submission.
|
|
*
|
|
* Turning in a student submission transfers ownership of attached Drive
|
|
* files to the teacher and may also update the submission state.
|
|
*
|
|
* This may only be called by the student that owns the specified student
|
|
* submission.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, turn in the requested student submission,
|
|
* or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
});
|
|
/**
|
|
* Modifies attachments of student submission.
|
|
*
|
|
* Attachments may only be added to student submissions belonging to course
|
|
* work objects with a `workType` of `ASSIGNMENT`.
|
|
*
|
|
* This request must be made by the Developer Console project of the
|
|
* [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
|
|
* create the corresponding course work item.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, if the user is not permitted to modify
|
|
* attachments on the requested student submission, or for
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course, course work, or student submission
|
|
* does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
id: "Test string",
|
|
}, {
|
|
addAttachments: [
|
|
{
|
|
driveFile: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
form: {
|
|
formUrl: "Test string",
|
|
responseUrl: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
link: {
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
url: "Test string",
|
|
},
|
|
youTubeVideo: {
|
|
alternateLink: "Test string",
|
|
id: "Test string",
|
|
thumbnailUrl: "Test string",
|
|
title: "Test string",
|
|
},
|
|
} ],
|
|
});
|
|
/**
|
|
* Returns a list of student submissions that the requester is permitted to
|
|
* view, factoring in the OAuth scopes of the request.
|
|
* `-` may be specified as the `course_work_id` to include student
|
|
* submissions for multiple course work items.
|
|
*
|
|
* Course students may only view their own work. Course teachers
|
|
* and domain administrators may view all student submissions.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access the
|
|
* requested course or course work, or for access errors.
|
|
* * `INVALID_ARGUMENT` if the request is malformed.
|
|
* * `NOT_FOUND` if the requested course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
|
|
courseId: "Test string",
|
|
courseWorkId: "Test string",
|
|
late: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* teachers in this course or for access errors.
|
|
* * `NOT_FOUND` if the requested course ID does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled,
|
|
* for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * CourseTeacherLimitReached
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `ALREADY_EXISTS` if the user is already a teacher or student in the
|
|
* course.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.create({
|
|
courseId: "Test string",
|
|
}, {
|
|
courseId: "Test string",
|
|
profile: {
|
|
emailAddress: "Test string",
|
|
id: "Test string",
|
|
name: {
|
|
familyName: "Test string",
|
|
fullName: "Test string",
|
|
givenName: "Test string",
|
|
},
|
|
permissions: [
|
|
{
|
|
permission: "Test string",
|
|
} ],
|
|
photoUrl: "Test string",
|
|
verifiedTeacher: true,
|
|
},
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete
|
|
* teachers of this course or for access errors.
|
|
* * `NOT_FOUND` if no teacher of this course has the requested ID or if the
|
|
* course does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher
|
|
* of this course.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.delete({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a teacher of a course.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* teachers of this course or for access errors.
|
|
* * `NOT_FOUND` if no teacher of this course has the requested ID or if the
|
|
* course does not exist.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.get({
|
|
courseId: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of teachers of this course that the requester
|
|
* is permitted to view.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `NOT_FOUND` if the course does not exist.
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.courses.teachers.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
});
|
|
/**
|
|
* Accepts an invitation, removing it and adding the invited user to the
|
|
* teachers or students (as appropriate) of the specified course. Only the
|
|
* invited user may accept an invitation.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to accept the
|
|
* requested invitation or for access errors.
|
|
* * `FAILED_PRECONDITION` for the following request errors:
|
|
* * CourseMemberLimitReached
|
|
* * CourseNotModifiable
|
|
* * CourseTeacherLimitReached
|
|
* * UserGroupsMembershipLimitReached
|
|
* * `NOT_FOUND` if no invitation exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.invitations.accept({
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Creates an invitation. Only one invitation for a user and course may exist
|
|
* at a time. Delete and re-create an invitation to make changes.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to create
|
|
* invitations for this course or for access errors.
|
|
* * `NOT_FOUND` if the course or the user does not exist.
|
|
* * `FAILED_PRECONDITION` if the requested user's account is disabled or if
|
|
* the user already has this role or a role with greater permissions.
|
|
* * `ALREADY_EXISTS` if an invitation for the specified user and course
|
|
* already exists.
|
|
*/
|
|
await gapi.client.classroom.invitations.create({
|
|
}, {
|
|
courseId: "Test string",
|
|
id: "Test string",
|
|
role: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes an invitation.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to delete the
|
|
* requested invitation or for access errors.
|
|
* * `NOT_FOUND` if no invitation exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.invitations.delete({
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns an invitation.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view the
|
|
* requested invitation or for access errors.
|
|
* * `NOT_FOUND` if no invitation exists with the requested ID.
|
|
*/
|
|
await gapi.client.classroom.invitations.get({
|
|
id: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of invitations that the requesting user is permitted to
|
|
* view, restricted to those that match the list request.
|
|
*
|
|
* *Note:* At least one of `user_id` or `course_id` must be supplied. Both
|
|
* fields can be supplied.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` for access errors.
|
|
*/
|
|
await gapi.client.classroom.invitations.list({
|
|
courseId: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a `Registration`, causing Classroom to start sending notifications
|
|
* from the provided `feed` to the destination provided in `cloudPubSubTopic`.
|
|
*
|
|
* Returns the created `Registration`. Currently, this will be the same as
|
|
* the argument, but with server-assigned fields such as `expiry_time` and
|
|
* `id` filled in.
|
|
*
|
|
* Note that any value specified for the `expiry_time` or `id` fields will be
|
|
* ignored.
|
|
*
|
|
* While Classroom may validate the `cloudPubSubTopic` and return errors on a
|
|
* best effort basis, it is the caller's responsibility to ensure that it
|
|
* exists and that Classroom has permission to publish to it.
|
|
*
|
|
* This method may return the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if:
|
|
* * the authenticated user does not have permission to receive
|
|
* notifications from the requested field; or
|
|
* * the credential provided does not include the appropriate scope for
|
|
* the requested feed.
|
|
* * another access error is encountered.
|
|
* * `INVALID_ARGUMENT` if:
|
|
* * no `cloudPubsubTopic` is specified, or the specified
|
|
* `cloudPubsubTopic` is not valid; or
|
|
* * no `feed` is specified, or the specified `feed` is not valid.
|
|
* * `NOT_FOUND` if:
|
|
* * the specified `feed` cannot be located, or the requesting user does
|
|
* not have permission to determine whether or not it exists; or
|
|
* * the specified `cloudPubsubTopic` cannot be located, or Classroom has
|
|
* not been granted permission to publish to it.
|
|
*/
|
|
await gapi.client.classroom.registrations.create({
|
|
}, {
|
|
cloudPubsubTopic: {
|
|
topicName: "Test string",
|
|
},
|
|
expiryTime: "Test string",
|
|
feed: {
|
|
courseRosterChangesInfo: {
|
|
courseId: "Test string",
|
|
},
|
|
courseWorkChangesInfo: {
|
|
courseId: "Test string",
|
|
},
|
|
feedType: "Test string",
|
|
},
|
|
registrationId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a `Registration`, causing Classroom to stop sending notifications
|
|
* for that `Registration`.
|
|
*/
|
|
await gapi.client.classroom.registrations.delete({
|
|
registrationId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a user profile.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to access
|
|
* this user profile, if no profile exists with the requested ID, or for
|
|
* access errors.
|
|
*/
|
|
await gapi.client.classroom.userProfiles.get({
|
|
userId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of guardian invitations that the requesting user is
|
|
* permitted to view, filtered by the parameters provided.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting
|
|
* user is not permitted to view guardian invitations for that student, if
|
|
* `"-"` is specified as the `student_id` and the user is not a domain
|
|
* administrator, if guardians are not enabled for the domain in question,
|
|
* or for other access errors.
|
|
* * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
|
|
* be recognized (it is not an email address, nor a `student_id` from the
|
|
* API, nor the literal string `me`). May also be returned if an invalid
|
|
* `page_token` or `state` is provided.
|
|
* * `NOT_FOUND` if a `student_id` is specified, and its format can be
|
|
* recognized, but Classroom has no record of that student.
|
|
*/
|
|
await gapi.client.classroom.userProfiles.guardianInvitations.list({
|
|
invitedEmailAddress: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
states: "Test string",
|
|
studentId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a specific guardian invitation.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the requesting user is not permitted to view
|
|
* guardian invitations for the student identified by the `student_id`, if
|
|
* guardians are not enabled for the domain in question, or for other
|
|
* access errors.
|
|
* * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
|
|
* be recognized (it is not an email address, nor a `student_id` from the
|
|
* API, nor the literal string `me`).
|
|
* * `NOT_FOUND` if Classroom cannot find any record of the given student or
|
|
* `invitation_id`. May also be returned if the student exists, but the
|
|
* requesting user does not have access to see that student.
|
|
*/
|
|
await gapi.client.classroom.userProfiles.guardianInvitations.get({
|
|
invitationId: "Test string",
|
|
studentId: "Test string",
|
|
});
|
|
/**
|
|
* Modifies a guardian invitation.
|
|
*
|
|
* Currently, the only valid modification is to change the `state` from
|
|
* `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the current user does not have permission to
|
|
* manage guardians, if guardians are not enabled for the domain in question
|
|
* or for other access errors.
|
|
* * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state.
|
|
* * `INVALID_ARGUMENT` if the format of the student ID provided
|
|
* cannot be recognized (it is not an email address, nor a `user_id` from
|
|
* this API), or if the passed `GuardianInvitation` has a `state` other than
|
|
* `COMPLETE`, or if it modifies fields other than `state`.
|
|
* * `NOT_FOUND` if the student ID provided is a valid student ID, but
|
|
* Classroom has no record of that student, or if the `id` field does not
|
|
* refer to a guardian invitation known to Classroom.
|
|
*/
|
|
await gapi.client.classroom.userProfiles.guardianInvitations.patch({
|
|
invitationId: "Test string",
|
|
studentId: "Test string",
|
|
updateMask: "Test string",
|
|
}, {
|
|
creationTime: "Test string",
|
|
invitationId: "Test string",
|
|
invitedEmailAddress: "Test string",
|
|
state: "Test string",
|
|
studentId: "Test string",
|
|
});
|
|
/**
|
|
* Creates a guardian invitation, and sends an email to the guardian asking
|
|
* them to confirm that they are the student's guardian.
|
|
*
|
|
* Once the guardian accepts the invitation, their `state` will change to
|
|
* `COMPLETED` and they will start receiving guardian notifications. A
|
|
* `Guardian` resource will also be created to represent the active guardian.
|
|
*
|
|
* The request object must have the `student_id` and
|
|
* `invited_email_address` fields set. Failing to set these fields, or
|
|
* setting any other fields in the request, will result in an error.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if the current user does not have permission to
|
|
* manage guardians, if the guardian in question has already rejected
|
|
* too many requests for that student, if guardians are not enabled for the
|
|
* domain in question, or for other access errors.
|
|
* * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian
|
|
* link limit.
|
|
* * `INVALID_ARGUMENT` if the guardian email address is not valid (for
|
|
* example, if it is too long), or if the format of the student ID provided
|
|
* cannot be recognized (it is not an email address, nor a `user_id` from
|
|
* this API). This error will also be returned if read-only fields are set,
|
|
* or if the `state` field is set to to a value other than `PENDING`.
|
|
* * `NOT_FOUND` if the student ID provided is a valid student ID, but
|
|
* Classroom has no record of that student.
|
|
* * `ALREADY_EXISTS` if there is already a pending guardian invitation for
|
|
* the student and `invited_email_address` provided, or if the provided
|
|
* `invited_email_address` matches the Google account of an existing
|
|
* `Guardian` for this user.
|
|
*/
|
|
await gapi.client.classroom.userProfiles.guardianInvitations.create({
|
|
studentId: "Test string",
|
|
}, {
|
|
creationTime: "Test string",
|
|
invitationId: "Test string",
|
|
invitedEmailAddress: "Test string",
|
|
state: "Test string",
|
|
studentId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a list of guardians that the requesting user is permitted to
|
|
* view, restricted to those that match the request.
|
|
*
|
|
* To list guardians for any student that the requesting user may view
|
|
* guardians for, use the literal character `-` for the student ID.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting
|
|
* user is not permitted to view guardian information for that student, if
|
|
* `"-"` is specified as the `student_id` and the user is not a domain
|
|
* administrator, if guardians are not enabled for the domain in question,
|
|
* if the `invited_email_address` filter is set by a user who is not a
|
|
* domain administrator, or for other access errors.
|
|
* * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
|
|
* be recognized (it is not an email address, nor a `student_id` from the
|
|
* API, nor the literal string `me`). May also be returned if an invalid
|
|
* `page_token` is provided.
|
|
* * `NOT_FOUND` if a `student_id` is specified, and its format can be
|
|
* recognized, but Classroom has no record of that student.
|
|
*/
|
|
await gapi.client.classroom.userProfiles.guardians.list({
|
|
invitedEmailAddress: "Test string",
|
|
pageSize: 42,
|
|
pageToken: "Test string",
|
|
studentId: "Test string",
|
|
});
|
|
/**
|
|
* Returns a specific guardian.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if no user that matches the provided `student_id`
|
|
* is visible to the requesting user, if the requesting user is not
|
|
* permitted to view guardian information for the student identified by the
|
|
* `student_id`, if guardians are not enabled for the domain in question,
|
|
* or for other access errors.
|
|
* * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
|
|
* be recognized (it is not an email address, nor a `student_id` from the
|
|
* API, nor the literal string `me`).
|
|
* * `NOT_FOUND` if the requesting user is permitted to view guardians for
|
|
* the requested `student_id`, but no `Guardian` record exists for that
|
|
* student that matches the provided `guardian_id`.
|
|
*/
|
|
await gapi.client.classroom.userProfiles.guardians.get({
|
|
guardianId: "Test string",
|
|
studentId: "Test string",
|
|
});
|
|
/**
|
|
* Deletes a guardian.
|
|
*
|
|
* The guardian will no longer receive guardian notifications and the guardian
|
|
* will no longer be accessible via the API.
|
|
*
|
|
* This method returns the following error codes:
|
|
*
|
|
* * `PERMISSION_DENIED` if no user that matches the provided `student_id`
|
|
* is visible to the requesting user, if the requesting user is not
|
|
* permitted to manage guardians for the student identified by the
|
|
* `student_id`, if guardians are not enabled for the domain in question,
|
|
* or for other access errors.
|
|
* * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
|
|
* be recognized (it is not an email address, nor a `student_id` from the
|
|
* API).
|
|
* * `NOT_FOUND` if the requesting user is permitted to modify guardians for
|
|
* the requested `student_id`, but no `Guardian` record exists for that
|
|
* student with the provided `guardian_id`.
|
|
*/
|
|
await gapi.client.classroom.userProfiles.guardians.delete({
|
|
guardianId: "Test string",
|
|
studentId: "Test string",
|
|
});
|
|
}
|
|
});
|