From d5e084bcb6a65d16a0411eadc190d71ee457ef9f Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Tue, 30 Apr 2019 17:54:23 +0200 Subject: [PATCH] MDL-5311 qtype_multichoice: replace label to a for clean button To avoid behat errors with Firefox, the 'Clean my choice' has been changed from label to link (with role button). --- question/type/multichoice/renderer.php | 4 ++-- theme/boost/scss/moodle/question.scss | 2 +- theme/boost/style/moodle.css | 2 +- theme/classic/style/moodle.css | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/question/type/multichoice/renderer.php b/question/type/multichoice/renderer.php index 61585b41e55..1213c8b5dca 100644 --- a/question/type/multichoice/renderer.php +++ b/question/type/multichoice/renderer.php @@ -300,8 +300,8 @@ class qtype_multichoice_single_renderer extends qtype_multichoice_renderer_base } // Adds an hidden radio that will be checked to give the impression the choice has been cleared. $clearchoiceradio = html_writer::empty_tag('input', $clearchoiceradioattrs); - $clearchoiceradio .= html_writer::tag('label', get_string('clearchoice', 'qtype_multichoice'), - ['for' => $clearchoiceid]); + $clearchoiceradio .= html_writer::link('', get_string('clearchoice', 'qtype_multichoice'), + ['for' => $clearchoiceid, 'role' => 'button']); // Now wrap the radio and label inside a div. $result = html_writer::tag('div', $clearchoiceradio, ['id' => $clearchoicefieldname, 'class' => $cssclass]); diff --git a/theme/boost/scss/moodle/question.scss b/theme/boost/scss/moodle/question.scss index 786c7f1a2a5..7ece8bb13e9 100644 --- a/theme/boost/scss/moodle/question.scss +++ b/theme/boost/scss/moodle/question.scss @@ -312,7 +312,7 @@ body.path-question-type { } .qtype_multichoice_clearchoice { padding-top: 10px; - label { + a { cursor: pointer; text-decoration: underline; padding-left: 30px; diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index c11e691fdd8..304ba3707a8 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -14030,7 +14030,7 @@ body.path-question-type { .qtype_multichoice_clearchoice { padding-top: 10px; } - .qtype_multichoice_clearchoice label { + .qtype_multichoice_clearchoice a { cursor: pointer; text-decoration: underline; padding-left: 30px; } diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index dad63afd728..6ddf3925837 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -14281,7 +14281,7 @@ body.path-question-type { .qtype_multichoice_clearchoice { padding-top: 10px; } - .qtype_multichoice_clearchoice label { + .qtype_multichoice_clearchoice a { cursor: pointer; text-decoration: underline; padding-left: 30px; } -- 2.11.4.GIT