Class_generator/test-chinese-beginner-grammar.html
StillHammer e50dd624a0 Add comprehensive game suite with TTS integration and content modules
🎮 NEW GAMES:
- River Run: Endless runner with word collection and guaranteed target spawning
- Grammar Discovery: Focused grammar learning with 8-step rotation cycles
- Letter Discovery: Letter-first alphabet learning with progression system
- Enhanced Word Discovery: Shuffled practice mode with image support and auto-TTS

📚 NEW CONTENT MODULES:
- WTA1B-1: English letters U,V,T with pets vocabulary and Chinese translation
- SBS-1: English "To Be" introduction with comprehensive grammar lessons
- French Beginner Story: Story content for English speakers learning French

🔊 TTS ENHANCEMENTS:
- Story Reader: Multi-story support with TTS for sentences and individual words
- Adventure Reader: Auto-TTS for vocabulary popups and sentence modals
- Word Discovery: Immediate TTS playback with difficulty-based speed control
- Integrated SettingsManager compatibility across all games

🎯 GAMEPLAY IMPROVEMENTS:
- River Run: Target word guaranteed within 10 spawns, progressive spacing
- Story Reader: Story selector dropdown with independent progress tracking
- Adventure Reader: Fixed HUD overlap issue with proper viewport spacing
- Enhanced punctuation preservation in Story Reader word parsing

 SYSTEM UPDATES:
- Content scanner integration for all new modules
- Game loader mappings for seamless content discovery
- Simplified content titles: "WTA1B-1" and "SBS-1" for easy identification
- Comprehensive test files for isolated game development

🎉 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-20 09:15:01 +08:00

96 lines
3.7 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test Chinese Beginner + Grammar Discovery</title>
<style>
body { margin: 0; padding: 20px; font-family: Arial, sans-serif; }
#container { width: 100%; height: 85vh; border: 2px solid #ddd; border-radius: 10px; }
.controls { margin-bottom: 20px; }
button { padding: 10px 20px; margin: 5px; border: none; border-radius: 5px; background: #667eea; color: white; cursor: pointer; }
button:hover { background: #5a67d8; }
.info { background: #f0fff4; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
</style>
</head>
<body>
<h1>🌸 Test: Chinese Beginner Story + Grammar Discovery</h1>
<div class="info">
<h3>🎯 Test du nouveau module "Le Jardin Magique"</h3>
<p><strong>Objectif :</strong> Vérifier que le contenu chinois → français fonctionne avec Grammar Discovery</p>
<p><strong>Attendu :</strong> Sélecteur de concept avec "Structure de Phrase de Base"</p>
</div>
<div class="controls">
<button onclick="startGame()">🚀 Start Grammar Discovery</button>
<button onclick="restartGame()">🔄 Restart</button>
</div>
<div id="container"></div>
<script>
// Mock dependencies
window.logSh = (msg, level) => console.log(`[${level}] ${msg}`);
window.Utils = { storage: { get: () => [], set: () => {} } };
window.GameModules = {};
window.ContentModules = {};
// Mock SettingsManager for TTS
window.SettingsManager = {
speak: (text, options = {}) => {
console.log(`🔊 TTS: "${text}" (${options.lang || 'auto'} at ${options.rate || 1.0}x)`);
return Promise.resolve();
}
};
</script>
<script src="js/content/chinese-beginner-story.js"></script>
<script src="js/games/grammar-discovery.js"></script>
<script>
let currentGame = null;
function startGame() {
try {
const container = document.getElementById('container');
const content = window.ContentModules.ChineseBeginnerStory;
if (!content) {
console.error('❌ Chinese Beginner Story content not found');
return;
}
console.log('✅ Content loaded:', content.name);
console.log('📚 Grammar topics:', Object.keys(content.grammar || {}));
console.log('🔤 Vocabulary count:', Object.keys(content.vocabulary || {}).length);
console.log('📖 Story chapters:', content.story?.chapters?.length || 0);
currentGame = new window.GameModules.GrammarDiscovery({
container: container,
content: content,
onScoreUpdate: score => console.log('📊 Score updated:', score),
onGameEnd: score => console.log('🏁 Game ended with score:', score)
});
console.log('🎮 Grammar Discovery started with Chinese Beginner Story!');
} catch (error) {
console.error('❌ Error starting game:', error);
}
}
function restartGame() {
if (currentGame && currentGame.restart) {
currentGame.restart();
console.log('🔄 Game restarted');
}
}
// Auto-start when page loads
window.addEventListener('load', () => {
console.log('🔧 Testing Chinese Beginner Story with Grammar Discovery...');
console.log('📚 Expected: Concept selector with "Structure de Phrase de Base"');
setTimeout(startGame, 500);
});
</script>
</body>
</html>