MDL-76849 qtype_truefalse: Include question number in answer fields
* Improve accessibility as well by grouping the radio buttons in a fieldset.
This commit is contained in:
@@ -99,9 +99,10 @@ class qtype_truefalse_renderer extends qtype_renderer {
|
||||
$result .= html_writer::tag('div', $question->format_questiontext($qa),
|
||||
array('class' => 'qtext'));
|
||||
|
||||
$result .= html_writer::start_tag('div', array('class' => 'ablock'));
|
||||
$result .= html_writer::tag('div', get_string('selectone', 'qtype_truefalse'),
|
||||
array('class' => 'prompt'));
|
||||
$result .= html_writer::start_tag('fieldset', array('class' => 'ablock'));
|
||||
$questionnumber = $options->add_question_identifier_to_label(get_string('selectone', 'qtype_truefalse'), true, true);
|
||||
$result .= html_writer::tag('legend', $questionnumber,
|
||||
array('class' => 'prompt h6 font-weight-normal'));
|
||||
|
||||
$result .= html_writer::start_tag('div', array('class' => 'answer'));
|
||||
$result .= html_writer::tag('div', $radiotrue . ' ' . $truefeedbackimg,
|
||||
@@ -110,7 +111,7 @@ class qtype_truefalse_renderer extends qtype_renderer {
|
||||
array('class' => 'r1' . $falseclass));
|
||||
$result .= html_writer::end_tag('div'); // Answer.
|
||||
|
||||
$result .= html_writer::end_tag('div'); // Ablock.
|
||||
$result .= html_writer::end_tag('fieldset'); // Ablock.
|
||||
|
||||
if ($qa->get_state() == question_state::$invalid) {
|
||||
$result .= html_writer::nonempty_tag('div',
|
||||
|
||||
Reference in New Issue
Block a user