
Learn to build a Moodle plugin with PHP, including the staff manager, minimum files, installation, security, templates, data tables, and exporting grades to CSV or PDF.
Set up Moodle for development by enabling theme designer mode, turning on developer debug messages, and disabling JavaScript and AJAX caches to ensure real-time changes show during plugin development.
Explore what Moodle plugins are, where they go, and how to start by using the local plugin type to learn core components and common tasks.
Create a Moodle local plugin named staff manager by adding a version.php file, defining plugin version, moodle requirement, and plugin maturity as stable.
Create the language file for a local Moodle plugin by building lang/en/staff_manager.php, enabling dynamic front-end text via strings and preparing for PDF table headings.
Create the index.php file for a Moodle plugin, load configuration, require login, set the page title via language strings, and render the header and footer.
Install and upgrade the local staff manager plugin for Moodle, then run the database upgrade. Test by visiting local/staffmanager to see the page load with the staff manager heading.
Create Moodle plugins using PHP by building mustache templates in templates folder, starting with a search bar and search results, rendering templates with data objects, and integrating Bootstrap input groups.
Learn to add JavaScript to a Moodle plugin page, load core components with require, and implement a search button using month and year URL parameters to refresh and preserve selections.
Extract month and year from the Moodle URL, package them into an object, and send to the template renderer to display the month name, e.g., December 2019.
Access the Moodle database with the DB API and SQL to locate grades and graders, then fetch grader details and prepare a results object for the Mustache template.
Learn how to create a Moodle database table with the XMLDB editor, defining local staff manager rates (month, year, assignment rate, quiz rate) and triggering install via uninstall and reinstall.
Learn to build a Moodle plugin page to view, add, and edit rates with a rates table, a rates form, and a Mustache template for display.
Create a Moodle PHP plugin page grader details to show a grader's monthly itemized grades, with a mustache template, linking from search results and handling month, year, and grader id.
Add date graded, month name, and year in part 2 of the Moodle grader details page, compute rates for assignments and quizzes to total, and format the output.
Create a Moodle PHP plugin to calculate staff grade totals using year and month rates. Retrieve grade items, distinguish assignments and quizzes, compute grade values, and display results.
Extend Moodle exports to csv, pdf, and excel by adding a download data format selector and a download.php page. Include year, month, and grading data with language headers.
Learn to secure a Moodle plugin in PHP by adding an access.php with a capabilities array, map it to the local staff manager admin role, and test page access.
Learn to validate data in SQL scripts and ensure security while exploring Moodle plugin functions. Download and modify the plugin code, and consult Moodle docs for secure development.
This course will take you through the complete process of developing your first Moodle plugin.
It is highly recommended that you have PHP, HTML, JavaScript and CSS experience before attempting to create a plugin in Moodle but it is not essential that you have worked in Moodle before.
This course will teach you the basic structure and requirements of a plugin, then take you through the actual process of:
creating the plugin
adding the core files
managing versions
adding templates
adding JavaScript
a new database table for your plugin
create, read and update data using forms
provide data to templates
access the Moodle database
Export data to CSV and PDF
Secure your pages
By the end of this course you will be ready to answer that question.
"Can Moodle do THIS?"
And you will be able to answer...
"Sure, let me write a plugin that will do it."
The plugin process is recorded using Moodle 3.9 but the code can be used in Moodle 3.7.2+
This course does get deep into coding but I am sure you will enjoy it and learn so much that will save you searching for days on the internet to find the solution to creating your own first plugin.
I will see you in the course.
Chris Richter