Moodle Plugin Template is an opinionated framework designed for developers looking to create Moodle plugins efficiently. It comes packed with necessary features like a structured setup, build system, localization support, and automated code checks, ensuring that you can focus on building great functionality without getting lost in setup complexities.
The Moodle Local Plugin Template provides an impactful starting point for developers looking to create dynamic and user-friendly Moodle plugins. This repository serves as a well-structured foundation, emphasizing best practices to streamline your plugin development process.
Key Features
- đź“ť Comprehensive guidelines and templates for installing plugins
- 🔧 Integrated build system and CI/CD setup using GitHub Actions for effective deployment.
- 🌍 Localization support, ensuring that all strings are easily translatable.
- âś… Built-in automated code style checks, maintaining quality standards throughout development.
- 🚀 Optional functionalities including unit tests, Behat tests, static analysis, logging, and backup support.
Included within this repository is a functional example of a Moodle plugin showcasing:
- Database Initialization and Upgrade: Scripts designed for setting up and upgrading your plugin seamlessly.
- Dashboard Context Block: (Pending Implementation) A block that will display dynamic content on student dashboards.
- Course Content Block: (Pending Implementation) A block to exhibit enriched content on course pages.
- Activity Block: (Pending Implementation) A specialized block for displaying content on activity pages.
- Admin Settings Page: An intuitive interface to configure the plugin’s settings using Moodle’s standard administration approach.
- Scheduled Task: (Pending Implementation) Automate background processing functionalities.
- Custom JavaScript Support: (Pending Implementation) Create a unique user interface using advanced JavaScript techniques.
- Example Unit Test: Ensures that your plugin performs as expected using the Catalyst CI system.
Best Practices and Resources
To ensure high-quality plugins, adhere to these recommended practices:
- JavaScript Compilation: Utilize the Moodle Node.js Guide.
- AMD Compilation: Review practical examples in progressive plugins like the H5P Plugin and Attendance Plugin.
- Continuous Integration Setup: Refer to the Moodle CI Guide for best practices.
- General Plugin Examples: Such as the Attendance Plugin.
Creating Your Own Plugin
- Fork the Repository: Rename it in accordance with Moodle’s conventions:
moodle-<type>_<pluginname>
(e.g.,moodle-local_example
). - Revise the README: Customize the content to describe your own plugin's features and functionalities.
- Publish and Release: Prepare your repository for release as version 1.0.0, ensuring all necessary adjustments are made.
High Five Plugin Example
As an illustrative case, the High Five plugin enables students to "high five" each other, fostering engagement and building community.
Key Features of High Five Plugin
- 🎉 Interactive Page: Access the High Five feature at
/local/high_five/
. - ⚙️ Settings Page: Easily configure the plugin to enable or disable the High Five feature via the Moodle administration settings.
Quick Start
Quickly set up a Moodle environment to test your plugin by following these steps:
- Install a Docker system to facilitate a smooth deployment process.
- Prepare your Moodle testing directory and install the latest Moodle version using provided commands.
- Clone this plugin repository into your Moodle playground and enable it for use.
This template is not just a starting point; it embodies a modular design approach that encourages experimentation and enhancement. Create your own features or modify existing ones to align with your educational innovations.