In the get_grade_letters there is a static variable that is used
to cache grade letters, we should use MUC for this so that it is
reset properly between unit tests.
This commit reviews all continue uses in core happening within a
loop / switch / case hierarchy. This does not cover:
- Changes to libraries. Will be handled in another issue / commit.
- Uses out from loops, will be reviewed by other commit.
The policy followed has been:
- When possible, take rid of the continue.
- When clearly the intention was to jump to next element in loop
change to continue 2
- When it was not clear, keep old behavior switching to break, no
matter how weird the behavior may be.
As we experienced in a bigger moodle.org course (7500 users, 70 grade
items), the standard memory limit 256M may not be enough here. We were
not able to find any obvious memory leak in the processing. Requiring
extra memory helped in this particular case and it seems reasonable to
have it in the core.
The grade settings page displays a message to inform users that weights
have been adjusted if they did not previously add up to the required 100%.
With the change to sometimes displaying a progress bar, whether the message
is displayed must be calculated immediately after the regrade took place,
and before the page redirects.
I have added a callback with arguments to the regrade_if_required function
which is called immediately after regrade has taken place (regardless of
whether the progress bar is required).
This callback modifies the PAGE URL such that the redirect message will be
displayed after the redirect. This does not use the session as the message
should only be displayed immediately after a change. If the user does not
click on the continue button after the progress bar has been displayed, and
comes back to the page later, this may be confusing.
Before this patch we would be marking some items as 'needsupdate'
during an update. Leaving them aside and not effectively updating
them.
Part of: MDL-46576
New keep roles/enrolments and groups/groupings options, notification CSS fixed, standardised notification texts, added missing delete of module blocks, fixed file deleting and some other minor issues.