Skip to content

Commit

Permalink
Added support for stand-alone course materials; these were not previo…
Browse files Browse the repository at this point in the history
…usly supported by the Google Classroom API.
  • Loading branch information
taers232c committed Mar 25, 2021
1 parent 8e59daa commit 8dcf936
Show file tree
Hide file tree
Showing 6 changed files with 330 additions and 53 deletions.
82 changes: 61 additions & 21 deletions src/GamCommands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ If an item contains spaces, it should be surrounded by ".
<CourseAnnouncementID> ::= <Number>
<CourseAnnouncementState> ::= draft|published|deleted
<CourseID> ::= <Number>|d:<CourseAlias>
<CourseMaterialID> ::= <Number>
<CourseMaterialState> ::= draft|published|deleted
<CourseParticipantType> ::= teacher|teachers|student|students
<CourseState> ::= active|archived|provisioned|declined|suspended
<CourseSubmissionID> ::= <Number>
Expand Down Expand Up @@ -499,6 +501,8 @@ If an item contains spaces, it should be surrounded by ".
<CourseAnnouncementIDList> ::= "<CourseAnnouncementID>(,<CourseAnnouncementID>)*"
<CourseAnnouncementStateList> ::= all|"<CourseAnnouncementState>(,<CourseAnnouncementState>)*"
<CourseIDList> ::= "<CourseID>(,<CourseID>)*"
<CourseMaterialIDList> ::= "<CourseMaterialID>(,<CourseMaterialID>)*"
<CourseMaterialStateList> ::= all|"<CourseMaterialState>(,<CourseMaterialState>)*"
<CourseStateList> ::= all|"<CourseState>(,<CourseState>)*"
<CourseSubmissionIDList> ::= "<CourseSubmissionID>(,<CourseSubmissionID>)*"
<CourseSubmissionStateList> ::= all|"<CourseSubmissionState>(,<CourseSubmissionState>)*"
Expand Down Expand Up @@ -717,6 +721,7 @@ Specify a collection of items by directly specifying them; the item type is dete
<CourseTopicIDEntity> ::= <CourseTopicIDList> | <FileSelector> | <CSVFileSelector> | <CSVkmdSelector> | <CSVSubkeySelector> | <CSVDataSelector>
<CourseTopicEntity> ::= <CourseTopicList> | <FileSelector> | <CSVFileSelector> | <CSVkmdSelector> | <CSVDataSelector>
<CourseWorkIDEntity> ::= <CourseWorkIDList> | <FileSelector> | <CSVFileSelector> | <CSVkmdSelector> | <CSVSubkeySelector> | <CSVDataSelector>
<CourseMaterialIDEntity> ::= <CourseMaterialIDList> | <FileSelector> | <CSVFileSelector> | <CSVkmdSelector> | <CSVSubkeySelector> | <CSVDataSelector>
<CrOSEntity> ::=
<CrOSIDList> | (cros_sn <SerialNumberList>) |
(query:<QueryCrOS>)|(query:orgunitpath:<OrgUnitPath>)|(query <QueryCrOS>)
Expand Down Expand Up @@ -1831,6 +1836,9 @@ gam <UserTypeEntity> show contactdelegates [shownames] [csv]
<CourseWorkState> ::= draft|published|deleted
<CourseWorkStateList> ::= "<CourseWorkState>(,<CourseWorkState>)*"

<CourseMaterialState> ::= draft|published|deleted
<CourseMaterialStateList> ::= "<CourseMaterialState>(,<CourseMaterialState>)*"

