Users can now rearrange options using the move buttons that each option
have, therefore there is no need for the current unintuitive keyboard
interaction implementation in the ordering question type plugin.
Each option has a couple of buttons to move the option's position. This
allows moving options by single pointer without dragging to address WCAG
Success Criterion 2.5.7.
Having the buttons also addresses WCAG Success Criterion 2.1.1 as it
provides an intuitive way to move options using keyboard.
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'.
The implementation of the check_file_access() method needs to be added
in the qtype_ordering_question class in order to ensure the users have
the appropriate access rights to a particular file.
Previously, third party imports could not add tags or the self defined ID numbers.
This is because if the plugin defines an import it just returns after completing skipping this non specific function.
Part of: MDL-79863
- Reduce usage of jQuery to only a couple of variables. These are left as is due to how heavy the usage is and how the base dnd seems to assume jQuery objects here and there.
- Templated the proxy string so we dont have to pull it in and replace tokens on the fly.
- Moved around functionality a bit to make for more concise reading and obvious delegation of responsibility
Part of: MDL-79863
Creates an abstract class in qtype_ordering/output that implements the
renderable interface. Each renderable that is used to output a given
component of the ordering question should extend this abstract class.
Part of: MDL-79863
Previously, get_response() was implemented in almost every PHPUnit
testing class in qtype_ordering and these implementations were
idenical. In order to avoid code duplication a new static method
get_response() has been created within the qtype_ordering_test_helper
class.
Also, each individual implementation within the PHPUnit testing
classes has been removed/modified and all related calls had been
replaced by qtype_ordering_test_helper::get_response().