If $CFG->enable_read_only_sessions_debug was not enabled, debugging could be
enabled part-way through a request when restart_with_write_lock was
called. This meant that a diff between the initial and final session
would be made during write_close(), although the intial session state
was never captured. This generated false positives in the logs, and it
thought any variable set in the session was a change from the original
value.
This ensures that debugging is enabled before the debug flag is allowed
to change, preventing false positives.
Also added @runInSeparateProcess on each session Redis cluster test to let the test run
in a separate process to avoid the error "the headers are not already sent" by PHPUnit.
This was always bad, but since we only used it to verify the existence
of the param, and let library code take $_REQUEST for the real
validation, it was ok. Now, since we're redirecting to self during
necessary cookie checks added by MDL-80835, we lose the real value
originally stored in $_REQUEST. This patch just fixes the param type,
setting it to raw, which is what it should have used originally. The
raw value won't be cast from a string to an int as part of the
require_param call, so the value won't be lost any more.
Two new hooks are introduced to allow plugins to add their own user tour
filters.
Separate hooks are identified for both clientside, and serverside
filters.
Fixes the failing unit tests in the ordering question type by
implementing the following adjustments and corrections:
- Ensure the missing required files are imported in
questionhint_test.php and questiontype_test.php.
- Modify the expected fraction values in testexport.moodle.xml to
accurately reflect the recent changes, specifically the type
casting of the fraction value stored for each answer into the
question object.
- Reorder the items in the answers array within the failing scenario
in specific_grade_detail_feedback_test.php to guarantee that, in
accordance with the randomly generated subset of correct answers,
the question attempt will consistently be incorrect as required.
- Pass the answer codes in the order of the defined response when
calling the process_submission() function in feedback_test.php
to ensure the response in the current question attempt is properly
set, rather than relying on random generation of the response which
may result in random test failures.
When retrieving the answer data from the database, it's essential to
cast the value of the answer's fraction to a float before storing it
into the question object. This step is crucial for ensuring consistency,
as some database engines return floats as strings like '1.0000000'.