1

Is there a way one can schedule assignments using classroom API?

2
  • It looks like it is not possible to schedule a publishing date for an assignment with the google classroom API as of yet. You could write something that would use the API to change the assignment status to published based on a schedule, but the scheduling part would have to be custom.
    – user4639281
    Mar 25, 2017 at 19:58
  • It is now possible! Use the scheduledTime property and make sure to set the state property to DRAFT developers.google.com/classroom/reference/rest/v1/…
    – frederj
    Sep 13, 2019 at 18:38

2 Answers 2

1

As of now you can't set the schedule of when the assignment should be published through the API. There are a couple of open issues on apps-api-issues 4730 and 5262 stating this problem. You can star that issue and will be notified as soon as any changes occur. One work around might be is to set the state attribute to DRAFT until needing to change the state to PUBLISHED.

POST https://classroom.googleapis.com/v1/courses/{courseId}/courseWork

{
  "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)
  },
  "maxPoints": number,
  "workType": enum(CourseWorkType),
  "associatedWithDeveloper": boolean,
  "submissionModificationMode": enum(SubmissionModificationMode),

  // 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 
2
  • I think they are looking for a way to schedule when an assignment is published, not necessarily the due date, but I could be wrong.
    – user4639281
    Mar 25, 2017 at 19:59
  • Hey @Tiny Giant, I just updated my answer. As of now I don't think it is possible to set the schedule of when the assignment should be published through Google Calssroom API Mar 25, 2017 at 20:23
1

Update as of 21 June 2017, the API has been updated to allow the setting of a scheduled time (https://developers.google.com/classroom/reference/rest/v1/courses.courseWork) using the scheduledTime field of the CourseWork.

This issue has now been marked as Fixed.

1
  • 2
    This is correct, and works, although you also need to ensure that CourseWork state is set as DRAFT (it is PUBLISHED by default) or the request will be rejected. The state appears to auto update for the CourseWork when the scheduledTime has elapsed without further action required from the user
    – frederj
    Sep 13, 2019 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.