Go to file
StillHammer 53ff0adde9 Add SBS chapter 10, SBS 3-10 fusion, and WTE2 chapter 4
- Add SBS chapter 10: Simple Present Yes/No Questions & Negatives
  * Master Yes/No questions (Do/Does)
  * Learn negatives (don't/doesn't)
  * Practice short answers
  * Days of the week vocabulary
  * 125 vocabulary words, 17 phrases, 6 dialogs

- Add SBS 3-10 fusion chapter: Present Continuous vs Simple Present
  * Contrast present continuous (NOW) vs simple present (ALWAYS)
  * Combined 150 vocabulary words from both chapters
  * 7 texts showing both tenses in context
  * Comprehensive tense comparison exercises

- Add WTE2 chapter 4: More About Animals - Present Continuous
  * Learn animal actions with present continuous (is/are + -ing)
  * Fun Zoo story with Danny and elephants
  * Phonics: L and R sounds
  * Silly vs logical statements
  * 47 vocabulary words, 7 dialogs, miming game activity

- Update book metadata files
  * sbs.json: Add chapter 10 to available chapters
  * sbs-fusion.json: Add chapter 3-10 fusion
  * wte2.json: Add chapter 4

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:02:09 +08:00
archie_class_homework Add diagnostic homework for Archie's class and WTE2 content 2025-11-08 23:22:52 +08:00
assets Implement comprehensive AI text report/export system 2025-09-26 21:24:13 +08:00
content Add SBS chapter 10, SBS 3-10 fusion, and WTE2 chapter 4 2025-11-29 23:02:09 +08:00
docs Add LEDU Chinese course content and documentation 2025-10-15 07:25:53 +08:00
Legacy Add Hanyu Jiaocheng content and improve game UX 2025-10-23 11:43:56 +08:00
saves Save current state before exploring first DRS commit 2025-10-12 08:47:23 +08:00
src Add diagnostic homework planning documentation 2025-11-06 19:59:59 +08:00
tests Unify vocabulary persistence system - remove dual systems 2025-09-30 13:39:00 +08:00
.envTMP Implement comprehensive AI text report/export system 2025-09-26 21:24:13 +08:00
.gitignore Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
00_COMMENCE_ICI.txt Reduce game sizes and fix Mario level display 2025-10-18 16:22:33 +08:00
CHECKLIST_USB.txt Reduce game sizes and fix Mario level display 2025-10-18 16:22:33 +08:00
CLAUDE.md Add LEDU Chinese course content and documentation 2025-10-15 07:25:53 +08:00
DEPLOYMENT_CHECKLIST.md Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
DEPLOYMENT_GUIDE.md Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
DIAGNOSTIC_REPORT.txt Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
DIAGNOSTIC.bat Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
DOWNLOAD_NODEJS.bat Reduce game sizes and fix Mario level display 2025-10-18 16:22:33 +08:00
DRS_IMPLEMENTATION_PLAN.md Implement strict DRS interface system for all 11 exercise modules 2025-10-08 13:43:25 +08:00
DRS.md Implement intelligent DRS vocabulary system with Smart Guide integration 2025-09-30 08:26:30 +08:00
FIREFOX_REQUIS.txt Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
fix-server.bat Implement comprehensive AI text report/export system 2025-09-26 21:24:13 +08:00
index.html Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
LISEZMOI.txt Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
package-lock.json Implement comprehensive AI text report/export system 2025-09-26 21:24:13 +08:00
package.json Implement comprehensive AI text report/export system 2025-09-26 21:24:13 +08:00
PLAN_B_STRATEGY.txt Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
PORTABLE_SETUP.txt Reduce game sizes and fix Mario level display 2025-10-18 16:22:33 +08:00
QUICK_START.txt Reduce game sizes and fix Mario level display 2025-10-18 16:22:33 +08:00
README_DEPLOYMENT.txt Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
README_PORTABLE.md Reduce game sizes and fix Mario level display 2025-10-18 16:22:33 +08:00
README.md Complete architectural rewrite with ultra-modular system 2025-09-22 07:08:39 +08:00
restart-clean.bat Implement comprehensive AI text report/export system 2025-09-26 21:24:13 +08:00
server.js Implement comprehensive AI text report/export system 2025-09-26 21:24:13 +08:00
SMART_PREVIEW_SPECS.md Implement comprehensive AI text report/export system 2025-09-26 21:24:13 +08:00
SPAM_CLICK_FIXES.md Add diagnostic homework planning documentation 2025-11-06 19:59:59 +08:00
START_PORTABLE_SAFE.bat Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
START_PORTABLE.bat Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
start-portable.bat Unify vocabulary persistence system - remove dual systems 2025-09-30 13:39:00 +08:00
start.bat Implement comprehensive AI text report/export system 2025-09-26 21:24:13 +08:00
TEAM_WIZARD_BATTLE_README.md Add diagnostic homework planning documentation 2025-11-06 19:59:59 +08:00
test_tts_import.mjs Add TTS service, deployment docs, and refactor game modules 2025-10-18 23:41:12 +08:00
test-api.bat Implement comprehensive AI text report/export system 2025-09-26 21:24:13 +08:00
test-factory.html Implement ExerciseFactory with strict DRS interface enforcement 2025-10-08 15:39:53 +08:00
TEST-GUIDE.md Add comprehensive testing suite with UI/UX and E2E integration tests 2025-09-28 23:04:38 +08:00
test-team-wizard.html Add diagnostic homework planning documentation 2025-11-06 19:59:59 +08:00
TODO.md Add Hanyu Jiaocheng content and improve game UX 2025-10-23 11:43:56 +08:00
WTE2-2_Feedbacks.md Add SBS chapter 10, SBS 3-10 fusion, and WTE2 chapter 4 2025-11-29 23:02:09 +08:00

