Create professional quizzes with rich text formulas โข PDF export with templates โข 250 automated tests
Perfect for teachers who want a simple, reliable quiz tool that works anywhere
๐ฆ Download Latest Release โข ๐ฌ See Demo โข ๐ Get Started โข ๐ค Run Tests
- ๐งฎ Rich Text & Formulas: Chemical formulas (HโO), physics equations (E=mcยฒ), mathematical expressions
- ๐จ Visual Formatting: Bold, italic, underline, subscript, superscript with color-coded editors
- ๐ Works Everywhere: Safari, Chrome, Firefox, Edge - even without internet
- ๐ธ Image Support: Add pictures to questions with live preview
- ๐ฆ ZIP Packages: Share complete quizzes easily - students just upload and go
- ๐ฏ Educational Design: Teacher-friendly interface with clear "Quiz" terminology
- โก Zero Setup: Download, open in browser, start creating
- ๐ PDF Export: 3 professional templates (Student Quiz, Answer Key, Practice Sheet)
- ๐ Privacy First: All data stays on your device, no accounts needed
- ๐ค 100% Test Coverage: 250 automated tests across all browsers and mobile devices
- ๐ฑ Mobile Ready: Responsive design tested on iPhone, Android, and iPad
A comprehensive quiz generation and testing system with Unity integration for educational applications.
The quiz system now features a completely modular architecture with 73% code reduction and enhanced maintainability:
- ๐ง
quiz-loader.js
(189 lines) - Module system with validation and dependency checking - โ๏ธ
quiz-utils.js
(225 lines) - Utility functions for format conversion and calculations - ๐
quiz-richtext.js
(367 lines) - Quill.js integration for mathematical formulas - ๐พ
quiz-data.js
(722 lines) - Data management, import/export, and test library - ๐จ
quiz-ui.js
(646 lines) - UI components, dialogs, and rendering - โ
quiz-questions.js
(374 lines) - Question CRUD operations and management - ๐
quiz-pdf.js
(821 lines) - PDF export with 3 professional templates
window.QuizModules = {
Loader: { registerModule, validateAPI, initializeModules },
Utils: { deltaToHtml, convertAnswerFormats, getDifficultyColor },
RichText: { initializeQuillEditor, getQuestionContent },
Data: { loadTestLibrary, saveTestLibrary, generateJSON },
UI: { renderQuestions, showSuccessDialog, toggleSidebar },
Questions: { addOrUpdateQuestion, editQuestion, deleteQuestion },
PDF: { generateStudentQuiz, generateAnswerKey, generatePracticeSheet }
};
- Maintainability: Clear separation of concerns across focused modules
- Testability: Each module can be tested independently with isolated APIs
- Reusability: Modules can be used in other projects following the same patterns
- Debuggability: Module-specific logging and error handling
- Offline-First: Global namespace ensures compatibility without ES6 imports
Coming Soon! We're preparing beautiful screenshots to show you the teacher-friendly interface in action.
For now, try it yourself: Download the files and open
src/frontend/quizGenerator.html
in your browser!
This project consists of two main components:
- Quiz Generator: A web-based tool for creating and managing quiz questions
- Quiz Test Runner: A web-based interface for taking quizzes and reporting results
- โ Rich Text Editor with Quill.js integration for mathematical formulas
- โ Chemical Formulas: HโO, COโ, NaCl with proper subscript formatting
- โ Physics Equations: E=mcยฒ, F=ma with superscript support
- โ Color-Coded Options: Each answer (A-F) has themed toolbar (green, blue, orange, red, purple, cyan)
- โ Multiple Question Types: Multiple choice (2-6 options) and True/False
- โ Dedicated Quiz Creation: "Start Fresh Quiz" button always available
- โ Image support with live preview and smart file handling
- โ Set difficulty levels (Easy, Medium, Hard) with visual indicators
- โ Assign point values to questions (1-10 points)
- โ Category organization for subject-based quizzes
- โ PDF Export: 3 professional templates with rich text preservation
- โ ZIP package export with images in separate folder (recommended)
- โ Triple format storage: Plain text, HTML, and Delta for maximum compatibility
- โ Load and edit existing quiz data with proper rich text preservation
- โ Offline functionality - works without internet connection
- โ Rich Text Display: Mathematical formulas and formatting preserved perfectly
- โ Chemical Formulas: HโO, COโ rendered with proper subscripts
- โ Physics Equations: E=mcยฒ displayed with correct superscripts
- โ Universal browser support - Safari, Chrome, Firefox, Edge
- โ ZIP package upload with automatic extraction (all browsers)
- โ JSON file upload for embedded image and rich text quizzes
- โ Smart image loading with extension matching (.jpg/.jpeg support)
- โ Display questions with properly resolved images and rich formatting
- โ Multiple choice answer collection with letter-based answers
- โ Complete compatibility with old and new quiz formats
- โ Score calculation and detailed reporting
- โ Unity integration via messaging
- โ Debug logging for troubleshooting
- โ WebView integration with UniWebView
- โ JSON data communication
- โ Coin/points system integration
- โ Result tracking and display
quiz-system/
โโโ src/
โ โโโ frontend/ # Web-based quiz tools
โ โ โโโ quizGenerator.html # Main quiz creation interface
โ โ โโโ WebTest.html # Student quiz testing interface
โ โ โโโ css/ # Stylesheets
โ โ โ โโโ quiz-generator.css
โ โ โ โโโ quill-custom.css
โ โ โโโ lib/ # Third-party libraries
โ โ โ โโโ quill.min.js # Rich text editor
โ โ โ โโโ quill.snow.css
โ โ โโโ jszip.min.js # ZIP handling (offline)
โ โ โโโ js/ # JavaScript modules
โ โ โโโ quiz-generator.js # Main application (512 lines)
โ โ โโโ modules/ # Modular architecture (v1.4.0)
โ โ โโโ quiz-loader.js # Module system (189 lines)
โ โ โโโ quiz-utils.js # Utilities (225 lines)
โ โ โโโ quiz-richtext.js # Rich text (367 lines)
โ โ โโโ quiz-data.js # Data management (722 lines)
โ โ โโโ quiz-ui.js # UI components (646 lines)
โ โ โโโ quiz-questions.js # Question management (374 lines)
โ โ โโโ quiz-pdf.js # PDF export templates (821 lines)
โ โโโ unity/ # Unity C# scripts
โ โโโ SampleWebView.cs
โ โโโ SampleWebViewSim.cs
โโโ tests/ # Revolutionary test architecture with 250 tests
โ โโโ page-objects/ # Page Object Model with UI mapping
โ โ โโโ QuizGeneratorPage.js
โ โ โโโ WebTestPage.js
โ โโโ ui-mapping.json # UI element mapping abstraction
โ โโโ quiz-generator-clean.spec.js # Clean architecture tests
โ โโโ quiz-generator.spec.js # Rich text integration tests
โ โโโ quiz-test-runner.spec.js # Student interface tests
โ โโโ question-reordering.spec.js # Question management tests
โ โโโ mobile-responsiveness.spec.js # Mobile compatibility tests
โ โโโ pdf-export.spec.js # PDF export functionality tests
โ โโโ test-data/ # Sample images and quiz data
โโโ docs/ # Documentation
โโโ examples/ # Sample quiz data
โโโ playwright.config.js # Test configuration
โโโ .gitignore
โโโ CLAUDE.md # Development context and recovery instructions
โโโ README.md
- Download: Click the green "Code" button above โ "Download ZIP"
- Extract: Unzip the downloaded file anywhere on your computer
- Open: Double-click
src/frontend/quizGenerator.html
- Start Creating: Your browser opens with the quiz generator ready to go!
That's it! No installation, no accounts, no internet required.
- Open
src/frontend/quizGenerator.html
in a web browser - Click "โจ Create New Quiz"
- Add questions with the teacher-friendly interface:
- Write clear questions
- Add images if needed (with live preview)
- Set A/B/C/D answer options
- Choose difficulty and points
- Export Options:
- ๐ Export to PDF (3 professional templates)
- ๐ฆ Download ZIP Package (recommended for sharing)
- ๐ Download JSON Only (embedded format)
- Share files with students
- Open
src/frontend/WebTest.html
in a web browser - Toggle to "Local File Mode"
- Upload ZIP Package (easiest - works on all browsers):
- Select the ZIP file from your teacher
- Images and quiz load automatically
- OR Upload JSON File (if using embedded format)
- Answer questions and submit for results
- Extract ZIP package to a folder
- Use the folder picker in WebTest
- Images load from the extracted folder
- Import the C# scripts into your Unity project
- Set up UniWebView component
- Configure the WebView to load your quiz HTML files
- Handle results in your game logic
Our quiz system includes comprehensive automated testing to ensure reliability across all platforms.
- 250 total tests across 5 different browsers and devices - ALL PASSING
- 50 tests per platform: Each browser/device runs complete test suite
- Rich Text Testing: Mathematical formulas, chemical equations, formatting preservation
- UI Architecture Testing: Page Object Model with UI mapping abstraction layer
- End-to-End Testing: Complete workflow from quiz creation to student testing
- Desktop Browsers: Chromium โ , Firefox โ , WebKit (Safari) โ
- Mobile Devices: Mobile Chrome โ , Mobile Safari โ
- Rich Text Features: HโO, E=mcยฒ, bold/italic/underline formatting tested
- Cross-Platform Formulas: Mathematical expressions preserved across all platforms
# Install dependencies (first time only)
npm install
# Run all 250 tests (TRUE 100% passing!)
npm test
# Clean Architecture Tests (Modern Page Object Model)
npx playwright test tests/quiz-generator-clean.spec.js
# Specific test suites (ALL 100% PASSING โ
)
npx playwright test tests/question-reordering.spec.js # Question management
npx playwright test tests/quiz-generator.spec.js # Rich text integration
npx playwright test tests/mobile-responsiveness.spec.js # Mobile compatibility
npx playwright test tests/quiz-test-runner.spec.js # Student interface
npx playwright test tests/pdf-export.spec.js # PDF export functionality
# Interactive "bot vision" testing
npx playwright test --ui
# View test reports
npx playwright show-report
Run npx playwright test --ui
to experience "bot vision" testing:
- โจ Watch tests execute in real-time with rich text editors
- ๐ฎ Use timeline scrubber to replay mathematical formula input
- ๐ Inspect Quill.js rich text elements the bot interacts with
- ๐ฑ Switch between different devices and browsers
- ๐งฎ See chemical formulas (HโO) and physics equations (E=mcยฒ) being tested
- ๐จ Watch color-coded option editors in action
- Web: Modern web browser with ES6 support (works completely offline)
- Unity: Unity 2021.3+ with UniWebView package
- Testing: Node.js 16+ and npm (for running automated tests)
- Included Libraries:
- Quill.js (bundled locally for rich text editing with mathematical formulas)
- JSZip 3.10.1 (bundled locally for offline ZIP package support)
- Playwright 1.54.2+ (automated testing framework with 210 tests)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Run the test suite:
npm test
(all 250 tests must pass) - Test thoroughly across different browsers
- Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Submit a pull request
- All new features must include comprehensive Playwright tests
- Maintain cross-browser compatibility (Chrome, Firefox, Safari, Edge)
- Ensure mobile responsiveness with proper touch targets (44px minimum)
- Follow the existing teacher-friendly design patterns
- โ 3 PDF Templates: Student Quiz, Teacher Answer Key, Practice Worksheet
- โ Rich Text Preservation: Superscript/subscript formulas maintained in PDF (HโO, E=mcยฒ)
- โ Smart Image Integration: Automatic scaling with aspect ratio preservation (max 100mm x 60mm)
- โ Professional A4 Layout: Proper margins, typography, and page headers/footers
- โ Offline PDF Generation: Complete jsPDF integration for tablet/offline compatibility
- โ Comprehensive Testing: 40 new PDF export tests (250 total tests, 100% passing)
- โ Template Selection Dialog: User-friendly interface with template previews
- โ Multiple Export Formats: Student bubbles, filled answer keys, blank practice sheets
- โ Mathematical Formula Support: Delta and HTML format processing in PDFs
- โ Modular Architecture: New quiz-pdf.js module (821 lines) with clean separation
- โ Modular Architecture: Complete refactoring of 71KB monolithic file into 6 maintainable modules
- โ 73% Code Reduction: Main file reduced from 1,917 lines to 512 lines
- โ
Global Namespace Pattern: Offline-first compatibility with
window.QuizModules.*
structure - โ Module System: Comprehensive loader with validation, dependency checking, and initialization
- โ Separation of Concerns: Clear module boundaries for utilities, rich text, data, UI, and questions
- โ 100% Functionality Preserved: All existing features work identically with modular structure
- โ Enhanced Maintainability: Isolated responsibilities make debugging and feature additions easier
- โ Testability: Each module has clear APIs and can be tested independently
- โ Backward Compatibility: Existing quiz files continue to work without modification
- โ Bug Fixes: Resolved test library loading, focus issues, and global function accessibility
- โ Rich Text Editor Integration: Complete Quill.js integration with mathematical formula support
- โ Chemical Formulas: HโO, COโ, NaCl with proper subscript formatting throughout
- โ Physics Equations: E=mcยฒ, F=ma with superscript support for scientific notation
- โ Color-Coded Interfaces: Each answer option (A-F) has themed toolbar and editor
- โ Multiple Question Types: Support for 2-6 multiple choice options and True/False
- โ Quiz Terminology Standardization: Consistent "Quiz" usage throughout interface
- โ Dedicated Quiz Creation: "Start Fresh Quiz" button always available when editing
- โ Revolutionary Test Architecture: UI mapping abstraction layer with Page Object Model
- โ TRUE 100% Test Coverage: 210/210 tests passing across all browsers and platforms
- โ Triple Format Storage: Plain text, HTML, and Delta formats for maximum compatibility
- โ Cross-Platform Formula Preservation: Mathematical expressions maintained from creation to testing
- โ End-to-End Rich Text Testing: Complete workflow validation with formula preservation
- โ Backward Compatibility: Existing quizzes work seamlessly with new rich text features
- โ Major Code Refactoring: Separated HTML, CSS, and JavaScript into dedicated files
- โ 87% File Size Reduction: HTML file reduced from 1,915 lines to 244 lines
- โ
Improved Maintainability: Clean file structure with
css/
andjs/
directories - โ Test Library with Sidebar: Left sidebar menu for managing quiz collections
- โ Built-in Sample Tests: Pre-loaded math and science quizzes for immediate use
- โ Smart JSON Format Conversion: Automatic handling of different option formats
- โ Enhanced Button Behavior: Context-aware "Create New Quiz" vs "Add New Question"
- โ Test Metadata Display: Question count, total points, difficulty overview
- โ Duplicate Test Detection: Smart handling of test library imports
- โ Better Code Organization: Separation of concerns following web development best practices
- โ Future-Ready Architecture: Easier maintenance and feature additions
- โ Complete Playwright Test Suite: 108 automated tests across 6 browsers/devices
- โ Real Image Testing: Sample math formulas, diagrams, and visual elements
- โ Cross-Browser Testing: Chromium, Firefox, WebKit compatibility validation
- โ Mobile Device Testing: iPhone 12, Pixel 5, iPad Pro responsive testing
- โ
Interactive Bot Vision:
npm run test:ui
for real-time test watching - โ Teacher Interface Testing: Quiz creation, image upload, JSON generation (36 tests)
- โ Student Interface Testing: Quiz taking, image display, answer submission (36 tests)
- โ Mobile Responsiveness Testing: Touch targets, image sizing, layout validation (36 tests)
- โ Sample Test Data: Comprehensive test images and quiz examples
- โ Professional Test Infrastructure: Playwright configuration with cross-platform support
- โ ZIP Package Support: Upload and extract ZIP files in any browser
- โ Teacher-Friendly Interface: Professional educational design with emojis and clear language
- โ Offline JSZip Library: Complete offline functionality without internet dependency
- โ Smart Image Handling: Extension matching, data URL support, live previews
- โ Enhanced JSON Format: Labeled options (A/B/C/D) with letter-based correct answers
- โ Cross-Browser Compatibility: Full support for Safari, Firefox, Chrome, Edge
- โ Compact Question Cards: Horizontal layout with image thumbnails
- โ Better Error Handling: Debug logging and improved user feedback
- โ Backward Compatibility: Supports both old and new quiz formats
- โ Initial release with basic quiz generation and testing
- โ Unity integration with UniWebView
- โ JSON export/import functionality
- โ Basic image support
- Module Hot-Reloading: Development mode with live module updates
- Plugin System: Third-party modules with standardized APIs
- Module Lazy Loading: Load modules on-demand for better performance
- Module Configuration: Per-module settings and customization
- Inter-Module Communication: Event bus for decoupled module interaction
- Quick Assessment Mode: Rapid quiz taking with instant feedback
- Test Resubmission: Allow students to retake quizzes with improved scoring
- Question reordering (drag & drop) - partially implemented
- Additional question types (text input, fill-in-the-blank, matching)
- Question bank and templates library with rich text formulas
- Export to PDF/Word formats with preserved mathematical formatting
- Advanced analytics and reporting dashboard
- Real-time collaborative quiz editing with rich text synchronization
- Student progress tracking across multiple quizzes
- Quiz scheduling and time limits
- Advanced mathematical notation (LaTeX integration)
- Scientific notation and complex equations support
- Module-specific testing: Individual module test suites
- Visual regression testing: Screenshot comparisons with module isolation
- Performance testing: Module load time and memory usage optimization
- Automated accessibility (a11y) testing integration
- Module dependency graph visualization
- Code splitting and tree shaking: Remove unused module features
This project is for educational use. Please respect any licensing requirements for UniWebView if used commercially.
For questions or issues, please open an issue on GitHub.