REST Resource: courses.courseWork

Resource: CourseWork

Course work created by a teacher for students of the course.

JSON representation
{
  "courseId": string,
  "id": string,
  "title": string,
  "description": string,
  "materials": [
    {
      object(Material)
    }
  ],
  "state": enum(CourseWorkState),
  "alternateLink": string,
  "creationTime": string,
  "updateTime": string,
  "dueDate": {
    object(Date)
  },
  "dueTime": {
    object(TimeOfDay)
  },
  "scheduledTime": string,
  "maxPoints": number,
  "workType": enum(CourseWorkType),
  "associatedWithDeveloper": boolean,
  "assigneeMode": enum(AssigneeMode),
  "individualStudentsOptions": {
    object(IndividualStudentsOptions)
  },
  "submissionModificationMode": enum(SubmissionModificationMode),
  "creatorUserId": string,

  // Union field details can be only one of the following:
  "assignment": {
    object(Assignment)
  },
  "multipleChoiceQuestion": {
    object(MultipleChoiceQuestion)
  },
  // End of list of possible types for union field details.
}
Fields
courseId

string

Identifier of the course.

Read-only.

id

string

Classroom-assigned identifier of this course work, unique per course.

Read-only.

title

string

Title of this course work. The title must be a valid UTF-8 string containing between 1 and 3000 characters.

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.

materials[]

object(Material)

Additional materials.

CourseWork must have no more than 20 material items.

state

enum(CourseWorkState)

Status of this course work. If unspecified, the default state is DRAFT.

creationTime

string (Timestamp format)

Timestamp when this course work was created.

Read-only.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Timestamp of the most recent change to this course work.

Read-only.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

dueDate

object(Date)

Optional date, in UTC, that submissions for this this course work are due. This must be specified if dueTime is specified.

dueTime

object(TimeOfDay)

Optional time of day, in UTC, that submissions for this this course work are due. This must be specified if dueDate is specified.

scheduledTime

string (Timestamp format)

Optional timestamp when this course work is scheduled to be published.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

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.

workType

enum(CourseWorkType)

Type of this course work.

The type is set when the course work is created and cannot be changed.

associatedWithDeveloper

boolean

Whether this course work item is associated with the Developer Console project making the request.

See [google.classroom.Work.CreateCourseWork][courseWork.create] for more details.

Read-only.

assigneeMode

enum(AssigneeMode)

Assignee mode of the coursework. If unspecified, the default value is ALL_STUDENTS.

individualStudentsOptions

object(IndividualStudentsOptions)

Identifiers of students with access to the coursework. This field is set only if assigneeMode is INDIVIDUAL_STUDENTS. If the assigneeMode is INDIVIDUAL_STUDENTS, then only students specified in this field will be assigned the coursework.

submissionModificationMode

enum(SubmissionModificationMode)

Setting to determine when students are allowed to modify submissions. If unspecified, the default value is MODIFIABLE_UNTIL_TURNED_IN.

creatorUserId

string

Identifier for the user that created the coursework.

Read-only.

Union field details. Additional details that are specific to a type of course work. details can be only one of the following:
assignment

object(Assignment)

Assignment details. This is populated only when workType is ASSIGNMENT.

Read-only.

multipleChoiceQuestion

object(MultipleChoiceQuestion)

Multiple choice question details. For read operations, this field is populated only when workType is MULTIPLE_CHOICE_QUESTION. For write operations, this field must be specified when creating course work with a workType of MULTIPLE_CHOICE_QUESTION, and it must not be set otherwise.

CourseWorkState

Possible states of course work.

Enums
COURSE_WORK_STATE_UNSPECIFIED No state specified. This is never returned.
PUBLISHED Status for work that has been published. This is the default state.
DRAFT Status for work that is not yet published. Work in this state is visible only to course teachers and domain administrators.
DELETED Status for work that was published but is now deleted. Work in this state is visible only to course teachers and domain administrators. Work in this state is deleted after some time.

Date

Represents a whole calendar date, e.g. date of birth. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a year and month where the day is not significant, e.g. credit card expiration date. The year may be 0 to represent a month and day independent of year, e.g. anniversary date. Related types are google.type.TimeOfDay and google.protobuf.Timestamp.

JSON representation
{
  "year": number,
  "month": number,
  "day": number,
}
Fields
year

number

Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year.

month

number

Month of year. Must be from 1 to 12.

day

number

Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year/month where the day is not significant.

TimeOfDay

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 google.protobuf.Timestamp.

JSON representation
{
  "hours": number,
  "minutes": number,
  "seconds": number,
  "nanos": number,
}
Fields
hours

number

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.

minutes

number

Minutes of hour of day. Must be from 0 to 59.

seconds

number

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.

nanos

number

Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

SubmissionModificationMode

Possible modification modes for student submissions.

Enums
SUBMISSION_MODIFICATION_MODE_UNSPECIFIED No modification mode specified. This is never returned.
MODIFIABLE_UNTIL_TURNED_IN Submisisons can be modified before being turned in.
MODIFIABLE Submisisons can be modified at any time.

Assignment

Additional details for assignments.

JSON representation
{
  "studentWorkFolder": {
    object(DriveFolder)
  },
}
Fields
studentWorkFolder

object(DriveFolder)

Drive folder where attachments from student submissions are placed. This is only populated for course teachers and administrators.

MultipleChoiceQuestion

Additional details for multiple-choice questions.

JSON representation
{
  "choices": [
    string
  ],
}
Fields
choices[]

string

Possible choices.

Methods

create

Creates course work.

delete

Deletes a course work.

get

Returns course work.

list

Returns a list of course work that the requester is permitted to view.

modifyAssignees

Modifies assignee mode and options of a coursework.

patch

Updates one or more fields of a course work.

Send feedback about...

Classroom API
Classroom API