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 20:45:12 +08:00
parent d2bacb04ff
commit 6a7668e350
5 changed files with 6 additions and 5 deletions

View File

@ -404,7 +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' => 'presentation'));
'class' => 'section main clearfix'.$sectionstyle, 'role' => 'presentation',
'data-sectionname' => $sectionheadingtext));
$output .= html_writer::start_div('content');

View File

@ -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

View File

@ -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
});

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
});