Skip to content

Commit 8ec31c8

Browse files
committed
analysis exams
1 parent 37641cb commit 8ec31c8

28 files changed

+8672
-72
lines changed

.claude/commands/mathml-general-exam.md

Lines changed: 158 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,12 @@ Use this entity mapping:
9696
- Relations: ≤ (≤), ≥ (≥), ≠ (≠), ≈ (≈), ≡ (≡), ⟂ (⊥), ∥ (∥)
9797
- Calculus: ∂ (∂), ∫ (∫), ∮ (∮), ∑ (∑), ∏ (∏), ∇ (∇), √ (√)
9898
- Logic: ∀ (∀), ∃ (∃), ¬ (¬), ∧ (∧), ∨ (∨)
99-
- Number sets: ℝ (ℝ), ℂ (ℂ), ℕ (ℕ), ℤ (ℤ), ℚ (ℚ)
100-
- Greek letters: α (α), β (β), γ (γ), δ (δ), ε (ε), η (η), θ (θ), λ (λ), μ (μ), ν (ν), π (π), σ (σ), τ (τ), φ (φ), ω (ω), Γ (Γ), Δ (Δ), Θ (Θ), Λ (Λ), Σ (Σ), Φ (Φ), Ω (Ω)
99+
- Number sets: ℝ (ℝ), ℂ (ℂ), ℕ (ℕ), ℤ (ℤ), ℚ (ℚ), **𝔻 (𝔻)**, 𝔸 (𝔸), 𝔹 (𝔹), 𝔼 (𝔼), 𝔽 (𝔽), 𝔾 (𝔾), ℍ (ℍ), 𝕀 (𝕀), 𝕁 (𝕁), 𝕂 (𝕂), 𝕃 (𝕃), 𝕄 (𝕄), 𝕆 (𝕆), ℙ (ℙ), 𝕊 (𝕊), 𝕋 (𝕋), 𝕌 (𝕌), 𝕍 (𝕍), 𝕎 (𝕎), 𝕏 (𝕏), 𝕐 (𝕐)
100+
- Greek letters: α (α), β (β), γ (γ), δ (δ), ε (ε), η (η), θ (θ), λ (λ), μ (μ), ν (ν), π (π), σ (σ), τ (τ), φ (φ), ψ (ψ), χ (χ), ω (ω), Γ (Γ), Δ (Δ), Θ (Θ), Λ (Λ), Σ (Σ), Φ (Φ), Ψ (Ψ), Ω (Ω)
101101
- Other: ∞ (∞), × (×), ⋅ (⋅), ± (±), ∠ (∠), ⊕ (⊕), ⊗ (⊗)
102102

103+
**CRITICAL**: Blackboard bold letters (especially **𝔻**) frequently appear in exams and MUST be converted to HTML entities. This is a common source of accessibility violations.
104+
103105
### Step 6: Handle Images (Diagrams, Figures)
104106
**IMPORTANT**: Many exams contain diagrams (commutative diagrams, geometric figures, knot diagrams, etc.) that are extracted by Mathpix.
105107

