diff --git a/libs/blocks/quiz-marquee/quiz-marquee.js b/libs/blocks/quiz-marquee/quiz-marquee.js index 70b82eade8..f98d1a9f33 100644 --- a/libs/blocks/quiz-marquee/quiz-marquee.js +++ b/libs/blocks/quiz-marquee/quiz-marquee.js @@ -68,9 +68,13 @@ export default async function init(el) { [...rows].forEach(async (row) => { const cols = row.querySelectorAll(':scope > div'); const isFragRow = cols[0].textContent.trim() === 'nested-fragments'; + const isList = cols[2]?.textContent?.trim() === 'list' || false; if (isFragRow) { - cols[0].parentElement.classList.add('nested', cols[1].textContent.trim()); + const fragParent = cols[0].parentElement; + fragParent?.classList.add('nested', cols[1]?.textContent?.trim()); + if (isList) fragParent.setAttribute('role', 'list'); + const wrapper = createTag('div', { class: 'copy-wrapper' }); row.append(wrapper); wrapper.append(...cols); diff --git a/libs/blocks/quiz-results/quiz-results.js b/libs/blocks/quiz-results/quiz-results.js index 7c9622366a..c4577ddea8 100644 --- a/libs/blocks/quiz-results/quiz-results.js +++ b/libs/blocks/quiz-results/quiz-results.js @@ -16,6 +16,7 @@ async function loadFragments(el, experiences) { } document.querySelectorAll('main > div, .quiz-results').forEach((quiz) => quiz.removeAttribute('daa-lh')); document.querySelectorAll('.quiz-results.basic > .fragment > .section').forEach((section, idx) => decorateSectionAnalytics(section, idx, getConfig())); + if (el.getAttribute('role') === 'list') document.querySelectorAll('.nested[role=list] > .fragment').forEach((fragment) => fragment.setAttribute('role', 'listitem')); } function redirectPage(quizUrl, debug, message) {