Accessibility Issue: Form Accessibility Problems
WCAG Level: A
Severity: High
Category: Form Accessibility
Issue Description
Form inputs lack proper accessibility attributes. The quiz options buttons are dynamically generated without proper ARIA roles and labels.
User Impact
- Affected Users: Blind/Low Vision users, Screen reader users
- Severity: Users cannot understand form purpose or make selections confidently
Violations Found
File: `index.html`
Lines: 38-40 (Setup form)
Current Code:
```html
Your name
```
Issues:
- Labels are wrapped but missing explicit `for` attribute for better compatibility
- Missing `aria-required="true"` on required fields
- Placeholder used as example - acceptable but ensure label is clear
File: `app.js`
Lines: 143-154 (renderQuestion function)
Current Code:
```javascript
optionsWrap.innerHTML = "";
likertOptions.forEach((opt) => {
const button = document.createElement("button");
button.type = "button";
button.textContent = opt.label;
if (answers[idx] === opt.value) button.classList.add("active");
button.addEventListener("click", () => {
answers[idx] = opt.value;
renderQuestion();
});
optionsWrap.appendChild(button);
});
```
Issues:
- Option buttons missing `role="radio"` and `aria-checked` for radio-like behavior
- No `aria-label` connecting options to the question
- Missing `aria-live` region for dynamic updates
Recommended Fix
For index.html:
```html
Your name
```
For app.js (renderQuestion function):
```javascript
optionsWrap.innerHTML = "";
optionsWrap.setAttribute("role", "radiogroup");
optionsWrap.setAttribute("aria-labelledby", "questionText");
likertOptions.forEach((opt) => {
const button = document.createElement("button");
button.type = "button";
button.setAttribute("role", "radio");
button.setAttribute("aria-checked", answers[idx] === opt.value ? "true" : "false");
button.textContent = opt.label;
if (answers[idx] === opt.value) button.classList.add("active");
button.addEventListener("click", () => {
answers[idx] = opt.value;
renderQuestion();
});
optionsWrap.appendChild(button);
});
```
Testing Instructions
- Navigate forms with screen reader
- Verify labels are announced
- Test quiz options announce as radio buttons
- Verify selection state is announced
Resources
Acceptance Criteria
Accessibility Issue: Form Accessibility Problems
WCAG Level: A
Severity: High
Category: Form Accessibility
Issue Description
Form inputs lack proper accessibility attributes. The quiz options buttons are dynamically generated without proper ARIA roles and labels.
User Impact
Violations Found
File: `index.html`
Lines: 38-40 (Setup form)
Current Code:
```html
Your name
```
Issues:
File: `app.js`
Lines: 143-154 (renderQuestion function)
Current Code:
```javascript
optionsWrap.innerHTML = "";
likertOptions.forEach((opt) => {
const button = document.createElement("button");
button.type = "button";
button.textContent = opt.label;
if (answers[idx] === opt.value) button.classList.add("active");
button.addEventListener("click", () => {
answers[idx] = opt.value;
renderQuestion();
});
optionsWrap.appendChild(button);
});
```
Issues:
Recommended Fix
For index.html:
```html
Your name
```
For app.js (renderQuestion function):
```javascript
optionsWrap.innerHTML = "";
optionsWrap.setAttribute("role", "radiogroup");
optionsWrap.setAttribute("aria-labelledby", "questionText");
likertOptions.forEach((opt) => {
const button = document.createElement("button");
button.type = "button";
button.setAttribute("role", "radio");
button.setAttribute("aria-checked", answers[idx] === opt.value ? "true" : "false");
button.textContent = opt.label;
if (answers[idx] === opt.value) button.classList.add("active");
button.addEventListener("click", () => {
answers[idx] = opt.value;
renderQuestion();
});
optionsWrap.appendChild(button);
});
```
Testing Instructions
Resources
Acceptance Criteria