In this chapter, we investigated how courses can be enhanced by custom plugins. We developed a course format plugin that revealed sections depending on your GPS location. We also developed a block that displays a QR Code on a course. Finally, we developed a text filter plugin to manipulate on-screen text.
By deconstructing the GPS Format plugin, which displays resources and activities dependant on your location, we learned how to incorporate JavaScript into our plugins, and how to wrap JavaScript in YUI code (YUI is the JavaScript library currently supported by Moodle, although Moodle is transitioning away from YUI to jQuery--see https://docs.moodle.org/dev/YUI).
Courses can be enhanced with the inclusion of blocks, and also in this chapter we learned how to construct a QR Code block, using the third-party QR Code image library employed by the QL Links plugin. By doing so, we learned how to handle files using Moodle's File API--we created files in Moodle's \temp
directory, importing...