Moodle Plugins directory: Lock Grades: Versions: 1.6 (Build 2025070800) | Moodle.org

Lock Grades
Lock Grades 1.6 (Build 2025070800)
Release Notes — Lock Grades (local_lockgrades
)
Overview
Lock Grades is a Moodle plugin that enables administrators to recursively lock or unlock a grade category (including all its subcategories and items) using the idnumber
field as an identifier. The plugin also allows filtering by course shortname and offers advanced scheduling and management features.
New in This Release
- Action Scheduling: Schedule locking or unlocking for a specific date and time. Actions are executed automatically by Moodle’s cron.
- Dry-run Preview: Preview the list of courses that would be affected before applying or scheduling an action.
- Advanced Task Management: View, edit, duplicate, or delete scheduled actions in a unified table before execution.
- Ancestral Lock Inheritance: New grade items or categories automatically inherit the locked status if any ancestor category is locked.
- Unified Action History: All actions (immediate or scheduled) are shown in a single sortable, filterable table with expandable details.
- Enhanced Security: Access restricted to users with the
local/lockgrades:manage
capability.
Key Features
- Recursive Lock/Unlock: Automatically updates the
locked
status of all child grade items and subcategories, using database transactions for data integrity. - Course Filtering: Optionally limit actions to courses whose shortname contains a specific substring.
- Unlock Constraints: A subcategory cannot be unlocked if any of its ancestor categories remains locked.
- Simple Interface: Admin form for entering the category
idnumber
, optional course filter, selecting the date/time, and choosing the action (lock, unlock, schedule, preview). - Detailed Logging: All actions (executed or scheduled) are recorded, with status, filters, dates, and affected items visible.
- Transactional Integrity: All changes use database transactions to guarantee consistency.
Requirements
- Moodle 4.2 or higher
- SSH or FTP access to copy files to the server
- Administrator rights on the Moodle platform
Installation
Copy the files: Place the
lockgrades
folder inside thelocal/
directory of your Moodle installation.Check permissions: Ensure the files and folders are readable by the web server user (usually
www-data
).Database update: Log in as a Moodle administrator. Moodle will detect the new plugin and prompt you to update the database.
Verification: Go to Site administration > Plugins > Local plugins to check that
Lock Grades
appears in the list.
Usage
- Log in with a user account that has the
local/lockgrades:manage
capability. - Go to
/local/lockgrades/index.php
on your Moodle site. - Enter the category ID number of the grade item to (un)lock (e.g.,
totPeriode_1
). - Optionally, enter a course shortname filter (leave blank to affect all courses).
- Use the Preview button to see which courses would be affected before proceeding.
- To lock or unlock immediately, click Lock grades or Unlock grades.
- To schedule a lock or unlock, select the desired date and time, then click Schedule Lock or Schedule Unlock. Actions will be executed by Moodle’s cron.
- Review and manage all scheduled actions at the bottom of the page. You can edit, duplicate, or delete any pending task before execution.
- After each action, a confirmation and an informational message will be displayed.
Customization
- Adjust capabilities:
To restrict access to other roles, modify the capability requirement in the plugin code and adjust
access.php
. - Edit messages:
Modify language strings in
lang/en/local_lockgrades.php
orlang/fr/local_lockgrades.php
. - Default behavior:
The course filter is optional. If left blank, actions affect all courses containing the matching
idnumber
.
License
This plugin is distributed under the GNU GPL v3 license. See the LICENSE
file for details.
Author and Support
- Author: Miguël Dhyne
- Contact: miguel.dhyne@gmail.com
For questions or contributions, please open an issue or submit a pull request on the project’s GitHub repository.
Version information
- Version build number
- 2025070800
- Version release name
- 1.6 (Build 2025070800)
- Maturity
- Stable version
- MD5 Sum
- 007b375ccf472b1f63b6397a988cbe6a
- Supported software
- Moodle 4.2, Moodle 4.4, Moodle 4.5, Moodle 5.0
- Latest release for Moodle 4.2
- Latest release for Moodle 4.4
- Latest release for Moodle 4.5
- Latest release for Moodle 5.0
Version control information
- Version control system (VCS)
- Other...
- VCS repository URL
Default installation instructions for plugins of the type Local plugins
- Make sure you have all the required versions.
- Download and unpack the module.
- Place the folder in the "local" subdirectory.
- Visit http://yoursite.com/admin to finish the installation.