Moodle Plugins directory: Lock Grades: Versions: 1.1 (Build 2025-05-31) | Moodle.org

Lock Grades
Lock Grades 1.1 (Build 2025-05-31)
Lock Grades (local_lockgrades
)
Description
local_lockgrades
is a Moodle plugin that allows administrators to recursively lock or unlock a grade category (grade items) along with all its subcategories and associated items, using an idnumber
field as the identifier.
Features
- Recursive locking: Locks a parent category and all its subcategories, updating the
locked
,timemodified
, andlocktime
fields in themdl_grade_items
table. - Recursive unlocking: Unlocks the same items by resetting
locked
andlocktime
to 0 while preserving the modification timestamp (timemodified
). - Simple interface: A form is available in the Moodle administration to enter the
idnumber
and choose the action (lock or unlock). - Security: Access is restricted to users with the
moodle/site:config
capability (administrators). - Data integrity: Uses transactions to ensure consistent updates.
Requirements
- Moodle 3.5 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, so the full path is:moodle/local/lockgrades/
Check permissions
Make sure files and directories have appropriate permissions (readable by the web server):
chown -R www-data:www-data moodle/local/lockgrades chmod -R 755 moodle/local/lockgrades
Database update
Log in as an administrator on your Moodle site. Moodle will automatically detect the new plugin and prompt you to update the database.
Usage
Log in with an administrator account (with
moodle/site:config
capability).In your browser, open the URL:
https://your-moodle-site.local/local/lockgrades/index.php
Enter the idnumber of the main category whose grades you want to lock or unlock (e.g.,
totPeriode_1
).Click on Lock grades or Unlock grades.
A notification will confirm the success of the operation.
Customization
- Adjust capabilities: To restrict access to other roles, modify the capability used in
index.php
(moodle/site:config
). - Edit messages: Modify the language strings in
lang/en/local_lockgrades.php
.
License
This plugin is distributed under the GNU GPL v3 license. See the LICENSE
file for details.
Authors and support
- Author name: Miguël Dhyne
- Contact: miguel.dhyne@gmail.com
For any questions or contributions, please open an issue or submit a pull request on the project’s GitHub repository.
Version information
- Version build number
- 2025061001
- Version release name
- 1.1 (Build 2025-05-31)
- Maturity
- Version stable
- MD5 Sum
- 35b96d24d25c16f4d02c5f05753fcb7d
- Supported software
- Moodle 4.2, Moodle 4.3, Moodle 4.4, Moodle 4.5, Moodle 5.0
- Latest release for Moodle 4.2
- Latest release for Moodle 4.3
- 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.