MDL-76597 mod_quiz: Set presentation role for the question list

Since the <ul> and <li> elements for listing the quiz questions and
elements are mainly used for layout purposes, it is better to set the
role of these elements to presentation only.
The aria-label for the <li> element is inappropriate and can also cause
confusion to screen reader users. Better to remove this. Though this is
being used in the confirmation modal so better to just change it to a
data attribute.
This commit is contained in:
Jun Pataleta
2023-01-06 22:55:13 +08:00
parent 58d350d53d
commit 4d64b0b5fe
5 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -404,8 +404,8 @@ class edit_renderer extends \plugin_renderer_base {
}
$output .= html_writer::start_tag('li', array('id' => 'section-'.$section->id,
'class' => 'section main clearfix'.$sectionstyle, 'role' => 'region',
'aria-label' => $sectionheadingtext));
'class' => 'section main clearfix'.$sectionstyle, 'role' => 'presentation',
'data-sectionname' => $sectionheadingtext));
$output .= html_writer::start_div('content');
@@ -929,7 +929,7 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
// Create the confirmation dialogue.
var confirm = new M.core.confirm({
question: M.util.get_string('confirmremovesectionheading', 'quiz', activity.get('aria-label')),
question: M.util.get_string('confirmremovesectionheading', 'quiz', activity.getData('sectionname')),
modal: true
});
File diff suppressed because one or more lines are too long
@@ -929,7 +929,7 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
// Create the confirmation dialogue.
var confirm = new M.core.confirm({
question: M.util.get_string('confirmremovesectionheading', 'quiz', activity.get('aria-label')),
question: M.util.get_string('confirmremovesectionheading', 'quiz', activity.getData('sectionname')),
modal: true
});
+1 -1
View File
@@ -113,7 +113,7 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
// Create the confirmation dialogue.
var confirm = new M.core.confirm({
question: M.util.get_string('confirmremovesectionheading', 'quiz', activity.get('aria-label')),
question: M.util.get_string('confirmremovesectionheading', 'quiz', activity.getData('sectionname')),
modal: true
});