diff --git a/question/type/truefalse/renderer.php b/question/type/truefalse/renderer.php index 201e606e0a0..3e8c42723f4 100644 --- a/question/type/truefalse/renderer.php +++ b/question/type/truefalse/renderer.php @@ -100,11 +100,13 @@ class qtype_truefalse_renderer extends qtype_renderer { array('class' => 'qtext')); $result .= html_writer::start_tag('fieldset', array('class' => 'ablock')); - $legendclass = 'sr-only'; if (!empty($question->showstandardinstruction)) { $legendclass = ''; + $questionnumber = $options->add_question_identifier_to_label(get_string('selectone', 'qtype_truefalse'), true, true); + } else { + $legendclass = 'sr-only'; + $questionnumber = $options->add_question_identifier_to_label(get_string('answer'), true, true); } - $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 ' . $legendclass)); diff --git a/question/type/truefalse/tests/walkthrough_test.php b/question/type/truefalse/tests/walkthrough_test.php index 07721a69fe0..94bb1166ccb 100644 --- a/question/type/truefalse/tests/walkthrough_test.php +++ b/question/type/truefalse/tests/walkthrough_test.php @@ -155,7 +155,7 @@ class walkthrough_test extends \qbehaviour_walkthrough_test_base { $this->render(); // Check for 'Show standard instruction'. - $standardinstruction = \html_writer::tag('legend', get_string('selectone', 'qtype_truefalse'), [ + $standardinstruction = \html_writer::tag('legend', get_string('answer'), [ 'class' => 'prompt h6 font-weight-normal sr-only' ]); $this->assertStringContainsString($standardinstruction, $this->currentoutput);