|
| 1 | +# Quiz DocGen — `{{@Quiz:}}` Tag System |
| 2 | + |
| 3 | +## New Feature: Declarative Quiz Engine |
| 4 | + |
| 5 | +Full `{{@Quiz:}}` tag pipeline for creating interactive quizzes directly in markdown. |
| 6 | + |
| 7 | +### Core Engine (`quiz-docgen.js` — NEW, ~1100 lines) |
| 8 | +- Declarative `{{@Quiz:}}` tag parsed from markdown with `@subject`, `@difficulty`, `@mode`, `@userinfo`, `@css`, `@chapter`, and `@question[type]` fields |
| 9 | +- 9 question types: MCQ, True/False, Fill-in-blank, Match (drag-drop), Order (drag-drop), Short Answer, Essay, Likert, Multi-select |
| 10 | +- Two modes: **Practice** (Duolingo-style with instant feedback) and **Test** (free navigation, no answers revealed) |
| 11 | +- User info screen with configurable fields (name, email, id) and email format validation with visual feedback |
| 12 | +- Gamified HUD: XP counter, hearts/lives, progress bar, star rating |
| 13 | +- Response collection via `form-engine.js` — respondent answers stored in Firestore and viewable by creator |
| 14 | + |
| 15 | +### Test Mode Workflow |
| 16 | +- Navigation always enabled (no forced confirmation steps) |
| 17 | +- Short, Fill, and Essay answers recorded as `ok:null` (pending manual review) |
| 18 | +- Creator preview shows auto-graded vs pending breakdown |
| 19 | +- Response viewer has ✅ Correct / ❌ Wrong toggle buttons for manual grading |
| 20 | +- Score recalculates live when creator changes grades |
| 21 | + |
| 22 | +### Bug Fixes (8 bugs found and fixed via audit) |
| 23 | +1. Fixed `navDisabled` line with embedded `\n` literal → split into real newlines |
| 24 | +2. Score counter now separates auto-graded vs pending items (was counting pending as 0) |
| 25 | +3. Response viewer summary shows "X correct + Y pending review" instead of misleading total |
| 26 | +4. Added mobile touch support (touchstart/touchmove/touchend) for match and order drag-drop |
| 27 | +5. Removed dead `requireUserInfo()` function |
| 28 | +6. Keyword hints hidden from respondents (only visible to creator) |
| 29 | +7. Fixed wrong Unicode char in order text strip (`\u2800` → `\u283f`) |
| 30 | +8. Email validation: `checkValidity()` enforces format, red border + error message on invalid input |
| 31 | + |
| 32 | +### Templates (6 NEW quiz templates) |
| 33 | +- General Science (physics, chemistry, biology) |
| 34 | +- World History (ancient to modern) |
| 35 | +- English Grammar (parts of speech, tenses) |
| 36 | +- Computer Science (algorithms, data structures) |
| 37 | +- World Geography (continents, capitals, rivers) |
| 38 | +- Biology (cells, genetics, anatomy) |
| 39 | + |
| 40 | +### Styling (`quiz-docgen.css` — NEW, ~690 lines) |
| 41 | +- Full dark/light mode support |
| 42 | +- Gamified UI with gradients, animations, and responsive layout |
| 43 | +- Drag-drop visual feedback for match and order questions |
| 44 | + |
| 45 | +### Response Viewer (`form-engine.js` — MODIFIED) |
| 46 | +- NEEDS REVIEW badges for pending questions |
| 47 | +- Full answer text display (non-truncated) |
| 48 | +- Question type labels ([short], [fill], [essay]) |
| 49 | +- Yellow border indicator for manual-review items |
| 50 | +- ✅ Correct / ❌ Wrong grade toggle buttons with live score update |
| 51 | + |
| 52 | +### Files Changed |
| 53 | +- `js/quiz-docgen.js` — NEW (core quiz engine) |
| 54 | +- `css/quiz-docgen.css` — NEW (quiz styling) |
| 55 | +- `js/form-engine.js` — response viewer enhancements + grade toggle |
| 56 | +- `js/templates/quiz.js` — 6 new quiz templates |
| 57 | +- `js/renderer.js` — quiz tag integration |
| 58 | +- `js/ai-docgen.js` — quiz rendering hooks |
| 59 | +- `js/cloud-share.js` — quiz response storage |
| 60 | +- `index.html` — quiz module loading |
| 61 | +- `src/main.js` — quiz module registration |
| 62 | +- `css/modals.css` — response modal styling |
| 63 | +- `css/tts.css` — minor adjustments |
0 commit comments