Skip to content

Commit 51fe7bc

Browse files
committed
feat: Quiz DocGen — declarative quiz engine with test mode, manual grading, 8 templates, touch support, and bug fixes
1 parent 81424a9 commit 51fe7bc

File tree

13 files changed

+2539
-24
lines changed

13 files changed

+2539
-24
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ TextAgent has undergone significant evolution since its inception. What started
538538

539539
| Date | Commits | Feature / Update |
540540
|------|---------|-----------------:|
541+
| **2026-03-26** | | 🎓 **Quiz DocGen** — new `{{@Quiz:}}` declarative tag for interactive quizzes in markdown; 9 question types (MCQ, True/False, Fill-in-blank, Match, Order, Short, Essay, Likert, Multi-select); dual modes: Practice (Duolingo-style instant feedback) and Test (free navigation, no answers revealed); user info screen with email format validation; gamified HUD (XP, hearts, progress bar, stars); response viewer with NEEDS REVIEW badges, ✅ Correct / ❌ Wrong grade toggle for manual grading, live score recalculation; mobile touch support for match and order drag-drop; 8 quiz templates across 7 domains (Maths, Science, History, English, CS, Geography, Biology); `quiz-docgen.js` (~1100 lines), `quiz-docgen.css` (~690 lines), `form-engine.js` response viewer enhancements |
541542
| **2026-03-25** | | 📈 **Stock Dashboard Sizing** — Stock grid now supports custom card heights via `data-height` attribute and single stock cards automatically span full width for better layout utilization |
542543
| **2026-03-25** | |**Help Mode FAQ & Templates** — Help Mode popovers now feature interactive, copy-pasteable FAQ examples with one-click copy buttons and clickable Template chips that instantly load complete document examples; significantly improves the discoverability of advanced features like `{{@Form:}}` and `{{var}}` chaining directly from the toolbar |
543544
| **2026-03-25** | | 🧜 **Mermaid Diagram Catalog** — added a comprehensive template containing working syntax examples for all 18 natively supported Mermaid diagram types (including advanced Architecture, Sankey, and C4 diagrams); fixed a rendering issue with `requirementDiagram` in Mermaid v11.6 by quoting hyphenated IDs |
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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

css/modals.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,11 @@
934934
}
935935

936936
.form-fill-mode .form-dg-add-btn,
937-
.form-fill-mode .form-dg-remove {
937+
.form-fill-mode .form-dg-remove,
938+
.form-fill-mode .quiz-dg-add-wrap,
939+
.form-fill-mode .quiz-dg-remove,
940+
.form-fill-mode .quiz-dg-gen-btn,
941+
.form-fill-mode .quiz-dg-grade-btn {
938942
display: none !important;
939943
}
940944

0 commit comments

Comments
 (0)