Create
|
|||||
|
|
Creates course work.
The resulting course work (and corresponding student submissions) are associated with the Developer Console project of the OAuth client ID 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
Authorization
To use this building block you will have to grant access to at least one of the following scopes:
- 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
Input
This building block consumes 57 input parameters
Name | Format | Description |
---|---|---|
courseId Required |
STRING |
Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias |
materials[] |
OBJECT |
Material attached to course work. When creating attachments, setting the |
materials[].form |
OBJECT |
Google Forms item |
materials[].form.responseUrl |
STRING |
URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form. Read-only |
materials[].form.formUrl |
STRING |
URL of the form |
materials[].form.title |
STRING |
Title of the Form. Read-only |
materials[].form.thumbnailUrl |
STRING |
URL of a thumbnail image of the Form. Read-only |
materials[].link |
OBJECT |
URL item |
materials[].link.title |
STRING |
Title of the target of the URL. Read-only |
materials[].link.thumbnailUrl |
STRING |
URL of a thumbnail image of the target URL. Read-only |
materials[].link.url |
STRING |
URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters |
materials[].youtubeVideo |
OBJECT |
YouTube video item |
materials[].youtubeVideo.thumbnailUrl |
STRING |
URL of a thumbnail image of the YouTube video. Read-only |
materials[].youtubeVideo.id |
STRING |
YouTube API resource ID |
materials[].youtubeVideo.title |
STRING |
Title of the YouTube video. Read-only |
materials[].youtubeVideo.alternateLink |
STRING |
URL that can be used to view the YouTube video. Read-only |
materials[].driveFile |
OBJECT |
Drive file that is used as material for course work |
materials[].driveFile.driveFile |
OBJECT |
Representation of a Google Drive file |
materials[].driveFile.driveFile.alternateLink |
STRING |
URL that can be used to access the Drive item. Read-only |
materials[].driveFile.driveFile.thumbnailUrl |
STRING |
URL of a thumbnail image of the Drive item. Read-only |
materials[].driveFile.driveFile.id |
STRING |
Drive API resource ID |
materials[].driveFile.driveFile.title |
STRING |
Title of the Drive item. Read-only |
materials[].driveFile.shareMode |
ENUMERATION |
Mechanism by which students access the Drive item |
associatedWithDeveloper |
BOOLEAN |
Whether this course work item is associated with the Developer Console project making the request. See google.classroom.Work.CreateCourseWork for more details. Read-only |
updateTime |
ANY |
Timestamp of the most recent change to this course work. Read-only |
alternateLink |
STRING |
Absolute link to this course work in the Classroom web UI.
This is only populated if Read-only |
assigneeMode |
ENUMERATION |
Assignee mode of the coursework.
If unspecified, the default value is |
maxPoints |
NUMBER |
Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be a non-negative integer value |
multipleChoiceQuestion |
OBJECT |
Additional details for multiple-choice questions |
multipleChoiceQuestion.choices[] |
STRING |
|
assignment |
OBJECT |
Additional details for assignments |
assignment.studentWorkFolder |
OBJECT |
Representation of a Google Drive folder |
assignment.studentWorkFolder.title |
STRING |
Title of the Drive folder. Read-only |
assignment.studentWorkFolder.alternateLink |
STRING |
URL that can be used to access the Drive folder. Read-only |
assignment.studentWorkFolder.id |
STRING |
Drive API resource ID |
workType |
ENUMERATION |
Type of this course work. The type is set when the course work is created and cannot be changed |
scheduledTime |
ANY |
Optional timestamp when this course work is scheduled to be published |
description |
STRING |
Optional description of this course work. If set, the description must be a valid UTF-8 string containing no more than 30,000 characters |
creationTime |
ANY |
Timestamp when this course work was created. Read-only |
dueDate |
OBJECT |
Represents a whole or partial calendar date, e.g. a birthday. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the Proleptic Gregorian Calendar. This can represent:
Related types are google.type.TimeOfDay and |
dueDate.year |
INTEGER |
Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year |
dueDate.day |
INTEGER |
Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year and month where the day is not significant |
dueDate.month |
INTEGER |
Month of year. Must be from 1 to 12, or 0 if specifying a year without a month and day |
individualStudentsOptions |
OBJECT |
Assignee details about a coursework/announcement.
This field is set if and only if |
individualStudentsOptions.studentIds[] |
STRING |
|
creatorUserId |
STRING |
Identifier for the user that created the coursework. Read-only |
state |
ENUMERATION |
Status of this course work.
If unspecified, the default state is |
submissionModificationMode |
ENUMERATION |
Setting to determine when students are allowed to modify submissions.
If unspecified, the default value is |
courseId |
STRING |
Identifier of the course. Read-only |
id |
STRING |
Classroom-assigned identifier of this course work, unique per course. Read-only |
dueTime |
OBJECT |
Represents a time of day. The date and time zone are either not significant
or are specified elsewhere. An API may choose to allow leap seconds. Related
types are google.type.Date and |
dueTime.minutes |
INTEGER |
Minutes of hour of day. Must be from 0 to 59 |
dueTime.hours |
INTEGER |
Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time |
dueTime.nanos |
INTEGER |
Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999 |
dueTime.seconds |
INTEGER |
Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds |
title |
STRING |
Title of this course work. The title must be a valid UTF-8 string containing between 1 and 3000 characters |
topicId |
STRING |
Identifier for the topic that this coursework is associated with. Must match an existing topic in the course |
= Parameter name
= Format
courseId STRING Required Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias |
materials[] OBJECT Material attached to course work. When creating attachments, setting the |
materials[].form OBJECT Google Forms item |
materials[].form.responseUrl STRING URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form. Read-only |
materials[].form.formUrl STRING URL of the form |
materials[].form.title STRING Title of the Form. Read-only |
materials[].form.thumbnailUrl STRING URL of a thumbnail image of the Form. Read-only |
materials[].link OBJECT URL item |
materials[].link.title STRING Title of the target of the URL. Read-only |
materials[].link.thumbnailUrl STRING URL of a thumbnail image of the target URL. Read-only |
materials[].link.url STRING URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters |
materials[].youtubeVideo OBJECT YouTube video item |
materials[].youtubeVideo.thumbnailUrl STRING URL of a thumbnail image of the YouTube video. Read-only |
materials[].youtubeVideo.id STRING YouTube API resource ID |
materials[].youtubeVideo.title STRING Title of the YouTube video. Read-only |
materials[].youtubeVideo.alternateLink STRING URL that can be used to view the YouTube video. Read-only |
materials[].driveFile OBJECT Drive file that is used as material for course work |
materials[].driveFile.driveFile OBJECT Representation of a Google Drive file |
materials[].driveFile.driveFile.alternateLink STRING URL that can be used to access the Drive item. Read-only |
materials[].driveFile.driveFile.thumbnailUrl STRING URL of a thumbnail image of the Drive item. Read-only |
materials[].driveFile.driveFile.id STRING Drive API resource ID |
materials[].driveFile.driveFile.title STRING Title of the Drive item. Read-only |
materials[].driveFile.shareMode ENUMERATION Mechanism by which students access the Drive item |
associatedWithDeveloper BOOLEAN Whether this course work item is associated with the Developer Console project making the request. See google.classroom.Work.CreateCourseWork for more details. Read-only |
updateTime ANY Timestamp of the most recent change to this course work. Read-only |
alternateLink STRING Absolute link to this course work in the Classroom web UI.
This is only populated if Read-only |
assigneeMode ENUMERATION Assignee mode of the coursework.
If unspecified, the default value is |
maxPoints NUMBER Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be a non-negative integer value |
multipleChoiceQuestion OBJECT Additional details for multiple-choice questions |
multipleChoiceQuestion.choices[] STRING |
assignment OBJECT Additional details for assignments |
assignment.studentWorkFolder OBJECT Representation of a Google Drive folder |
assignment.studentWorkFolder.title STRING Title of the Drive folder. Read-only |
assignment.studentWorkFolder.alternateLink STRING URL that can be used to access the Drive folder. Read-only |
assignment.studentWorkFolder.id STRING Drive API resource ID |
workType ENUMERATION Type of this course work. The type is set when the course work is created and cannot be changed |
scheduledTime ANY Optional timestamp when this course work is scheduled to be published |
description STRING Optional description of this course work. If set, the description must be a valid UTF-8 string containing no more than 30,000 characters |
creationTime ANY Timestamp when this course work was created. Read-only |
dueDate OBJECT Represents a whole or partial calendar date, e.g. a birthday. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the Proleptic Gregorian Calendar. This can represent:
Related types are google.type.TimeOfDay and |
dueDate.year INTEGER Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year |
dueDate.day INTEGER Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year and month where the day is not significant |
dueDate.month INTEGER Month of year. Must be from 1 to 12, or 0 if specifying a year without a month and day |
individualStudentsOptions OBJECT Assignee details about a coursework/announcement.
This field is set if and only if |
individualStudentsOptions.studentIds[] STRING |
creatorUserId STRING Identifier for the user that created the coursework. Read-only |
state ENUMERATION Status of this course work.
If unspecified, the default state is |
submissionModificationMode ENUMERATION Setting to determine when students are allowed to modify submissions.
If unspecified, the default value is |
courseId STRING Identifier of the course. Read-only |
id STRING Classroom-assigned identifier of this course work, unique per course. Read-only |
dueTime OBJECT Represents a time of day. The date and time zone are either not significant
or are specified elsewhere. An API may choose to allow leap seconds. Related
types are google.type.Date and |
dueTime.minutes INTEGER Minutes of hour of day. Must be from 0 to 59 |
dueTime.hours INTEGER Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time |
dueTime.nanos INTEGER Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999 |
dueTime.seconds INTEGER Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds |
title STRING Title of this course work. The title must be a valid UTF-8 string containing between 1 and 3000 characters |
topicId STRING Identifier for the topic that this coursework is associated with. Must match an existing topic in the course |
Output
This building block provides 56 output parameters
Name | Format | Description |
---|---|---|
materials[] |
OBJECT |
Material attached to course work. When creating attachments, setting the |
materials[].form |
OBJECT |
Google Forms item |
materials[].form.responseUrl |
STRING |
URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form. Read-only |
materials[].form.formUrl |
STRING |
URL of the form |
materials[].form.title |
STRING |
Title of the Form. Read-only |
materials[].form.thumbnailUrl |
STRING |
URL of a thumbnail image of the Form. Read-only |
materials[].link |
OBJECT |
URL item |
materials[].link.title |
STRING |
Title of the target of the URL. Read-only |
materials[].link.thumbnailUrl |
STRING |
URL of a thumbnail image of the target URL. Read-only |
materials[].link.url |
STRING |
URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters |
materials[].youtubeVideo |
OBJECT |
YouTube video item |
materials[].youtubeVideo.thumbnailUrl |
STRING |
URL of a thumbnail image of the YouTube video. Read-only |
materials[].youtubeVideo.id |
STRING |
YouTube API resource ID |
materials[].youtubeVideo.title |
STRING |
Title of the YouTube video. Read-only |
materials[].youtubeVideo.alternateLink |
STRING |
URL that can be used to view the YouTube video. Read-only |
materials[].driveFile |
OBJECT |
Drive file that is used as material for course work |
materials[].driveFile.driveFile |
OBJECT |
Representation of a Google Drive file |
materials[].driveFile.driveFile.alternateLink |
STRING |
URL that can be used to access the Drive item. Read-only |
materials[].driveFile.driveFile.thumbnailUrl |
STRING |
URL of a thumbnail image of the Drive item. Read-only |
materials[].driveFile.driveFile.id |
STRING |
Drive API resource ID |
materials[].driveFile.driveFile.title |
STRING |
Title of the Drive item. Read-only |
materials[].driveFile.shareMode |
ENUMERATION |
Mechanism by which students access the Drive item |
associatedWithDeveloper |
BOOLEAN |
Whether this course work item is associated with the Developer Console project making the request. See google.classroom.Work.CreateCourseWork for more details. Read-only |
updateTime |
ANY |
Timestamp of the most recent change to this course work. Read-only |
alternateLink |
STRING |
Absolute link to this course work in the Classroom web UI.
This is only populated if Read-only |
assigneeMode |
ENUMERATION |
Assignee mode of the coursework.
If unspecified, the default value is |
maxPoints |
NUMBER |
Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be a non-negative integer value |
multipleChoiceQuestion |
OBJECT |
Additional details for multiple-choice questions |
multipleChoiceQuestion.choices[] |
STRING |
|
assignment |
OBJECT |
Additional details for assignments |
assignment.studentWorkFolder |
OBJECT |
Representation of a Google Drive folder |
assignment.studentWorkFolder.title |
STRING |
Title of the Drive folder. Read-only |
assignment.studentWorkFolder.alternateLink |
STRING |
URL that can be used to access the Drive folder. Read-only |
assignment.studentWorkFolder.id |
STRING |
Drive API resource ID |
workType |
ENUMERATION |
Type of this course work. The type is set when the course work is created and cannot be changed |
scheduledTime |
ANY |
Optional timestamp when this course work is scheduled to be published |
description |
STRING |
Optional description of this course work. If set, the description must be a valid UTF-8 string containing no more than 30,000 characters |
creationTime |
ANY |
Timestamp when this course work was created. Read-only |
dueDate |
OBJECT |
Represents a whole or partial calendar date, e.g. a birthday. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the Proleptic Gregorian Calendar. This can represent:
Related types are google.type.TimeOfDay and |
dueDate.year |
INTEGER |
Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year |
dueDate.day |
INTEGER |
Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year and month where the day is not significant |
dueDate.month |
INTEGER |
Month of year. Must be from 1 to 12, or 0 if specifying a year without a month and day |
individualStudentsOptions |
OBJECT |
Assignee details about a coursework/announcement.
This field is set if and only if |
individualStudentsOptions.studentIds[] |
STRING |
|
creatorUserId |
STRING |
Identifier for the user that created the coursework. Read-only |
state |
ENUMERATION |
Status of this course work.
If unspecified, the default state is |
submissionModificationMode |
ENUMERATION |
Setting to determine when students are allowed to modify submissions.
If unspecified, the default value is |
courseId |
STRING |
Identifier of the course. Read-only |
id |
STRING |
Classroom-assigned identifier of this course work, unique per course. Read-only |
dueTime |
OBJECT |
Represents a time of day. The date and time zone are either not significant
or are specified elsewhere. An API may choose to allow leap seconds. Related
types are google.type.Date and |
dueTime.minutes |
INTEGER |
Minutes of hour of day. Must be from 0 to 59 |
dueTime.hours |
INTEGER |
Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time |
dueTime.nanos |
INTEGER |
Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999 |
dueTime.seconds |
INTEGER |
Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds |
title |
STRING |
Title of this course work. The title must be a valid UTF-8 string containing between 1 and 3000 characters |
topicId |
STRING |
Identifier for the topic that this coursework is associated with. Must match an existing topic in the course |
= Parameter name
= Format
materials[] OBJECT Material attached to course work. When creating attachments, setting the |
materials[].form OBJECT Google Forms item |
materials[].form.responseUrl STRING URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form. Read-only |
materials[].form.formUrl STRING URL of the form |
materials[].form.title STRING Title of the Form. Read-only |
materials[].form.thumbnailUrl STRING URL of a thumbnail image of the Form. Read-only |
materials[].link OBJECT URL item |
materials[].link.title STRING Title of the target of the URL. Read-only |
materials[].link.thumbnailUrl STRING URL of a thumbnail image of the target URL. Read-only |
materials[].link.url STRING URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters |
materials[].youtubeVideo OBJECT YouTube video item |
materials[].youtubeVideo.thumbnailUrl STRING URL of a thumbnail image of the YouTube video. Read-only |
materials[].youtubeVideo.id STRING YouTube API resource ID |
materials[].youtubeVideo.title STRING Title of the YouTube video. Read-only |
materials[].youtubeVideo.alternateLink STRING URL that can be used to view the YouTube video. Read-only |
materials[].driveFile OBJECT Drive file that is used as material for course work |
materials[].driveFile.driveFile OBJECT Representation of a Google Drive file |
materials[].driveFile.driveFile.alternateLink STRING URL that can be used to access the Drive item. Read-only |
materials[].driveFile.driveFile.thumbnailUrl STRING URL of a thumbnail image of the Drive item. Read-only |
materials[].driveFile.driveFile.id STRING Drive API resource ID |
materials[].driveFile.driveFile.title STRING Title of the Drive item. Read-only |
materials[].driveFile.shareMode ENUMERATION Mechanism by which students access the Drive item |
associatedWithDeveloper BOOLEAN Whether this course work item is associated with the Developer Console project making the request. See google.classroom.Work.CreateCourseWork for more details. Read-only |
updateTime ANY Timestamp of the most recent change to this course work. Read-only |
alternateLink STRING Absolute link to this course work in the Classroom web UI.
This is only populated if Read-only |
assigneeMode ENUMERATION Assignee mode of the coursework.
If unspecified, the default value is |
maxPoints NUMBER Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be a non-negative integer value |
multipleChoiceQuestion OBJECT Additional details for multiple-choice questions |
multipleChoiceQuestion.choices[] STRING |
assignment OBJECT Additional details for assignments |
assignment.studentWorkFolder OBJECT Representation of a Google Drive folder |
assignment.studentWorkFolder.title STRING Title of the Drive folder. Read-only |
assignment.studentWorkFolder.alternateLink STRING URL that can be used to access the Drive folder. Read-only |
assignment.studentWorkFolder.id STRING Drive API resource ID |
workType ENUMERATION Type of this course work. The type is set when the course work is created and cannot be changed |
scheduledTime ANY Optional timestamp when this course work is scheduled to be published |
description STRING Optional description of this course work. If set, the description must be a valid UTF-8 string containing no more than 30,000 characters |
creationTime ANY Timestamp when this course work was created. Read-only |
dueDate OBJECT Represents a whole or partial calendar date, e.g. a birthday. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the Proleptic Gregorian Calendar. This can represent:
Related types are google.type.TimeOfDay and |
dueDate.year INTEGER Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year |
dueDate.day INTEGER Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year and month where the day is not significant |
dueDate.month INTEGER Month of year. Must be from 1 to 12, or 0 if specifying a year without a month and day |
individualStudentsOptions OBJECT Assignee details about a coursework/announcement.
This field is set if and only if |
individualStudentsOptions.studentIds[] STRING |
creatorUserId STRING Identifier for the user that created the coursework. Read-only |
state ENUMERATION Status of this course work.
If unspecified, the default state is |
submissionModificationMode ENUMERATION Setting to determine when students are allowed to modify submissions.
If unspecified, the default value is |
courseId STRING Identifier of the course. Read-only |
id STRING Classroom-assigned identifier of this course work, unique per course. Read-only |
dueTime OBJECT Represents a time of day. The date and time zone are either not significant
or are specified elsewhere. An API may choose to allow leap seconds. Related
types are google.type.Date and |
dueTime.minutes INTEGER Minutes of hour of day. Must be from 0 to 59 |
dueTime.hours INTEGER Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time |
dueTime.nanos INTEGER Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999 |
dueTime.seconds INTEGER Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds |
title STRING Title of this course work. The title must be a valid UTF-8 string containing between 1 and 3000 characters |
topicId STRING Identifier for the topic that this coursework is associated with. Must match an existing topic in the course |