Reuse the code between default course completion settings and
activity completion form to avoid duplicating efforts and missing
features, as happened with the grading forum.
For a long time, Moodle has had the feature to force the language
for a whole course. This change adds the same feature at activity
level.
The course-level feature was controlled by a capability
moodle/course:setforcedlanguage, and I decided to use the same
capability to control this feature. I think a new capability would be
overkill.
Current code was relying on grade_floatval() that is not a validation
function. Instead, the gradepass field must be defined as proper float
and then perform the needed validations using unformat_float().
Note that the float element form has some particularities, see
MDL-73994 for more information and that makes us to have to check
for some values (null, zero) manually. Once that form element type
gets its behaviour fixed, the code will need to be revisited, hence
we have annotated it as comments for easier finding it in the future
(the same changes already were applied to other gradebook forms).
Also, remove an unreachable line of code (comparing with empty string)
within the grade_floatval() function because it's not possible anymore
to pass any string to it, as far as it's "?float" typed.
Covered as many cases with quiz completion as have been able to imagine.
* The button to "Add group/grouping access restriction" under
common module settings should only be present if corresponding
availability plugins are enabled; and
* Prevent the same button behaving as a submit button, which
intercepted the user hitting return in the form and added a
restriction without deliberate action taken by the user.
Extend the admin flag options, that currently allow the 'advanced' and 'locked' states
of a form setting to be controlled by a plugins admin settings, to also include
the 'required' state. These options appear as a list of checkboxes next to the admin
setting.
Fix incorrect comparison of gradepass variable (with comma as decimal separator)
with grade variable when trying to save assignment settings.
Adds missing unformat_float($data['gradepass']).
renamed Visible to Availability and added help strings
AMOS BEGIN
CPY [availability,core_moodle],[modvisible,core_moodle]
CPY [availability,core_moodle],[modvisiblewithstealth,core_moodle]
CPY [availability,core_moodle],[modvisiblehiddensection,core_moodle]
CPY [show,core_moodle],[modshow,core_moodle]
CPY [hide,core_moodle],[modhide,core_moodle]
AMOS END
Add field 'visibleoncoursepage' to the course_modules table
Add site-wide setting for turning on stealth mode availability
Add callback for "stealth" mode support in the course formats
Change display of modules/sections availability on the course page