A simple script to grab the future assignments and due dates to put them on to Google calendar for WeBWorK. Sometimes the administrator would like to know when the assignments will due and how many students in the class. So that the administrator can prepare the server for the high load. There might be some other use cases. Please let me know if you find it useful.
This script will create an event on the Google calendar and using student count, course name, assignment name as event summary and due date as the event start/end date. The summary looks like:
STUDENT_COUNT-COURSE_NAME-ASSIGNMENT_NAME
If the event is already on the calendar, the script will try to update it if the due date or student count is different.
Follow the instruction on Google API site to create a service account and download the json key file. Place the file in the same directory as updateCalendar.php.
Create a new calendar or use existing one
Grant your service account read/write access to your Google calendar
Make a copy of config.ini.sample to config.ini
Change the values inside config.ini
Update your php.ini to add timezone so that it matches your timezone settings on the database server
Load the MySQL Procedure
mysql -u USERNAME -p DATABASE_NAME < assignmentDueProcedure.sql
Run
php updateCalendar.php
Optionally, create a cron job for automatic update.
docker run --rm -v service-account.json:/app/service-account.json -e CALENDAR=xxx -e DB_HOST=xxx -e DB_PORT=3306 -e DB_USER=webwork -e DB_PASSWORD=xxx -e DB_NAME=webwork webworkcal
Content type
Image
Digest
sha256:447f92a12…
Size
61.4 MB
Last updated
5 days ago
docker pull lthub/webworkcal