Code review: local plugin to sync course tasks to google calendar

Code review: local plugin to sync course tasks to google calendar

by Raz tamim -
Number of replies: 2

So a few students asked me if there is a way to sync to a course so when a new assignment is added, it will be added to the google calendar of the students. I looked around and didn't find anything so I decided to make my own. I develop in Moodle for about 9 months now but this is the first plugin I wrote on my own from scratch so I will be really happy to get it reviewed and get notes on what can be improved.

here is the repo: https://github.com/raztam/Task-Porter

For routing, I’m using a custom redirect_manager that centralizes access control and navigation logic. This allows me to apply Google authentication consistently across all plugin routes without duplicating code.

When an assignment is created, a core event observer captures it and triggers a custom push-to-calendar mechanism. Instead of processing everything immediately (which could impact performance), the observer schedules an adhoc task. This task runs asynchronously and handles pushing the assignment to subscribed users’ Google Calendars using the configured API credentials.

Average of ratings: -
In reply to Raz tamim

Code review: local plugin to sync course tasks to google calendar

by Brett Dalton -
Picture of Moodle HQ Picture of Particularly helpful Moodlers
Have you considered submitting it to the plugins directory? There is documentation on how here along with the checklist of things that it needs to comply with

https://moodledev.io/general/community/plugincontribution
In reply to Brett Dalton

Code review: local plugin to sync course tasks to google calendar

by Raz tamim -
Yes but it will require to request an approve of the app through google for each Moodle separately. To use the calendar API in your app google have to approve it and it goes by the url.