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'.
This is basically just bringing back the same check done prior to
MDL-79270 where if there is no data being returned the default value for
the accessctr would be "allow".