A CLI to use Google Classroom API.
Fetches courses, students, assignments and student-submitted URLs from Google Classroom.
I want to use Google Classroom to manage my classes (students and assignments). I'd like to fetch URLs (containing Github repositories) submitted by the students for each assignments to automatically retrieve their projet.
That's why this projet only uses Google Classroom read-only API permissions and just some ressources of the API useful for myself are available.
Make sure Composer is installed globally.
$ composer global require cba85/google-classroom-cli
Then make sure you have the global Composer binaries directory in your PATH.
This directory is platform-dependent, see Composer documentation for details.
$ composer global update cba85/google-classroom-cli
- Create an app and web client auth on Google Developer Console
- Download the
credentials.json
file and move it to theauth/
folder of the application.
If you use the application as a global command, move the
credentials.json
file to~/.composer/vendor/cba85/google-classroom-cli/auth/
folder.
- First time you launch the application, you'll have to grant access of your Google application using Google OAuth2 server to retrieve an access token. Then, enter the verification code into the CLI prompt. Your access token will be saved in
auth/token.json
file.
$ gclass list-courses
$ gclass list-students courseId
$ gclass list-assignments courseId
$ gclass list-submissions courseId assignmentId
$ gclass list-submitted-urls courseId assignmentId
list-submitted-urls
command will list all the urls submitted by the students if the "course work" type is "assignment". If the "course work" type is a "short answer question", it will retrieve the answer and expect it to be an url.