diff --git a/course/completion.js b/course/completion.js index 8e741423fbd..a5b5c8e3aa5 100644 --- a/course/completion.js +++ b/course/completion.js @@ -23,7 +23,6 @@ M.core_completion.init = function(Y) { iconkey, button = args.image.get('parentNode'); - if (current == 1) { altstr = M.util.get_string('completion-alt-manual-y', 'completion', modulename); iconkey = 'i/completion-manual-y'; @@ -33,11 +32,13 @@ M.core_completion.init = function(Y) { iconkey = 'i/completion-manual-n'; args.state.set('value', 1); } - button.set('title', altstr); require(['core/templates', 'core/notification'], function(Templates, Notification) { Templates.renderPix(iconkey, 'core', altstr).then(function(html) { - Templates.replaceNode(args.image.getDOMNode(), html, ''); + var id = button.get('id'), + postFocus = '$(document.getElementById("' + id + '")).focus();'; + + Templates.replaceNode(args.image.getDOMNode(), html, postFocus); }).catch(Notification.exception); }); } diff --git a/course/renderer.php b/course/renderer.php index d27e10f02ce..3bba431f13d 100644 --- a/course/renderer.php +++ b/course/renderer.php @@ -503,7 +503,7 @@ class core_course_renderer extends plugin_renderer_base { 'type' => 'hidden', 'name' => 'completionstate', 'value' => $newstate)); $output .= html_writer::tag('button', $this->output->pix_icon('i/completion-' . $completionicon, $imgalt), - array('class' => 'btn btn-link', 'title' => $imgalt)); + array('class' => 'btn btn-link', 'aria-live' => 'assertive')); $output .= html_writer::end_tag('div'); $output .= html_writer::end_tag('form'); } else {