Moodle Plugins directory: Lock Grades: Versions: 1.0 (Build 2025-05-31) | Moodle.org
Lock Grades
Lock Grades 1.0 (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, andlocktimefields in themdl_grade_itemstable. - Recursive unlocking: Unlocks the same items by resetting
lockedandlocktimeto 0 while preserving the modification timestamp (timemodified). - Simple interface: A form is available in the Moodle administration to enter the
idnumberand choose the action (lock or unlock). - Security: Access is restricted to users with the
moodle/site:configcapability (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
lockgradesfolder 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/lockgradesDatabase update
Log in as an administrator on your Moodle site. Moodle will automatically detect the new plugin and prompt you to update the database.
Verification
Go to Site administration > Plugins > Local plugins and check that
Lock Gradesappears in the list.
Usage
Log in with an administrator account (with
moodle/site:configcapability).In your browser, open the URL:
https://your-moodle-site.local/local/lockgrades/index.phpEnter 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
- 2025053100
- Version release name
- 1.0 (Build 2025-05-31)
- Maturity
- الإصدار المستقر
- MD5 Sum
- 263c6d14a6601662cd1831969036a7f9
- Supported software
- Moodle 4.2, Moodle 4.4, Moodle 4.5, Moodle 5.0
- The more recent release 1.7 (Build 2025070800) (2025102301) exists for Moodle 4.2
- The more recent release 1.7 (Build 2025070800) (2025102301) exists for Moodle 4.4
- The more recent release 1.7 (Build 2025070800) (2025102301) exists for Moodle 4.5
- The more recent release 1.7 (Build 2025070800) (2025102301) exists for Moodle 5.0
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.