<CourseAttribute> ::=
(description <String>)|
(heading <String>)|
Expand Down Expand Up @@ -1868,6 +1876,7 @@ gam <UserTypeEntity> show contactdelegates [shownames] [csv]
gam create|add course [id|alias <CourseAlias>] <CourseAttribute>*
[copyfrom <CourseID>
[announcementstates <CourseAnnouncementStateList>]
[materialstates <CourseMaterialStateList>]
[workstates <CourseWorkStateList>]
[markpublishedasdraft [<Boolean>]] [removeduedate [<Boolean>]]
[mapsharemodestudentcopy edit|none|view]
Expand All @@ -1878,6 +1887,7 @@ gam create|add course [id|alias <CourseAlias>] <CourseAttribute>*
gam update course <CourseID> <CourseAttribute>+
[copyfrom <CourseID>
[announcementstates <CourseAnnouncementStateList>]
[materialstates <CourseMaterialStateList>]
[workstates <CourseWorkStateList>]
[markpublishedasdraft [<Boolean>]] [removeduedate [<Boolean>]]
[mapsharemodestudentcopy edit|none|view]
Expand All @@ -1890,6 +1900,7 @@ gam delete course <CourseID> [archive|archived]
gam update courses <CourseEntity> <CourseAttribute>+
[copyfrom <CourseID>
[announcementstates <CourseAnnouncementStateList>]
[materialstates <CourseMaterialStateList>]
[workstates <CourseWorkStateList>]
[markpublishedasdraft [<Boolean>]] [removeduedate [<Boolean>]]
[mapsharemodestudentcopy edit|none|view]
Expand Down Expand Up @@ -1959,31 +1970,25 @@ gam print course-participants [todrive <ToDriveAttribute>*]
updatetime|
updatedate

<CourseWorkFieldName> ::=
<CourseMaterialFieldName> ::=
alternatelink|
assigneemode|
courseid|
courseworkid|
courseworktype|
courseworkmaterialid|
creationtime|
creator|creatoruserid|
description|
duedate|
duetime|
id|
materials|
maxpoints|
scheduledtime|
state|
submissionmodificationmode|
title|
topicid|
updatetime|
worktype
<CourseWorkFieldNameList> ::= "<CourseWorkFieldName>(,<CourseWorkFieldName>)*"
workmaterialid
<CourseMaterialFieldNameList> ::= "<CourseMaterialFieldName>(,<CourseMaterialFieldName>)*"

<CourseWorkOrderByFieldName> ::=
duedate|
<CourseMaterialOrderByFieldName> ::=
updatetime|
updatedate

Expand All @@ -2004,22 +2009,46 @@ gam print course-participants [todrive <ToDriveAttribute>*]
worktype
<CourseSubmissionFieldNameList> ::= "<CourseSubmissionFieldName>(,<CourseSubmissionFieldName>)*"

<CourseWorkFieldName> ::=
alternatelink|
assigneemode|
courseid|
courseworkid|
courseworktype|
creationtime|
creator|creatoruserid|
description|
duedate|
duetime|
id|
materials|
maxpoints|
scheduledtime|
state|
submissionmodificationmode|
title|
topicid|
updatetime|
workid|
worktype
<CourseWorkFieldNameList> ::= "<CourseWorkFieldName>(,<CourseWorkFieldName>)*"

<CourseWorkOrderByFieldName> ::=
duedate|
updatetime|
updatedate

gam print course-announcements [todrive <ToDriveAttribute>*]
(course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] states <CourseStateList>])
(announcementids <CourseAnnouncementIDEntity>)|((announcementstates <CourseAnnouncementStateList>)*
(orderby <CourseAnnouncementOrderByFieldName> [ascending|descending])*)
[showcreatoremails] [fields <CourseAnnouncementFieldNameList>] [formatjson [quotechar <Character>]]
[showcreatoremails|creatoremail] [fields <CourseAnnouncementFieldNameList>] [formatjson [quotechar <Character>]]
[timefilter creationtime|updatetime|scheduledtime] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
gam print course-topics [todrive <ToDriveAttribute>*]
(course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] states <CourseStateList>])
[topicids <CourseTopicIDEntity>]
[formatjson [quotechar <Character>]]
[timefilter updatetime] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
gam print course-work [todrive <ToDriveAttribute>*]
gam print course-materials [todrive <ToDriveAttribute>*]
(course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] states <CourseStateList>])
(workids <CourseWorkIDEntity>)|((workstates <CourseWorkStateList>)*
(orderby <CourseWorkOrderByFieldName> [ascending|descending])*)
[showcreatoremails] [showtopicnames] [fields <CourseWorkFieldNameList>] [formatjson [quotechar <Character>]]
(materialids <CourseMaterialIDEntity>)|((materialstates <CourseMaterialStateList>)*
(orderby <CourseMaterialOrderByFieldName> [ascending|descending])*)
[showcreatoremails|creatoremail] [showtopicnames] [fields <CourseMaterialFieldNameList>] [formatjson [quotechar <Character>]]
[timefilter creationtime|updatetime|scheduledtime] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
gam print course-submissions [todrive <ToDriveAttribute>*]
(course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] states <CourseStateList>])
Expand All @@ -2028,6 +2057,17 @@ gam print course-submissions [todrive <ToDriveAttribute>*]
(submissionids <CourseSubmissionIDEntity>)|((submissionstates <CourseSubmissionStateList>)*) [late|notlate]
[fields <CourseSubmissionFieldNameList>] [formatjson [quotechar <Character>]] [showuserprofile]
[timefilter creationtime|updatetime] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
gam print course-topics [todrive <ToDriveAttribute>*]
(course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] states <CourseStateList>])
[topicids <CourseTopicIDEntity>]
[formatjson [quotechar <Character>]]
[timefilter updatetime] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
gam print course-works [todrive <ToDriveAttribute>*]
(course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] states <CourseStateList>])
(workids <CourseWorkIDEntity>)|((workstates <CourseWorkStateList>)*
(orderby <CourseWorkOrderByFieldName> [ascending|descending])*)
[showcreatoremails|creatoremail] [showtopicnames] [fields <CourseWorkFieldNameList>] [formatjson [quotechar <Character>]]
[timefilter creationtime|updatetime|scheduledtime] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]

# Classroom - Invitations

Expand Down
12 changes: 12 additions & 0 deletions src/GamUpdate.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
6.00.02

Added support for stand-alone course materials; these were not previously supported by the Google Classroom API.
* See: https://github.com/taers232c/GAMADV-XTD3/wiki/Classroom-Courses#display-course-materials
* See: https://github.com/taers232c/GAMADV-XTD3/wiki/Classroom-Courses#create-and-update-courses

To use the course materials features you must authorize the appropriate scope: `'Classroom API - Course Work/Materials'`.
```
gam oauth create
gam user user@domain.com check|update serviceaccount
```

6.00.01

Improve error handling in `gam delete|update chromepolicy` and `gam show chromepolicies`.
Expand Down
Loading

0 comments on commit 8dcf936

Please sign in to comment.