This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing
All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.
Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
Default value of the $flag argument changed in PHP 8.1 from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE
To ensure consistent behavior across different PHP version the second parameter is now required for the functions:
htmlspecialchars(), htmlentities(), htmlspecialchars_decode(), html_entity_decode() and get_html_translation_table()
dirname() is a slow function compared with __DIR__ and using
'/../'. Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code. This allows those required includes to perform as
best as possible in this situation.
The common cartridge backup was skipping
quizzes because the <questions> element
is no longer in the Moodle backup file.
Instead, now reading from the list of
<question_instances> list.
Changes provided by Darko Miletic and Sam Chaffee.
* Fix problem with CC import not detecting a CC package. (Sam)
* Fixed Common Cartridge not importing FIB answers. (Sam)
* Fix to CC export so that short answer pattern matching question
in a quiz does not prevent the entire quiz from exporting. (Sam)
* Fix notice about missing index when there is no answer-specific
feedback in short answer question during CC export. (Sam)
* Fixed Japanese characters being incorrectly encoded (garbled)
on Common Cartridge import. (Sam)
* Changed import of CC discussions to create 'Standard General'
forums in Moodle. (Sam)
* Fix problem with question name being replaced with question
text on CC import of exported Moodle questions. (Sam)
* Fix CC 1.1 multiple choice question import having no correct
answers. (Sam)
* Fixed problem with multiple choice, multiple answers allowed
questions not exporting correct answers to CC. (Sam)
* Removed duplicate method. (Darko)
* Implemented fix that skips quiz export if it contains
non-exportable question. (Darko)
* Fixed: Common cartridge export is extremely slow when dealing
with lot of more than 200 files. (Darko)
* Added support for basic roles support in common cartridge. (Darko)
* Implemented folder resource export. (Darko)
* Minor fixes to adjust to the standard. (Darko)
* Added support for exporting simple fill in the blank
(shortanswer without wildcards in Moodle). (Darko)
* Added support for exporting essay question. (Darko)
* Added support for true/false export. (Darko)
* Added support for exporting multiple response questions,
added also category information into question metadata
during export (Darko)
* Added support for correctly importing multiple response
questions. (Darko)
xs:language type. All xs:language instances are replaced with xs:token
type. It relaxes validation enough for all the complex or dummy language
strings to be accepted.