This is a result of a pretty intensive effort to make the form less
sucky, given the completion strings mess around. It partially solves
MDL-39419 too as it clarifies the course completion link in the course
administration block.
I must admit and record here that I'm pretty desperate by the current
state of the core_completion and how strings from it are inconsistently
used at various places with different meanings. For example the 'Completion
tracking' may mean the mode of how activities are tracked within the
course as well as the overall feature of course and activities tracking.
While a same phrase can be used in English for both this meanings, not
all languages have such luck and translating it is a pain in the ass.
Finally, let me give the credit for wording and UI design suggestions to
Helen Foster and all others who helped with this. This has been one of
the most ugliest forms in Moodle and we believe we made it better
(although we know it's far from perfect).
This patch does not alter the code, only some syntax fixes and
coding guidelines rules are applied. Strings are re-ordered
alphabetically with no change of their wording. PHP doc blocks
reconstructed using the Git log records.
Issues:
1. Fix setType calls
2. Changing from default to all and editing again, default is still selected.
3. Uncheck all options causes error.
4. Doesn't seem to be restricting based upon option.
5. Picked all and got coding error with the database thing.
6. Bad title: https://github.com/samhemelryk/moodle/commit/wip-MDL-37500-m25#L1R157
7. Amend comments - should only be removed once 2.5 is the minimum version for an upgrade.
8. Document the defaultsharing option.
Outcomes:
1. Fixed - copy paste error.
2. Fixed - mforms was applying the default value despite a value being provided. A quirk of elements with array names.
3. Fixed - validation now requires at least one option to be selected.
4. Fixed - issue rose from definitions not being re-parsed. cache/admin.php now reparses the first time a user visits the page.
5. Fixed - better purging of definitions when working with them anonymously. Unit test added.
6. Fixed - new string added and used.
7. Fixed - comments amended.
New issue to address parsing of definitions during upgrade.
New issue to add debugging notice if definition sets only one possible sharing option and that option is user input.