@@ -221,36 +223,131 @@ After saving the HTML file, you MUST update the link in `graduate/general_exams.
221223
- Clearly labeling the PDF as "for printing" to indicate its purpose
222224
- Using ARIA labels to communicate that PDFs may have accessibility limitations
223225

224-
### Step 10: Final Review - Read Both Files
225-
After completing all processing steps, you MUST read both the original PDF and the generated HTML file to provide a final quality assessment:
226+
### Step 10: COMPREHENSIVE LEGAL COMPLIANCE AUDIT
227+
**⚠️ CRITICAL**: This step is MANDATORY as accessibility violations expose the website to ADA lawsuits. All items must pass.
228+
229+
After completing all processing steps, you MUST:
230+
1. Read both the original PDF and the generated HTML file
231+
2. Perform a thorough WCAG 2.1 Level AA compliance audit
232+
3. Fix any violations immediately before declaring the file production-ready
226233

227234
```bash
228235
# Read both files
229236
Read <PATH_TO_PDF>
230237
Read <PATH_TO_HTML>
231238
```
232239

233-
**Review and report on:**
234-
1. **Content Accuracy**: Verify that all mathematical expressions, problems, and text from the PDF are correctly represented in the HTML
235-
2. **MathML Quality**: Confirm that math expressions render correctly as MathML (not SVG or Unicode)
236-
3. **Accessibility**: Check that all accessibility features are present and correct:
237-
- Proper title and H1 heading
238-
- **H2 headings for EVERY problem** (e.g., "Problem 1", "Problem 2", etc.)
239-
- Breadcrumb and back button navigation
240-
- ARIA labels on math elements
241-
- Semantic HTML structure
242-
4. **Formatting and Spacing**: Ensure the HTML preserves the PDF's visual structure:
243-
- Proper vertical spacing between main problems
244-
- Problem structure is clear and readable
245-
5. **Completeness**: Verify nothing was lost or corrupted during conversion
246-
- Count problems in PDF and verify matching H2 headings in HTML
247-
248-
**Provide a concise summary stating:**
249-
- ✓ What looks correct
250-
- ⚠️ Any issues found (and fix them if possible)
251-
- Overall assessment: "Ready for production" or "Needs fixes"
252-
253-
This final human-in-the-loop check ensures quality before the files go live.
240+
## WCAG 2.1 Level AA Compliance Checklist
241+
242+
### 1. Document Structure (WCAG 1.3.1, 2.4.1)
243+
- [ ] Valid HTML5 DOCTYPE present
244+
- [ ] `lang="en"` attribute on `<html>` element
245+
- [ ] UTF-8 character encoding declared
246+
- [ ] Viewport meta tag for mobile accessibility
247+
248+
### 2. Page Title (WCAG 2.4.2)
249+
- [ ] Descriptive `<title>` tag present (e.g., "Analysis General Exam August 2017 - UVA Mathematics")
250+
- [ ] Title accurately describes page content
251+
252+
### 3. Semantic Heading Hierarchy (WCAG 1.3.1, 2.4.6) **[CRITICAL]**
253+
- [ ] Exactly ONE H1 heading (exam title)
254+
- [ ] H2 heading for EVERY problem (e.g., `<h2 class="unnumbered" id="problem-1">Problem 1</h2>`)
255+
- [ ] No skipped heading levels (H1 → H2, never H1 → H3)
256+
- [ ] Each heading has unique `id` attribute
257+
- [ ] Count problems in PDF = count of H2 headings in HTML
258+
259+
### 4. Landmark Elements (WCAG 1.3.1, 2.4.1)
260+
- [ ] Breadcrumb `<nav>` with `aria-label="Breadcrumb"`
261+
- [ ] Page navigation `<nav>` with `aria-label="Page navigation"`
262+
- [ ] Main content wrapped in `<main>` element
263+
- [ ] Proper opening/closing tags for all landmarks
264+
265+
### 5. Navigation Accessibility (WCAG 2.4.4, 2.4.8, 4.1.2)
266+
- [ ] Breadcrumb uses ordered list (`<ol>`)
267+
- [ ] Breadcrumb separators have `aria-hidden="true"`
268+
- [ ] Current page marked with `aria-current="page"`
269+
- [ ] Back button is semantic `<a>` element with descriptive text
270+
- [ ] All links have clear, descriptive text
271+
272+
### 6. MathML Accessibility (WCAG 1.3.1, 1.4.5, 4.1.2) **[CRITICAL]**
273+
**Audit ALL math elements - check a representative sample:**
274+
- [ ] All have `role="math"`
275+
- [ ] All have `aria-label` with LaTeX source
276+
- [ ] All have `xmlns="http://www.w3.org/1998/Math/MathML"`
277+
- [ ] All use `<semantics>` wrapper
278+
- [ ] All have `<annotation encoding="application/x-tex">`
279+
280+
### 7. Unicode Character Verification **[LAWSUIT RISK - CRITICAL]**
281+
**NO Unicode mathematical characters allowed. All MUST be HTML entities.**
282+
283+
Run these verification commands:
284+
```bash
285+
# Check for Unicode mathematical operators (U+2200-U+22FF)
286+
grep -P '[\x{2200}-\x{22FF}]' <PATH_TO_HTML>
287+
288+
# Check for Unicode mathematical alphanumeric symbols (U+1D400-U+1D7FF)
289+
# This includes blackboard bold: 𝔸 𝔹 ℂ 𝔻 𝔼 𝔽 𝔾 ℍ 𝕀 𝕁 𝕂 𝕃 𝕄 ℕ 𝕆 ℙ ℚ ℝ 𝕊 𝕋 𝕌 𝕍 𝕎 𝕏 𝕐 ℤ
290+
grep -P '[\x{1D400}-\x{1D7FF}]' <PATH_TO_HTML>
291+
292+
# Check for common Greek letters
293+
grep -P '[α-ωΑ-Ω]' <PATH_TO_HTML>
294+
```
295+
296+
**If ANY Unicode characters are found, FIX IMMEDIATELY:**
297+
- **Most common violation**: 𝔻 (U+1D53B) → Must be `&Dopf;`
298+
- ℝ → `&Ropf;`, ℂ → `&Copf;`, ℕ → `&Nopf;`, ℤ → `&Zopf;`, ℚ → `&Qopf;`
299+
- → → `&rarr;`, ≥ → `&ge;`, ≤ → `&le;`, ∈ → `&isin;`, ∞ → `&infin;`
300+
- α → `&alpha;`, β → `&beta;`, π → `&pi;`, φ → `&phi;`, ψ → `&psi;`, χ → `&chi;`
301+
302+
**Manual inspection required for:**
303+
- [ ] Check `<mi>` elements inside `<math>` tags for raw Unicode
304+
- [ ] Verify blackboard bold letters (𝔻, ℝ, ℂ, ℕ, ℤ, ℚ) use entities
305+
- [ ] Verify Greek letters use entities
306+
- [ ] Verify mathematical operators use entities
307+
308+
### 8. Color Contrast (WCAG 1.4.3)
309+
- [ ] Body text has minimum 4.5:1 contrast ratio (7:1 for AA)
310+
- [ ] Link colors have sufficient contrast
311+
- [ ] Navigation elements have sufficient contrast
312+
313+
### 9. Keyboard Accessibility (WCAG 2.1.1, 2.4.3, 2.4.7)
314+
- [ ] All interactive elements keyboard accessible
315+
- [ ] Logical tab order (breadcrumb → back → main content)
316+
- [ ] No keyboard traps
317+
318+
### 10. Mobile/Responsive (WCAG 1.4.4, 1.4.10)
319+
- [ ] Responsive meta viewport tag present
320+
- [ ] Flexible layout (no fixed widths)
321+
- [ ] Mobile-specific CSS (@media queries)
322+
323+
### 11. Content Quality (WCAG 3.1.1, 3.1.2)
324+
- [ ] Language declared: `lang="en"`
325+
- [ ] All content is in declared language
326+
327+
## Legal Compliance Summary
328+
329+
After completing the audit, provide:
330+
331+
**✅ PASS / ❌ FAIL Summary:**
332+
- Document Structure: [PASS/FAIL]
333+
- Page Title: [PASS/FAIL]
334+
- Heading Hierarchy: [PASS/FAIL]
335+
- Landmark Elements: [PASS/FAIL]
336+
- Navigation: [PASS/FAIL]
337+
- MathML: [PASS/FAIL]
338+
- **Unicode Verification: [PASS/FAIL]** ← CRITICAL
339+
- Color Contrast: [PASS/FAIL]
340+
- Keyboard: [PASS/FAIL]
341+
- Mobile: [PASS/FAIL]
342+
- Content: [PASS/FAIL]
343+
344+
**Final Verdict:**
345+
- ✅ **PRODUCTION READY** - All WCAG 2.1 Level AA requirements met. Lawsuit risk: MINIMAL.
346+
- ❌ **NOT PRODUCTION READY** - Fix violations immediately before deployment.
347+
348+
**If ANY items fail: FIX THEM IMMEDIATELY. Do not proceed until all items pass.**
349+
350+
This comprehensive audit ensures legal compliance and protects the university from ADA lawsuits.
254351

255352
## Important Notes
256353
- **CONCURRENT EXECUTION**: This command uses unique PDF_ID-based filenames in `/tmp/`, so multiple instances can run simultaneously without conflicts
@@ -263,20 +360,42 @@ This final human-in-the-loop check ensures quality before the files go live.
263360
- Verify proper heading hierarchy (use grep or check a sample)
264361
- The final HTML should be fully accessible with screen readers
265362

266-
## Success Criteria
267-
The output HTML must have:
268-
✓ Actual MathML elements (<math>, <mrow>, <mi>, <mo>, etc.)
269-
✓ NO Unicode characters - all replaced with HTML/MathML entities
270-
✓ Proper heading hierarchy (H1 for title, H2 for EVERY problem)
271-
✓ **H2 heading for each problem** (e.g., `<h2 class="unnumbered" id="problem-1">Problem 1</h2>`)
272-
✓ ARIA attributes on all math elements (role="math", aria-label)
273-
✓ lang="en" attribute on <html> element
274-
✓ Descriptive page title derived from H1 content (e.g., "TITLE - UVA Mathematics")
275-
✓ Breadcrumb navigation with aria-label="Breadcrumb" at top
276-
✓ Back button navigation with aria-label="Page navigation" below breadcrumb
277-
✓ Main content wrapped in <main> landmark element
363+
## Success Criteria - WCAG 2.1 Level AA Compliance
364+
365+
The output HTML must meet ALL of these criteria to be production-ready:
366+
367+
### Technical Requirements
368+
✓ Actual MathML elements (`<math>`, `<mrow>`, `<mi>`, `<mo>`, etc.)
369+
**NO Unicode characters** - all replaced with HTML/MathML entities (especially **𝔻 → &Dopf;**)
370+
✓ Proper heading hierarchy (ONE H1, H2 for EVERY problem, no skipped levels)
371+
✓ H2 heading for each problem (e.g., `<h2 class="unnumbered" id="problem-1">Problem 1</h2>`)
372+
✓ ARIA attributes on all math elements (`role="math"`, `aria-label` with LaTeX)
373+
`lang="en"` attribute on `<html>` element
374+
✓ Descriptive page title (e.g., "Analysis General Exam August 2017 - UVA Mathematics")
375+
✓ Breadcrumb navigation with `aria-label="Breadcrumb"`
376+
✓ Back button navigation with `aria-label="Page navigation"`
377+
✓ Main content wrapped in `<main>` landmark element
278378
✓ Valid, well-formed HTML5 document with proper semantic structure
279379
✓ Proper vertical spacing between main problems
280380
✓ HTML file saved next to the PDF with .html extension
281-
✓ Link in graduate/general_exams.md updated with HTML as primary, PDF as secondary with aria-label
282-
✓ Both PDF and HTML reviewed side-by-side with final quality assessment provided
381+
✓ Link in `graduate/general_exams.md` updated (HTML primary, PDF secondary with aria-label)
382+
383+
### Legal Compliance Requirements
384+
**WCAG 2.1 Level AA compliant** - All 11 checklist items pass
385+
**Unicode verification passed** - No raw Unicode mathematical characters
386+
**Screen reader compatible** - All math properly labeled with ARIA
387+
**Keyboard accessible** - Logical tab order, no traps
388+
**Mobile responsive** - Viewport meta tag, flexible layout
389+
**Color contrast compliant** - Minimum 4.5:1 ratio for text
390+
**Semantic structure** - Proper landmarks, headings, lists
391+
**ADA Title II & III compliant** - Ready for public deployment
392+
**Section 508 compliant** - Federal accessibility standards met
393+
394+
### Final Review Completed
395+
✓ Both PDF and HTML reviewed side-by-side
396+
✓ Comprehensive WCAG 2.1 Level AA audit performed
397+
✓ All violations fixed immediately
398+
✓ Legal compliance summary provided
399+
**Lawsuit risk: MINIMAL** - File is legally defensible
400+
401+
**If any criterion fails, the file is NOT production-ready and must be fixed immediately.**

0 commit comments

Comments
 (0)