Shamim Rezaie fb3f018cf6 MDL-78082 core_grades: Fix locking issue with natural aggregation
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.
2023-09-06 22:19:40 +10:00
..