import Templates from 'core/templates';
import Selectors from './user_picker/selectors';
+import {get_string as getString} from 'core/str';
const templatePath = 'mod_forum/local/grades/local/grader';
const [{html, js}] = await Promise.all([this.renderUserChange(user), this.showUserCallback(user)]);
const userRegion = this.root.querySelector(Selectors.regions.userRegion);
Templates.replaceNodeContents(userRegion, html, js);
+
+ // Update the hidden now-grading region so screen readers can announce the user that's currently being graded.
+ const currentUserRegion = this.root.querySelector(Selectors.regions.currentUser);
+ currentUserRegion.textContent = await getString('nowgradinguser', 'mod_forum', user.fullname);
}
/**
export default {
regions: {
+ currentUser: '[data-region="user_picker/current_user"]',
userRegion: '[data-region="user_picker/user"]',
},
actions: {
$string['namesocial'] = 'Social forum';
$string['nameteacher'] = 'Teacher forum';
$string['nextdiscussiona'] = 'Next discussion: {$a}';
-$string['nextuser'] = 'Next user';
+$string['nextuser'] = 'Save changes and proceed to the next user';
$string['newforumposts'] = 'New forum posts';
$string['noattachments'] = 'There are no attachments to this post';
$string['nodiscussions'] = 'There are no discussion topics yet in this forum';
$string['posttoforum'] = 'Post to forum';
$string['postupdated'] = 'Your post was updated';
$string['potentialsubscribers'] = 'Potential subscribers';
-$string['previoususer'] = 'Previous user';
+$string['previoususer'] = 'Save changes and proceed to the previous user';
$string['privacy:digesttypenone'] = 'We do not hold any data relating to a preferred forum digest type for this forum.';
$string['privacy:digesttypepreference'] = 'You have chosen to receive the following forum digest type: "{$a->type}".';
$string['privacy:discussionsubscriptionpreference'] = 'You have chosen the following discussion subscription preference for this forum: "{$a->preference}"';
$string['graded'] = 'Graded';
$string['gradedby'] = 'Graded by';
$string['notgraded'] = 'Not graded';
+$string['nowgradinguser'] = 'Now grading {$a}';
$string['gradeforrating'] = 'Grade for rating: {$a->str_long_grade}';
$string['gradeforratinghidden'] = 'Grade for rating hidden';
$string['gradeforwholeforum'] = 'Grade for forum: {$a->str_long_grade}';
}}
<div class="d-flex align-items-center user-picker-container mb-2 py-2">
+ <div aria-live="polite" data-region="user_picker/current_user" class="sr-only"></div>
<div class="d-flex align-items-center" data-region="user_picker/user"></div>
<div class="ml-auto flex-shrink-0">
<nav aria-label="{{#str}} usernavigation, mod_forum {{/str}}">
<ul class="pagination mb-0">
<li class="page-item">
- <a
+ <button
class="page-link icon-no-margin p-0 text-reset icon-size-3"
href="#"
- aria-label="{{#str}} previous {{/str}}"
+ aria-label="{{#str}} previoususer, mod_forum {{/str}}"
data-action="change-user"
data-direction="-1"
title="{{#str}} previoususer, mod_forum {{/str}}"
>
<span class="dir-ltr-hide">{{#pix}} i/next, core {{/pix}}</span>
<span class="dir-rtl-hide">{{#pix}} i/previous, core {{/pix}}</span>
- </a>
+ </button>
</li>
<li class="page-item">
- <a
+ <button
class="page-link icon-no-margin p-0 text-reset icon-size-3 ml-2"
href="#"
- aria-label="{{#str}} next {{/str}}"
+ aria-label="{{#str}} nextuser, mod_forum {{/str}}"
data-action="change-user"
data-direction="1"
title="{{#str}} nextuser, mod_forum {{/str}}"
>
<span class="dir-ltr-hide">{{#pix}} i/previous, core {{/pix}}</span>
<span class="dir-rtl-hide">{{#pix}} i/next, core {{/pix}}</span>
- </a>
+ </button>
</li>
</ul>
</nav>
<img
class="rounded-circle userpicture mr-2"
src="{{.}}"
- alt="{{#str}}pictureof, moodle, {{fullname}}{{/str}}"
- title="{{#str}}pictureof, moodle, {{fullname}}{{/str}}"
+ aria-hidden="true"
>
{{/profileimage}}
<div>