* 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.)
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.
Co-authored-by: Tim Hunt <t.j.Hunt@open.ac.uk>
Also:
* Fix some incorrect punctuation in two strings.
* Add a test to verify that this change does not cause a regression.
* Improve some PHPdoc comments.
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.