When some activities are manually completed by students, some are still showing in students' timeline.
This commit fix that for module assign,chat,choice,feedback,lesson,quiz,scorm and workshop.
Namely:
- 3rd param of assertEquals() cannot be null.
- Some incorrect uses of assertNotEmpty().
- Comparing 2 strings now uses strict (===) evaluation.
Link: https://github.com/sebastianbergmann/phpunit/issues/3185
Solution here is one of:
a) Return to the previous situation, making the comparison
softer. That can achieved by forcing different types, so
float == string works.
b) Changing APIs (both forms and database return strings) to
perform some conversion to floats. That would make float
comparison (with floats or strings) to work too.
The patch here follows the a) approach. Changing all the internals
for proper float handling sounds excesive when it has been working
perfectly since ever. So we went the easier route, just getting
rid of the new === comparisons when needed by changing expectation
types to float.
Significant string changes:
* importgroups_help,core_group - Correcting optional fieldnames
(removing picture, hidepicture and adding groupidnumber, groupingname
and enablemessaging)
* penaltyforeachincorrecttry_help,core_question - additional paragraph
about scoring logic
* resultdownloadready,tool_dataprivacy - wording corrected (no need to
go to a download page)
* auth_dbfielduser,auth_db - varchar data type requirement
When grades are deleted, it needs to know the context so any files
in the gradebook can be deleted. This means module delete_instance
functions must delete the grade_item before they delete the module record.
There was a bug here that had not exposed until MDL-60820 introduced the
call $mform->setDefault() at the bottom of the definition_after_data()
method. That call triggers the 'updateValue' event on all form elements.
For input text elements, this effectively sets their value to the
default one, which was empty in this case due to the way how the value
had been set.
The solution here is to set the value via the same way like the normal
set_data() method does it.
The attached Behat test reproduces the problem and makes sure the patch
works.
Grades that have been hidden will appear in the outline/complete
report - even if the user is a student.
The modules that have been fixed are:
* mod_assign
* mod_data
* mod_forum
* mod_glossary
* mod_lesson
* mod_scorm
* mod_workshop
3.7 (min PHP 7.1) requires 3.2 (first version supporting PHP 7.1)
This just deletes all the upgrade steps previous to 3.2.0. Some
small adjustments, like adding missing MOODLE_INTERNAL or tweaking
globals can also be applied when needed.
Also includes an upgrade step to prevent upgrading from any
version < 2016120500 (v3.2.0) as anti-cheating measure.
Next commit will get rid of/deprecate all the upgradelib functions
not used anymore in codebase. (note there isn't any this time).
The capabilities changed ('contextlevel' => CONTEXT_COURSE changed to
'contextlevel' => CONTEXT_MODULE) are:
* moodle/site:accessallgroups
* moodle/site:viewfullnames
* moodle/site:trustcontent
* moodle/site:viewuseridentity
This list came from reviewing the _get_extra_capabilities functions in
all core activities. They were all somewhat inconsistent, but I think it
makes sense that these capabilities are consistently overridable in all
activities. E.g. moodle/site:accessallgroups affects conditional
availability even if there is no other user of groups, and
moodle/site:viewuseridentity and moodle/site:viewfullnames affect the
logs report, if nothing else.
As a result of this, several _get_extra_capabilities functions are no
longer needed, and all the rest have been simplified.
The mod_workshop\privacy\provider now implements the new
core_userlist_provider interface. Deleting (erasing) data follows the
same principles as in other existing methods - we do not actually delete
data that might affect other users. Instead, we only erase the sensitive
owned personal information such as provided content.
Moved 'percents' lang string from workshopform_numerrors to core_moodle.
AMOS BEGIN
MOV [percents,workshopform_numerrors],[percents,core_moodle]
AMOS END
Part of MDL-62610
This allows the teacher to define what students are supposed to submit
(online text and/or attachment) and if the given submission part is
required or optional.
This change moves the content of WHERE to the JOIN, thus filtering the
results before they are returned. This reduces the number of joined rows
which gives a big performance benefit.