mirror of
https://github.com/moodle/moodle.git
synced 2025-04-03 23:42:39 +02:00
Problem: When the aggregation method is set to "natural," grade items' weights and the maximum grade of the grade category's item get recalculated, causing the needsupdate flag to be set to true. As a result, the locking process was skipped, leading to unexpected behaviour. Solution: To address the issue, the set_locked method has been modified. Instead of skipping the locking process, the method now schedules the locking of grade items to occur slightly in the past, specifically one second in the past. This ensures that the grade item will be automatically locked after the recalculations are completed. Explanation: By making this adjustment, we ensure that the locking process is not skipped during natural aggregation, maintaining consistent behaviour and preventing any unintended consequences related to grade item locking.