Lock Grades

Local plugins ::: local_lockgrades
Maintained by Miguël Dhyne
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.

Lock Grades 1.1 (Build 2025-05-31)

Moodle 4.2, 4.3, 4.4, 4.5, 5.0
Released: %A 06/10/2025DHH10HHDD %B %Y, %H:%M

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, and locktime fields in the mdl_grade_items table.
  • Recursive unlocking: Unlocks the same items by resetting locked and locktime 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

  1. Copy the files

    Place the lockgrades folder inside the local/ directory of your Moodle installation, so the full path is:

    moodle/local/lockgrades/
    
  2. 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
    
  3. 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

  1. Log in with an administrator account (with moodle/site:config capability).

  2. In your browser, open the URL:

    https://your-moodle-site.local/local/lockgrades/index.php
    
  3. Enter the idnumber of the main category whose grades you want to lock or unlock (e.g., totPeriode_1).

  4. Click on Lock grades or Unlock grades.

  5. 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

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

  1. Make sure you have all the required versions.
  2. Download and unpack the module.
  3. Place the folder in the "local" subdirectory.
  4. Visit http://yoursite.com/admin to finish the installation.