Class Generator 2.0

Educational Games Platform with Ultra-Modular Architecture

A complete rewrite of the Class Generator system using strict modular design patterns, vanilla JavaScript, and rigorous separation of concerns.

🚀 Quick Start

Method 1: Batch File (Windows)

# Double-click or run:
start.bat

Method 2: Command Line

# Install Node.js (if not already installed)
# Then run:
node server.js

# Or using npm:
npm start

Method 3: NPM Scripts

npm run dev     # Start development server
npm run serve   # Same as start

Server will start on: http://localhost:3000

🏗️ Architecture Overview

Core System (Ultra-Rigid)

  • Module.js - Abstract base class with sealed instances and WeakMap privates
  • EventBus.js - Strict event system with validation and type safety
  • ModuleLoader.js - Dependency injection with proper initialization order
  • Router.js - Navigation with guards, middleware, and state management
  • Application.js - Bootstrap system with auto-initialization

Key Architecture Principles

Inviolable Responsibility - Each module has exactly one purpose Zero Direct Dependencies - All communication via EventBus Sealed Instances - Modules cannot be modified after creation Private State - Internal data completely inaccessible Contract Enforcement - Abstract methods must be implemented Dependency Injection - No global access, everything injected

📁 Project Structure

├── src/
│   ├── core/           # Core system modules (sealed)
│   │   ├── Module.js
│   │   ├── EventBus.js
│   │   ├── ModuleLoader.js
│   │   ├── Router.js
│   │   └── index.js
│   ├── components/     # Reusable UI components
│   ├── games/          # Game modules
│   ├── content/        # Content modules
│   ├── styles/         # Modular CSS
│   └── Application.js  # Main application bootstrap
├── Legacy/             # Old system (archived)
├── index.html         # Entry point
├── server.js          # Development server
├── start.bat          # Windows quick start
└── package.json       # Node.js configuration

🔥 Features

Development Server

  • ES6 Modules - Full import/export support
  • CORS Enabled - For online communication
  • Hot Reload Ready - Manual refresh (planned: auto-refresh)
  • Proper MIME Types - All file types supported
  • Security Headers - Basic security implemented

Application System

  • Auto-Start - No commands needed, just open in browser
  • Loading Screen - Elegant initialization feedback
  • Debug Panel - F12 to toggle, shows system status
  • Error Handling - Graceful error recovery
  • Network Status - Real-time connectivity indicator

Module System

  • Strict Validation - Errors if contracts violated
  • Lifecycle Management - Proper init/destroy patterns
  • Event-Driven - Loose coupling via events
  • Dependency Resolution - Automatic dependency loading

🎮 Creating Game Modules

import Module from '../core/Module.js';

class MyGame extends Module {
    constructor(name, dependencies, config) {
        super(name, ['eventBus', 'ui']);

        this._eventBus = dependencies.eventBus;
        this._ui = dependencies.ui;
        this._config = config;
    }

    async init() {
        // Initialize game
        this._eventBus.on('game:start', this._handleStart.bind(this), this.name);
        this._setInitialized();
    }

    async destroy() {
        // Cleanup
        this._setDestroyed();
    }

    _handleStart(event) {
        // Game logic here
    }
}

export default MyGame;

🧩 Adding to Application

// In Application.js modules config:
{
    name: 'myGame',
    path: './games/MyGame.js',
    dependencies: ['eventBus', 'ui'],
    config: { difficulty: 'easy' }
}

🐛 Debugging

Debug Panel (F12)

  • System status and uptime
  • Loaded modules list
  • Event history
  • Performance metrics

Console Access

// Global app instance available in console:
window.app.getStatus()           // Application status
window.app.getCore().eventBus    // Access EventBus
window.app.getCore().router      // Access Router

Common Issues

Module loading fails:

  • Check file paths in Application.js
  • Verify module extends Module base class
  • Ensure all dependencies are listed

Events not working:

  • Verify module is registered with EventBus
  • Check event type strings match exactly
  • Ensure module is initialized before emitting

🔒 Security & Rigidity

The architecture enforces several levels of protection:

  1. Sealed Classes - Object.seal() prevents property addition/deletion
  2. Frozen Prototypes - Object.freeze() prevents method modification
  3. WeakMap Privates - Internal state completely hidden
  4. Abstract Enforcement - Missing methods throw errors
  5. Validation Layers - Input validation at every boundary

Violation attempts will throw explicit errors with helpful messages.

🚀 Next Steps

  1. Create Game Modules - Implement actual games using new architecture
  2. Add Content System - Port content loading from Legacy system
  3. UI Components - Build reusable component library
  4. Performance - Add lazy loading and caching
  5. Testing - Add automated test suite

📝 Migration from Legacy

The Legacy/ folder contains the complete old system. Key differences:

  • Old: Global variables and direct coupling

  • New: Strict modules with dependency injection

  • Old: CSS modifications in global files

  • New: Component-scoped CSS injection

  • Old: Manual module registration

  • New: Automatic loading with dependency resolution


Built with strict architectural principles for maintainable, scalable educational software.