* Have the following classes extend qtype_essay_format_renderer_base
as they have been meant to:
- qtype_essay_format_editor_renderer
- qtype_essay_format_noinline_renderer
- qtype_essay_format_plain_renderer
* Add a question_display_options instance variable for
qtype_essay_format_renderer_base so its subclasses can use it to
generate the label for their respective answer fields.
* Add the question number to the answer fields if it's available.
* Improve multiple choice question accessibility:
- Label the multiple choice question groups appropriately by
enclosing them in fieldset tags and applying sr-only legend tags to
label them.
- Apply Bootstrap form-check classes to the radio buttons, so they
are rendered better and become responsive as well. This also helps
avoid the use of the table element for layout purposes when
rendering horizontal multiple choice sub-questions.
* Add an instance variable to question_display_options to store the
identifier associated with the question being rendered.
* This information can be used by question type plugins to improve the
accessibility of the answer fields being rendered by adding the
question identifier to the answer fields' labels.
* Adding the question identifier to the label can be achieved by using
question_display_options::add_question_identifier_to_label().
Co-authored-by: Tim Hunt <t.j.hunt@open.ac.uk>
This is very similar to MDL-77090, but at the time, I missed that this
also needed to be handled. (Question metadata is, I think, only used
by the quiz 'Try another question like this one' feature.)
Previously, it was possible to create drag-drop markers and onto image
questions without any drag items or drop zones. This was non-sensical,
and broke statistics calculations.
So, missing validation added, and random guess score calculation made
robust.
The behaviour-specific data was getting corrupted when the regrade
recreated the first step, because $oldstep->get_behaviour_data() was
stripping off the leading '-' characters from the names, and they were
not being added back.
By using that assertion the arrays will be sorted before comparison
preventing any Oracle sorting related failures.
Credits for the solution go to Tim Hunt!
PHP before version 8.1 automatically converted to int if the function
parameter (or array key) is expected to be int. PHP 8.1 shows notice in
this case