If query params were not passed the page would previously display debug
notices as setting the $requirecourseid param to question_edit_setup()
was buggy.
Because of some changes performed to the multichoice qtype
for Moodle 2.6, older sites are not able to upgrade properly.
This commits does introduce DB introspection to decide which
table and column names must be used. Nasty but enough.
Note MDL-52298 has been created about to avoid/minimize the
chances of this happening again.
Before this patch it was possible for the student displayed on the grading page to
not be the student that the user selected to grade. This would occur if:
1) The user had the table ordered by a value that could be modified,
for example Last modified (submission), Grade, Last modified (grade)
2) Another user performed an action that was recorded in Moodle in the time
between the user generating the table and clicking on a grade link.
If a user did not notice a different user had been loaded it could result in them giving
a grade to the incorrect user.
This patch ensures that the state of the table is cached every time it is viewed by a user
who has the capability to grade.
The previous 2.9 implementation of is_web_crawler() used stripos() in
certain cases. The unit tests re-added in the previous commit revealed
that certain crawlers (such as BaiDuSpider) were not correctly detected
in the new refactored implementation.
It seems lesser evil and safe enough to use /i in the regex search even
though it is not 100% same logic as before - as stripos() was used in
some cases only, not always.
In MDL-50891, the is_web_crawler() was refactored into a core_useragent
method and the function itself was deprecated. However, there were no
unit tests kept to check the backwards compatible behaviour. It turned
out that the deprecated function leads to PHP fatal error due to a typo.
This patch fixes the typo and brings back the previous unit tests. To be
able to explicitly check the raised debugging message, the test case
now must be subclass of advanced_testcase.
Additionally fixes missing info about the function being deprecated.
Previously we were generating a CSV file with newlines in it, which
seems to cause problems importing into some versions of MS Excel.
Instead seperate status lines by '-' - this column is only used to
provide context to the teacher in the spreadsheet.