Skip to content

Commit

Permalink
MDL-70004 qtype_multichoice: Set appropriate clear my choice role
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Oct 27, 2020
1 parent 5d357f9 commit f61badb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion question/type/multichoice/amd/build/clearchoice.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion question/type/multichoice/amd/build/clearchoice.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion question/type/multichoice/amd/src/clearchoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]'
};

Expand Down
5 changes: 3 additions & 2 deletions question/type/multichoice/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,9 @@ public function after_choices(question_attempt $qa, question_display_options $op
}
// 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]);
$clearchoice = html_writer::link('#', get_string('clearchoice', 'qtype_multichoice'),
['tabindex' => $linktabindex, 'role' => 'button']);
$clearchoiceradio .= html_writer::label($clearchoice, $clearchoiceid);

// Now wrap the radio and label inside a div.
$result = html_writer::tag('div', $clearchoiceradio, $clearchoicewrapperattrs);
Expand Down

0 comments on commit f61badb

Please sign in to comment.