Pushing individualized documents to users for access from Moodle Dashboard

Moodle does not have a way for teachers to automatically push individual documents to Moodle users. A good example is class reports: If a student stays in a school for 12 years needs to be able to access their class performance reports year by year, there is no existing provision. The closest is to push document links in the feedback of an Assignment activity. This however is course (year) based and when new students enroll  and old students are un-enrolled each year, the data is gone! If the students don’t access the report in allocated time and save it in some repository of their own they will keep requesting school administration for their old reports.

I have implemented one scheme to accomplish this – it consists of 2 parts:

  1. A Google Apps Script (GAS) that takes appropriately named Google documents located in a particular sub-folder of Google Drive, and based on the name of the file, extract the Moodle user ID, and push this document file to that user using Moodle REST API. The data is stored as a JSON encoded string in a dedicated user profile field created specially for this purpose but not visible or accessible to the user from their profile directly. The file naming convention is: username_idnumber. The file type is assumed to be PDF. The GAS is associated with a spreadsheet that needs to be in the concerned project folder. The spreadsheet serves to set some constants including required for proper operation of the script and also to serve as space for log notifications after the App executes.
  2. A custom Moodle block that can be installed by any user on their dashboard which then reads this data and displays links to the users Google Docs.

The GAS can be quite sophisticated. For example, in our implementation, the GAS can pull data from documents and merge into report documents. These are then converted to PDF with changed permissions so as to be able to view by anyone in our domain who has the link. The links are then pushed to Moodle users’ profile. We handle payments, fees due, marks reports, etc., using this approach.

Posted in customization, Google Apps Script, moodle.