Is there a way one can schedule assignments using classroom API?
2 Answers
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
-
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.– user4639281Mar 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
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.
-
2This is correct, and works, although you also need to ensure that CourseWork
state
is set asDRAFT
(it isPUBLISHED
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– frederjSep 13, 2019 at 18:36
scheduledTime
property and make sure to set thestate
property toDRAFT
developers.google.com/classroom/reference/rest/v1/…