From fc3cbd5015d72739440d17d722ae652a6ad0db67 Mon Sep 17 00:00:00 2001 From: danghieu1407 Date: Thu, 24 Aug 2023 20:47:58 +0700 Subject: [PATCH] MDL-78874 accessibility: Improve descriptive text for check button --- question/behaviour/rendererbase.php | 5 +++-- question/engine/tests/helpers.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/question/behaviour/rendererbase.php b/question/behaviour/rendererbase.php index db5ff9ebbc6..7c06cb4c965 100644 --- a/question/behaviour/rendererbase.php +++ b/question/behaviour/rendererbase.php @@ -234,13 +234,14 @@ abstract class qbehaviour_renderer extends plugin_renderer_base { 'type' => 'submit', 'id' => $qa->get_behaviour_field_name('submit'), 'name' => $qa->get_behaviour_field_name('submit'), - 'value' => get_string('check', 'question'), + 'value' => 1, 'class' => 'submit btn btn-secondary', ); if ($options->readonly) { $attributes['disabled'] = 'disabled'; } - $output = html_writer::empty_tag('input', $attributes); + $output = html_writer::tag('button', + $options->add_question_identifier_to_label(get_string('check', 'question'), true), $attributes); if (!$options->readonly) { $this->page->requires->js_init_call('M.core_question_engine.init_submit_button', array($attributes['id'])); diff --git a/question/engine/tests/helpers.php b/question/engine/tests/helpers.php index c7da45ae584..3c1a7543576 100644 --- a/question/engine/tests/helpers.php +++ b/question/engine/tests/helpers.php @@ -1229,7 +1229,7 @@ abstract class qbehaviour_walkthrough_test_base extends question_testcase { } else if ($enabled === false) { $expectedattributes['disabled'] = 'disabled'; } - return new question_contains_tag_with_attributes('input', $expectedattributes, $forbiddenattributes); + return new question_contains_tag_with_attributes('button', $expectedattributes, $forbiddenattributes); } /**