mirror of
https://github.com/moodle/moodle.git
synced 2025-03-22 00:20:37 +01:00
MDL-77766 qtype_truefalse: Respect showstandardinstruction
* When showstandardinstruction is set to no, replace the standard instruction with the generic "Answer" text for the answer options fieldset's legend.
This commit is contained in:
parent
75984fb226
commit
35e69b6ae8
@ -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));
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user