Commit b7294cc1 authored by jun's avatar jun
Browse files

MDL-70004 qtype_multichoice: Set appropriate clear my choice role

parent aed0ee06
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -25,7 +25,7 @@ define(['jquery', 'core/custom_interaction_events'], function($, CustomEvents) {
var SELECTORS = {
CHOICE_ELEMENT: '.answer input',
LINK: 'label',
LINK: 'a',
RADIO: 'input[type="radio"]'
};
......
......@@ -313,9 +313,9 @@ 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, 'role' => 'button', 'tabindex' => $linktabindex,
'class' => 'btn btn-link ml-4 pl-1 mt-2']);
$clearchoice = html_writer::link('#', get_string('clearchoice', 'qtype_multichoice'),
['tabindex' => $linktabindex, 'role' => 'button', 'class' => 'btn btn-link ml-3 mt-n1 mb-n1']);
$clearchoiceradio .= html_writer::label($clearchoice, $clearchoiceid);
// Now wrap the radio and label inside a div.
$result = html_writer::tag('div', $clearchoiceradio, $clearchoicewrapperattrs);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment