Merge branch 'MDL-77766-401-2' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE

This commit is contained in:
Paul Holden 2023-04-25 09:38:37 +01:00
commit d10d553890
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164
4 changed files with 10 additions and 6 deletions

View File

@ -149,11 +149,13 @@ abstract class qtype_multichoice_renderer_base extends qtype_with_combined_feedb
$result .= html_writer::tag('div', $question->format_questiontext($qa),
array('class' => 'qtext'));
$questionnumber = $options->add_question_identifier_to_label($this->prompt(), true, true);
$result .= html_writer::start_tag('fieldset', array('class' => 'ablock no-overflow visual-scroll-x'));
$legendclass = 'sr-only';
if ($question->showstandardinstruction == 1) {
$legendclass = '';
$questionnumber = $options->add_question_identifier_to_label($this->prompt(), true, true);
} else {
$questionnumber = $options->add_question_identifier_to_label(get_string('answer'), true, true);
$legendclass = 'sr-only';
}
$legendattrs = [
'class' => 'prompt h6 font-weight-normal ' . $legendclass,

View File

@ -302,7 +302,7 @@ class walkthrough_test extends \qbehaviour_walkthrough_test_base {
$this->render();
// Check for 'Show standard instruction'.
$standardinstruction = \html_writer::tag('legend', get_string('selectmulti', 'qtype_multichoice'), [
$standardinstruction = \html_writer::tag('legend', get_string('answer'), [
'class' => 'prompt h6 font-weight-normal sr-only'
]);
$this->assertStringContainsString($standardinstruction, $this->currentoutput);

View File

@ -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));

View File

@ -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);