diff --git a/ADVENTURE-READER-DRAGON-PEARL.md b/ADVENTURE-READER-DRAGON-PEARL.md deleted file mode 100644 index f9f0e48..0000000 --- a/ADVENTURE-READER-DRAGON-PEARL.md +++ /dev/null @@ -1,117 +0,0 @@ -# 🐉 ADVENTURE READER + DRAGON'S PEARL - CORRECTIONS - -## 🔍 ProblĂšme IdentifiĂ© - -Adventure Reader ne pouvait pas utiliser le contenu de Dragon's Pearl car il cherchait le contenu dans une structure **ultra-modulaire** (`content.rawContent.texts[]`) alors que Dragon's Pearl utilise une structure **custom** (`content.story.chapters[].sentences[]`). - -## 🔧 Corrections ApportĂ©es - -### 1. Support Structure Dragon's Pearl - -#### `extractSentences()` - Ligne 110-127 -```javascript -// Support pour Dragon's Pearl structure: content.story.chapters[].sentences[] -if (content.story && content.story.chapters && Array.isArray(content.story.chapters)) { - content.story.chapters.forEach(chapter => { - if (chapter.sentences && Array.isArray(chapter.sentences)) { - chapter.sentences.forEach(sentence => { - if (sentence.original && sentence.translation) { - sentences.push({ - original_language: sentence.original, - user_language: sentence.translation, - pronunciation: sentence.pronunciation || '', - chapter: chapter.title || '', - id: sentence.id || sentences.length - }); - } - }); - } - }); -} -``` - -#### `extractStories()` - Ligne 189-205 -```javascript -// Support pour Dragon's Pearl structure -if (content.story && content.story.chapters && Array.isArray(content.story.chapters)) { - // CrĂ©er une histoire depuis les chapitres de Dragon's Pearl - stories.push({ - title: content.story.title || content.name || "Dragon's Pearl", - original_language: content.story.chapters.map(ch => - ch.sentences.map(s => s.original).join(' ') - ).join('\n\n'), - user_language: content.story.chapters.map(ch => - ch.sentences.map(s => s.translation).join(' ') - ).join('\n\n'), - chapters: content.story.chapters.map(chapter => ({ - title: chapter.title, - sentences: chapter.sentences - })) - }); -} -``` - -#### `extractVocabulary()` - Ligne 78-100 -```javascript -// Support pour Dragon's Pearl vocabulary structure -if (content.vocabulary && typeof content.vocabulary === 'object') { - vocabulary = Object.entries(content.vocabulary).map(([original_language, vocabData]) => { - if (typeof vocabData === 'string') { - // Simple format: "word": "translation" - return { - original_language: original_language, - user_language: vocabData, - type: 'unknown' - }; - } else if (typeof vocabData === 'object') { - // Rich format: "word": { user_language: "translation", type: "noun", ... } - return { - original_language: original_language, - user_language: vocabData.user_language || vocabData.translation || 'No translation', - type: vocabData.type || 'unknown', - pronunciation: vocabData.pronunciation, - difficulty: vocabData.difficulty - }; - } - return null; - }).filter(item => item !== null); -} -``` - -## 🎯 RĂ©sultats - -Maintenant Adventure Reader peut : - -### ✅ Extraire les Phrases de Dragon's Pearl -- **150+ phrases** des chapitres 1-4 de l'histoire -- **Chinois original + traduction anglaise** -- **Prononciation pinyin** -- **Organisation par chapitres** - -### ✅ Utiliser le Vocabulaire -- **50+ mots chinois** avec traductions -- **Types grammaticaux** (noun, verb, adjective...) -- **Prononciation pinyin** - -### ✅ CrĂ©er l'Histoire ComplĂšte -- **Titre** : "The Dragon's Pearl - éŸ™ç äŒ èŻŽ" -- **Chapitres structurĂ©s** -- **Texte complet** pour l'aventure - -## 🎼 Fonctionnement en Jeu - -Quand tu lances **Adventure Reader** avec **Dragon's Pearl** : - -1. **Carte interactive** avec des pots đŸș et ennemis đŸ‘č -2. **Clique sur les pots** → Affiche des **phrases chinoises** de l'histoire -3. **Combat les ennemis** → Teste ton **vocabulaire chinois** -4. **Modal de lecture** → Affiche **chinois + anglais + pinyin** -5. **Progression** → Traverse toute l'histoire de Li Ming et le Dragon - -## 🔗 CompatibilitĂ© - -✅ **RĂ©trocompatible** : Fonctionne toujours avec l'ancien format ultra-modulaire -✅ **Dragon's Pearl** : Support complet de la structure custom -✅ **Autres contenus** : Tous les autres modules continuent de fonctionner - -Adventure Reader peut maintenant utiliser **toutes les phrases et tout le vocabulaire** de Dragon's Pearl pour crĂ©er une expĂ©rience d'apprentissage immersive ! 🐉✹ \ No newline at end of file diff --git a/COMPATIBILITY-SYSTEM.md b/COMPATIBILITY-SYSTEM.md deleted file mode 100644 index 03e4ff2..0000000 --- a/COMPATIBILITY-SYSTEM.md +++ /dev/null @@ -1,240 +0,0 @@ -# 🎯 SystĂšme de CompatibilitĂ© Content-Game - -## Vue d'Ensemble - -Le systĂšme de compatibilitĂ© Content-Game analyse automatiquement le contenu Ă©ducatif et dĂ©termine quels jeux sont optimaux pour chaque type de contenu. Il fournit des scores de compatibilitĂ©, des recommandations visuelles, et des suggestions d'amĂ©lioration. - -## 🔧 Architecture - -### Composants Principaux - -1. **`ContentGameCompatibility`** (`js/core/content-game-compatibility.js`) - - Moteur d'analyse de compatibilitĂ© - - Calculs de scores par type de jeu - - SystĂšme de suggestions d'amĂ©lioration - -2. **Navigation Intelligente** (`js/core/navigation.js`) - - IntĂ©gration avec le systĂšme de compatibilitĂ© - - Affichage sĂ©parĂ© des jeux compatibles/incompatibles - - Interface visuelle avec badges de compatibilitĂ© - -3. **Interface Visuelle** (`css/main.css`) - - Styles pour les badges de compatibilitĂ© - - Couleurs et animations - - Modal d'aide pour jeux incompatibles - -## 🎼 FonctionnalitĂ©s - -### Analyse de CompatibilitĂ© - -- **Scores automatiques** : 0-100% basĂ©s sur les besoins rĂ©els de chaque jeu -- **Seuils configurables** : Minimums personnalisables par jeu -- **Cache intelligent** : Optimisation des performances - -### Interface Utilisateur - -- **Badges visuels** : - - 🎯 **Excellent** (80%+) : Violet - - ✅ **RecommandĂ©** (60-79%) : Vert - - 👍 **Compatible** (seuil-59%) : Bleu-vert - - ⚠ **LimitĂ©** (= 30, - score, - reason: `Compatible: ${reasons.join(', ')}` - }; -} -``` - -### Styles Visuels - -Modifiez les couleurs dans `css/main.css` : - -```css -.compatibility-badge.excellent { - background: linear-gradient(135deg, #your-color, #your-color-2); -} -``` - -## 🚀 DĂ©ploiement - -### Fichiers Requis - -**Core System:** -- `js/core/content-game-compatibility.js` -- Modifications dans `js/core/navigation.js` -- Styles dans `css/main.css` - -**Chargement HTML:** -```html - - - -``` - -### Production - -1. Le systĂšme fonctionne automatiquement une fois intĂ©grĂ© -2. Aucune configuration supplĂ©mentaire requise -3. Compatible avec tous les contenus existants -4. Graceful fallback en cas d'erreur - -## đŸ› ïž Maintenance - -### Ajout de Nouveau Contenu - -Le systĂšme dĂ©tecte automatiquement les nouveaux modules. Aucune configuration requise. - -### DĂ©bogage - -Utilisez les logs intĂ©grĂ©s : -```javascript -// Activer debug dans la console -window.AppNavigation.compatibilityChecker.clearCache(); -``` - -### Monitoring - -Le systĂšme log automatiquement : -- Scores de compatibilitĂ© calculĂ©s -- Erreurs de chargement -- Suggestions gĂ©nĂ©rĂ©es - -## ✅ Statut - -**SYSTÈME COMPLET ET FONCTIONNEL** - -- ✅ Analyse automatique de compatibilitĂ© -- ✅ Interface utilisateur intĂ©grĂ©e -- ✅ Tests complets validĂ©s -- ✅ Documentation complĂšte -- ✅ PrĂȘt pour la production - -Le systĂšme Ă©vite maintenant d'afficher des jeux incompatibles et guide l'utilisateur vers les meilleurs choix selon le contenu disponible! \ No newline at end of file diff --git a/CORRECTION-APPLIQUÉE.txt b/CORRECTION-APPLIQUÉE.txt deleted file mode 100644 index a4d4a46..0000000 --- a/CORRECTION-APPLIQUÉE.txt +++ /dev/null @@ -1,41 +0,0 @@ - -🔧 CORRECTION APPLIQUÉE: CONVERSION HONNÊTE 🔧 -================================================ - -❌ AVANT (SYSTÈME DÉFAILLANT): - - Inventait type, difficulty_level, semantic_category, usage_frequency - - GĂ©nĂ©rais des examples et grammar_notes fantaisistes - - Hallucinait des mĂ©tadonnĂ©es inexistantes - - Fichier: 9.8 KB avec des donnĂ©es inventĂ©es - -✅ APRÈS (SYSTÈME CORRECT): - - Garde SEULEMENT les donnĂ©es rĂ©elles: mot → traduction - - Convertit le format mais n'invente RIEN - - Ajoute uniquement l'ID et la structure ultra-modulaire - - Fichier: 5.0 KB avec SEULEMENT des donnĂ©es vraies - -🎯 DONNÉES CONSERVÉES (LÉGITIMES): - - vocabulary: central → äž­ćżƒçš„ïŒ›äž­ć€źçš„ ✅ - - sentences: anglais → chinois ✅ - - difficulty_level: 7 (infĂ©rĂ© du nom 'Level 7-8') ✅ - - langues: dĂ©tectĂ©es des donnĂ©es ✅ - - tags: extraits du contenu rĂ©el ✅ - -đŸš« DONNÉES SUPPRIMÉES (INVENTÉES): - - types de mots ❌ - - niveaux de difficultĂ© par mot ❌ - - catĂ©gories sĂ©mantiques ❌ - - frĂ©quences d'usage ❌ - - exemples artificiels ❌ - - notes grammaticales ❌ - - skills_covered, target_audience ❌ - -💡 PRINCIPE APPRIS: - Un bon systĂšme de conversion doit ĂȘtre HONNÊTE: - - Transformer le format ✅ - - PrĂ©server les donnĂ©es ✅ - - JAMAIS inventer ❌ - -================================================ -SYSTÈME CORRIGÉ: Conversion fidĂšle et transparente ✅ - diff --git a/OPTIMISATION-GRILLE-JEUX.md b/OPTIMISATION-GRILLE-JEUX.md deleted file mode 100644 index beb7655..0000000 --- a/OPTIMISATION-GRILLE-JEUX.md +++ /dev/null @@ -1,71 +0,0 @@ -# 🎯 OPTIMISATION AFFICHAGE GRILLE DES JEUX - -## ✅ Modifications ApportĂ©es - -### 1. Taille Minimale des Colonnes RĂ©duite -```css -/* AVANT */ -grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); - -/* APRÈS */ -grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); -``` - -### 2. Cartes Plus Compactes -- **Padding** : `30px 25px` → `20px 15px` -- **Min-height** : `180px` → `160px` -- **Gap** : `25px` → `20px` - -### 3. Contenu des Cartes OptimisĂ© -- **Icon** : `3rem` → `2.5rem` -- **Title** : `1.4rem` → `1.2rem` -- **Description** : `0.95rem` → `0.85rem` -- **Marges** rĂ©duites - -### 4. Responsive AmĂ©liorĂ© - -#### Desktop (1200px+) -```css -grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); -min-height: 140px; -``` -**→ Jusqu'Ă  6 jeux par ligne sur grand Ă©cran** - -#### Tablette (768px) -```css -grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); -``` -**→ 3-4 jeux par ligne sur tablette** - -#### Mobile (480px) -```css -padding: 20px 15px; -``` -**→ 2 jeux par ligne mĂȘme sur mobile** - -## 🎯 RĂ©sultats Attendus - -### Avant (1 jeu par ligne) ❌ -``` -[ Whack-a-Mole ] -[ Memory Match ] -[ Quiz Game ] -[ Fill the Blank ] -``` - -### AprĂšs (Plusieurs jeux par ligne) ✅ -``` -[ Whack-a-Mole ] [ Memory Match ] [ Quiz Game ] -[ Fill Blank ] [ Text Reader ] [ Adventure ] -[ Story Reader ] [ Chinese Game ] [ Quiz Hard ] -``` - -## đŸ“± AdaptabilitĂ© - -**Large Desktop (1400px+)** : 6-7 jeux/ligne -**Desktop (1200px)** : 5-6 jeux/ligne -**Laptop (1024px)** : 4-5 jeux/ligne -**Tablette (768px)** : 3-4 jeux/ligne -**Mobile (480px)** : 2 jeux/ligne - -Navigation **beaucoup plus rapide** et **vue d'ensemble** des options disponibles ! 🚀 \ No newline at end of file diff --git a/PREUVE-SYSTÈME-FONCTIONNEL.txt b/PREUVE-SYSTÈME-FONCTIONNEL.txt deleted file mode 100644 index f045b1e..0000000 --- a/PREUVE-SYSTÈME-FONCTIONNEL.txt +++ /dev/null @@ -1,30 +0,0 @@ - -🏆 PREUVE ABSOLUE: SYSTÈME ULTRA-MODULAIRE FONCTIONNEL 🏆 -================================================================ - -✅ CHALLENGE RÉUSSI: - - DonnĂ©es JS chargĂ©es: 27 mots vocabulaire + 4 phrases - - AnalysĂ©es en mĂ©moire avec notre ContentScanner - - Converties en JSON ultra-modulaire complet - - Fichier gĂ©nĂ©rĂ©: sbs-level-7-8-GENERATED-from-js.json (9.8 KB) - -🎯 CAPACITÉS DÉTECTÉES: - - Vocabulaire: ✅ (27 mots) - - Phrases: ✅ (4 phrases) - - Profondeur vocab: 1/6 (format simple dĂ©tectĂ©) - - Richesse contenu: 2.7/10 - -🎼 COMPATIBILITÉ JEUX (4/4 COMPATIBLES): - - whack-a-mole: ✅ 54% (vocabulaire disponible) - - memory-match: ✅ 40.5% (vocabulaire visuel) - - quiz-game: ✅ 42% (contenu polyvalent) - - text-reader: ✅ 40% (phrases disponibles) - -📊 QUALITÉ FINALE: 91/100 ⭐⭐⭐⭐⭐ - -🔄 SYSTÈME PROUVÉ: - JS → Analyse → JSON Ultra-Modulaire → Validation ✅ - -================================================================ -Le dĂ©fi est RELEVÉ ! Le systĂšme fonctionne parfaitement ! 🚀 - diff --git a/RAPPORT-COMPATIBILITÉ-RÉSOLU.md b/RAPPORT-COMPATIBILITÉ-RÉSOLU.md deleted file mode 100644 index d9d44d4..0000000 --- a/RAPPORT-COMPATIBILITÉ-RÉSOLU.md +++ /dev/null @@ -1,136 +0,0 @@ -# 🎯 RAPPORT : SYSTÈME DE COMPATIBILITÉ RÉSOLU - -## 📋 ProblĂšme IdentifiĂ© - -**SymptĂŽme** : En cliquant sur Dragon's Pearl, l'interface affichait toujours les mĂȘmes messages gĂ©nĂ©riques au lieu d'analyser la compatibilitĂ© rĂ©elle du contenu avec les jeux. - -## 🔍 Analyse des Causes - -### 1. Architecture en Deux SystĂšmes ParallĂšles - -L'application avait effectivement **deux systĂšmes de gestion du contenu** : - -#### SystĂšme 1 : Configuration Statique ❌ -- Fichier : `config/games-config.json` + `navigation.js` ligne 96-120 -- Usage : Configuration fixe des contenus et jeux -- ProblĂšme : Pas de compatibilitĂ© dynamique - -#### SystĂšme 2 : Scan Dynamique ✅ -- Fichiers : `ContentScanner` + `ContentGameCompatibility` -- Usage : DĂ©tection automatique + analyse de compatibilitĂ© -- ProblĂšme : **Pas connectĂ© au flux principal** - -### 2. Bug de Connexion - -**Flux cassĂ©** : -``` -renderLevelsGrid() → ContentScanner ✅ (Bon systĂšme) - ↓ clic sur Dragon's Pearl -renderGamesGrid() → Config statique ❌ (Mauvais systĂšme) -``` - -**Le problĂšme exact** (ligne 424 dans `renderGamesGrid()`) : -```javascript -// ❌ AVANT : Utilisait les mĂ©tadonnĂ©es du scan au lieu du module JS -compatibility = this.compatibilityChecker.checkCompatibility(contentInfo, key); - -// ✅ APRÈS : Utilise le vrai module JavaScript -const actualContentModule = window.ContentModules?.[moduleName]; -compatibility = this.compatibilityChecker.checkCompatibility(actualContentModule, key); -``` - -## 🔧 Solution ImplĂ©mentĂ©e - -### 1. Connexion des SystĂšmes -- **ForcĂ© l'utilisation du scan dynamique** dans `renderGamesGrid()` -- **Ajout de `getModuleName()`** : convertit `"chinese-long-story"` → `"ChineseLongStory"` -- **Correction du bug de compatibilitĂ©** : utilise le module JS rĂ©el - -### 2. Fonctions AjoutĂ©es - -#### `getModuleName(contentType)` - navigation.js:640 -```javascript -getModuleName(contentType) { - const mapping = { - 'chinese-long-story': 'ChineseLongStory', - 'sbs-level-7-8-new': 'SBSLevel78New', - // ... autres mappings - }; - return mapping[contentType] || this.toPascalCase(contentType); -} -``` - -#### `toPascalCase(str)` - navigation.js:653 -Convertit `kebab-case` → `PascalCase` - -### 3. Correction du Bug Principal - navigation.js:424-435 -```javascript -// RĂ©cupĂ©rer le module JavaScript rĂ©el pour le test de compatibilitĂ© -const moduleName = this.getModuleName(contentType); -const actualContentModule = window.ContentModules?.[moduleName]; - -if (actualContentModule) { - compatibility = this.compatibilityChecker.checkCompatibility(actualContentModule, key); - logSh(`🎯 ${game.name} compatibility: ${compatibility.compatible ? '✅' : '❌'} (score: ${compatibility.score}%) - ${compatibility.reason}`, 'DEBUG'); -} else { - logSh(`⚠ Module JavaScript non trouvĂ©: ${moduleName}`, 'WARN'); - compatibility = { compatible: true, score: 50, reason: "Module not loaded - default compatibility" }; -} -``` - -## 🎯 RĂ©sultat Attendu - -Maintenant quand l'utilisateur clique sur **Dragon's Pearl** : - -### 1. Analyse Automatique ✅ -- Le systĂšme utilise le **scan dynamique** qui a dĂ©tectĂ© le contenu -- Il rĂ©cupĂšre le **vrai module JavaScript** `window.ContentModules.ChineseLongStory` -- Il lance l'**analyse de compatibilitĂ©** avec chaque jeu - -### 2. Affichage Adaptatif ✅ -Dragon's Pearl contient une **longue histoire avec chapitres**, donc : - -**🎯 Jeux RecommandĂ©s (score Ă©levĂ©)** : -- ✅ **Text Reader** (95%) - Parfait pour histoires longues -- ✅ **Story Reader** (95%) - OptimisĂ© pour les histoires -- ✅ **Adventure Reader** (85%) - Mode RPG avec vocabulaire - -**👍 Jeux Compatibles (score moyen)** : -- ✅ **Quiz Game** (70%) - Questions sur vocabulaire -- ✅ **Memory Match** (60%) - BasĂ© sur vocabulaire - -**⚠ Jeux avec Limitations** : -- ⚠ **Whack-a-Mole** (45%) - Besoin plus de vocabulaire isolĂ© -- ⚠ **Fill-the-Blank** (40%) - Format histoire pas optimal - -## đŸ§Ș Pour Tester - -### 1. Test Manuel -1. Ouvrir `index.html` dans le navigateur -2. Cliquer sur **"LEVELS"** → Dragon's Pearl apparaĂźt via scan dynamique ✅ -3. Cliquer sur **Dragon's Pearl** → Analyse de compatibilitĂ© s'exĂ©cute ✅ -4. Observer l'affichage par **sections** avec **badges de compatibilitĂ©** ✅ - -### 2. Test Console (Diagnostic) -Copier-coller `diagnostic-scan-dynamique.js` dans la console pour vĂ©rifier : -- ✅ ContentScanner chargĂ© -- ✅ ContentGameCompatibility chargĂ© -- ✅ Dragon's Pearl dĂ©tectĂ© dans le scan -- ✅ Module `ChineseLongStory` chargĂ© -- ✅ Tests de compatibilitĂ© fonctionnels - -## 📊 Bilan Final - -### ✅ ProblĂšmes RĂ©solus -- **Deux systĂšmes parallĂšles** → UnifiĂ© sur scan dynamique -- **Messages gĂ©nĂ©riques** → Analyse de compatibilitĂ© rĂ©elle -- **Bug de connexion** → Module JS rĂ©el utilisĂ© -- **Mapping des modules** → Fonction `getModuleName()` ajoutĂ©e - -### 🎯 SystĂšme Maintenant OpĂ©rationnel -- **Dragon's Pearl est correctement analysĂ©** -- **CompatibilitĂ© calculĂ©e pour chaque jeu** -- **Affichage visuel avec badges et sections** -- **DĂ©gradation gracieuse si module manquant** - -Le systĂšme de compatibilitĂ© content-jeux est maintenant **100% fonctionnel** ! 🚀 \ No newline at end of file diff --git a/RESUME-MODIFICATIONS-SESSION.md b/RESUME-MODIFICATIONS-SESSION.md deleted file mode 100644 index ae1f956..0000000 --- a/RESUME-MODIFICATIONS-SESSION.md +++ /dev/null @@ -1,106 +0,0 @@ -# 📋 RÉSUMÉ DES MODIFICATIONS - Session Actuelle - -## 🎯 Objectifs Accomplis - -### 1. 🔧 SystĂšme de CompatibilitĂ© Content-Jeux -**ProblĂšme** : Les jeux s'affichaient mĂȘme s'ils n'Ă©taient pas compatibles avec le contenu sĂ©lectionnĂ©. - -**Solution** : SystĂšme complet de compatibilitĂ© qui analyse le contenu et affiche seulement les jeux adaptĂ©s. - -### 2. 🐉 Adventure Reader + Dragon's Pearl -**ProblĂšme** : Adventure Reader ne pouvait pas utiliser le contenu de Dragon's Pearl. - -**Solution** : Support complet de la structure Dragon's Pearl avec extraction des phrases et prononciations. - -### 3. 🎼 Interface Multi-Colonnes -**ProblĂšme** : Interface des jeux affichait un seul jeu par ligne, navigation lente. - -**Solution** : Grille responsive avec 3-6 jeux par ligne selon la taille d'Ă©cran. - -### 4. 🍞 Navigation AmĂ©liorĂ©e -**ProblĂšme** : Breadcrumb manquait le niveau "Levels", pas de boutons back. - -**Solution** : Navigation complĂšte avec breadcrumb correct et boutons back sur toutes les pages. - -## 📊 Statistiques Git -``` -29 fichiers modifiĂ©s -+5312 lignes ajoutĂ©es --2097 lignes supprimĂ©es -``` - -## 🔧 Fichiers ClĂ©s ModifiĂ©s - -### Navigation & Interface -- **`js/core/navigation.js`** : SystĂšme de compatibilitĂ© intĂ©grĂ©, breadcrumb corrigĂ© -- **`css/main.css`** : Grille multi-colonnes, styles compatibilitĂ©, boutons back -- **`index.html`** : Boutons back ajoutĂ©s dans headers - -### SystĂšme de CompatibilitĂ© -- **`js/core/content-game-compatibility.js`** ⭐ **NOUVEAU** : Classe principale de compatibilitĂ© -- **`css/main.css`** : Badges de compatibilitĂ©, sections visuelles - -### Adventure Reader -- **`js/games/adventure-reader.js`** : Support Dragon's Pearl, extraction phrases, prononciations -- **`js/core/json-content-loader.js`** : Support structure `story.chapters[]` -- **`css/games.css`** : Styles prononciations vocabulaire et phrases - -### Contenu -- **`js/content/chinese-long-story.js`** ⭐ **NOUVEAU** : Dragon's Pearl (150+ phrases chinoises) - -## 🎯 FonctionnalitĂ©s AjoutĂ©es - -### 🔍 SystĂšme de CompatibilitĂ© Intelligent -- **Analyse automatique** du contenu (vocabulaire, phrases, dialogues, audio...) -- **Scores de compatibilitĂ©** 0-100% par jeu -- **Badges visuels** : Excellent (🎯), RecommandĂ© (✅), Compatible (👍), LimitĂ© (⚠) -- **Sections organisĂ©es** : Jeux recommandĂ©s vs jeux avec limitations -- **Messages d'aide** : Suggestions pour amĂ©liorer le contenu - -### 🐉 Dragon's Pearl dans Adventure Reader -- **150+ phrases chinoises** avec traductions anglaises -- **Vocabulaire riche** avec prononciations pinyin -- **Structure par chapitres** : L'histoire de Li Ming et la perle du dragon -- **Ennemis gĂ©nĂ©rĂ©s** basĂ©s sur le nombre de phrases -- **Pots pour vocabulaire** avec prononciations -- **Modal de lecture** avec chinois + anglais + pinyin - -### 🎼 Interface Multi-Colonnes -- **Desktop** : 4-6 jeux par ligne -- **Tablette** : 3-4 jeux par ligne -- **Mobile** : 2 jeux par ligne -- **Navigation rapide** : Vue d'ensemble de tous les jeux - -### 🧭 Navigation ComplĂšte -- **Breadcrumb corrigĂ©** : Home > Levels > Dragon's Pearl > Jeu -- **Boutons back** sur pages levels et games -- **Historique** de navigation avec goBack() fonctionnel -- **Styles responsive** pour tous les Ă©crans - -### đŸ—Łïž SystĂšme de Prononciations -- **Vocabulaire** : Affichage pinyin dans popup (韙 → dragon → đŸ—Łïž lĂłng) -- **Phrases** : Construction automatique des prononciations complĂštes -- **Styles visuels** : Fond colorĂ©, italique, emoji đŸ—Łïž - -## 🚀 Fichiers de Debug Créés -- `diagnostic-scan-dynamique.js` - Diagnostic systĂšme complet -- `debug-adventure-reader.js` - Debug Adventure Reader spĂ©cifique -- `test-extraction-direct.js` - Test extraction phrases Dragon's Pearl - -## 📋 Rapports GĂ©nĂ©rĂ©s -- `COMPATIBILITY-SYSTEM.md` - Documentation systĂšme compatibilitĂ© -- `ADVENTURE-READER-DRAGON-PEARL.md` - Guide Adventure Reader + Dragon's Pearl -- `RAPPORT-COMPATIBILITÉ-RÉSOLU.md` - Analyse problĂšmes/solutions -- `OPTIMISATION-GRILLE-JEUX.md` - DĂ©tails interface multi-colonnes - -## ✅ RĂ©sultat Final - -L'application est maintenant **beaucoup plus intelligente et utilisable** : - -1. **Choix intelligent** des jeux selon le contenu -2. **Navigation rapide** avec vue d'ensemble -3. **ExpĂ©rience immersive** avec Dragon's Pearl + Adventure Reader -4. **Apprentissage optimisĂ©** avec prononciations chinoises -5. **Interface moderne** responsive et intuitive - -**🎯 Mission accomplie !** Le systĂšme analyse automatiquement le contenu, recommande les meilleurs jeux, et offre une expĂ©rience d'apprentissage riche avec Dragon's Pearl ! 🐉✹ \ No newline at end of file diff --git a/Start_Class_Generator.bat b/Start_Class_Generator.bat deleted file mode 100644 index 6e8b181..0000000 --- a/Start_Class_Generator.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -title Class Generator - Startup -color 0A - -echo ======================================== -echo CLASS GENERATOR - DEMARRAGE -echo ======================================== -echo. - -cd /d "%~dp0" - -echo [1/6] Arret des instances precedentes... -echo ---------------------------------------- -taskkill /F /IM node.exe >nul 2>&1 -taskkill /F /IM python.exe >nul 2>&1 -echo OK - Instances precedentes arretees - -timeout /t 1 /nobreak > nul - -echo [2/6] Demarrage du serveur WebSocket Logger (port 8082)... -echo ---------------------------------------- -cd export_logger -start /B node websocket-server.js -cd .. - -timeout /t 2 /nobreak > nul - -echo [3/6] Demarrage du serveur HTTP (port 8080)... -echo ---------------------------------------- -start /B python -m http.server 8080 - -timeout /t 3 /nobreak > nul - -echo [4/6] Verification des serveurs... -echo ---------------------------------------- -echo OK - Serveur WebSocket demarre sur le port 8082 -echo OK - Serveur HTTP demarre sur le port 8080 - -echo. -echo [5/6] Ouverture du logger en priorite... -echo ---------------------------------------- -start "" "http://localhost:8080/export_logger/logs-viewer.html" - -timeout /t 2 /nobreak > nul - -echo [6/6] Ouverture de l'application principale... -echo ---------------------------------------- -start "" "http://localhost:8080" - -echo. -echo ======================================== -echo DEMARRAGE TERMINE AVEC SUCCES! -echo ======================================== -echo. -echo Serveur HTTP: http://localhost:8080 -echo Serveur WebSocket: ws://localhost:8082 -echo Application: Ouverte dans votre navigateur -echo Logger: Accessible via le bouton en haut a droite -echo. -echo Cette fenetre peut etre fermee. -echo Les serveurs continuent en arriere-plan. -echo. -echo Pour arreter les serveurs: -echo - Relancez ce script (il tue automatiquement les anciennes instances) -echo - Ou dans le gestionnaire de taches: Terminer node.exe et python.exe -echo. -timeout /t 5 /nobreak > nul -exit \ No newline at end of file diff --git a/Start_Class_Generator_HTTP.bat b/Start_Class_Generator_HTTP.bat deleted file mode 100644 index 7489c16..0000000 --- a/Start_Class_Generator_HTTP.bat +++ /dev/null @@ -1,43 +0,0 @@ -@echo off -title Class Generator - HTTP Server -color 0A - -echo ======================================== -echo CLASS GENERATOR - SERVEUR HTTP -echo ======================================== -echo. - -cd /d "%~dp0" - -echo [1/3] Demarrage du serveur WebSocket Logger (port 8082)... -echo ---------------------------------------- -cd export_logger -start /min cmd /c "node websocket-server.js" -cd .. - -timeout /t 2 /nobreak > nul - -echo [2/3] Demarrage du serveur HTTP (port 8080)... -echo ---------------------------------------- -start /min cmd /c "python -m http.server 8080" - -timeout /t 3 /nobreak > nul - -echo [3/3] Ouverture de l'application... -echo ---------------------------------------- -start "" "http://localhost:8080" - -echo. -echo ======================================== -echo DEMARRAGE TERMINE AVEC SUCCES! -echo ======================================== -echo. -echo Serveur HTTP: http://localhost:8080 -echo Serveur WebSocket: ws://localhost:8082 -echo Logger: Accessible via le bouton en haut a droite -echo. -echo Cette fenetre peut etre fermee. -echo Les serveurs continuent en arriere-plan. -echo. -timeout /t 5 /nobreak > nul -exit \ No newline at end of file diff --git a/admin-ultra-modular.html b/admin-ultra-modular.html deleted file mode 100644 index 399217e..0000000 --- a/admin-ultra-modular.html +++ /dev/null @@ -1,643 +0,0 @@ - - - - - - 🚀 Admin: Ultra-Modular JSON System - - - -
-

🚀 Admin: Ultra-Modular JSON System

-

Validation et gestion des spécifications de contenu ultra-modulaires

-
- -
- -
-
- 🔍 -

Validation de Spécifications

-
- -

Fichiers JSON Disponibles:

-
-
Chargement des fichiers...
-
- - -
- - -
-
- 📊 -

Analyse des Capacités

-
- - -
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/convert-vocabulary.js b/convert-vocabulary.js deleted file mode 100644 index 3b1586c..0000000 --- a/convert-vocabulary.js +++ /dev/null @@ -1,27 +0,0 @@ -// Quick script to convert old vocabulary format to new language-agnostic format -const fs = require('fs'); - -function convertVocabularyFormat(inputFile, outputFile) { - let content = fs.readFileSync(inputFile, 'utf8'); - - // Pattern to match: word: "translation", - const pattern = /(\s+)(\w+|"[^"]*"): "([^"]*)",?/g; - - content = content.replace(pattern, (match, indent, word, translation) => { - // Determine word type based on translation or word - let type = "noun"; // Default - if (translation.includes("的") && !translation.includes("")) type = "adjective"; - if (word.includes(" ")) type = "phrase"; - - return `${indent}${word}: { user_language: "${translation}", type: "${type}" },`; - }); - - fs.writeFileSync(outputFile, content); - console.log(`Converted ${inputFile} to ${outputFile}`); -} - -// Convert the sbs file -convertVocabularyFormat( - 'js/content/sbs-level-7-8-new.js', - 'js/content/sbs-level-7-8-new-converted.js' -); \ No newline at end of file diff --git a/debug-adventure-reader.js b/debug-adventure-reader.js deleted file mode 100644 index 6a8bf31..0000000 --- a/debug-adventure-reader.js +++ /dev/null @@ -1,85 +0,0 @@ -// === DEBUG ADVENTURE READER + DRAGON'S PEARL === - -// Script Ă  copier-coller dans la console pour dĂ©boguer - -function debugAdventureReader() { - console.log('🐉 Debug Adventure Reader + Dragon\\'s Pearl'); - - // 1. VĂ©rifier que le module Dragon's Pearl est chargĂ© - console.log('\\n1ïžâƒŁ Module Dragon\\'s Pearl:'); - const dragonModule = window.ContentModules?.ChineseLongStory; - console.log(' Module trouvĂ©:', !!dragonModule); - - if (dragonModule) { - console.log(' Nom:', dragonModule.name); - console.log(' Vocabulary entries:', Object.keys(dragonModule.vocabulary || {}).length); - console.log(' Story structure:', !!dragonModule.story); - - if (dragonModule.story) { - console.log(' Story title:', dragonModule.story.title); - console.log(' Chapters:', dragonModule.story.chapters?.length || 0); - - if (dragonModule.story.chapters?.[0]) { - console.log(' First chapter sentences:', dragonModule.story.chapters[0].sentences?.length || 0); - console.log(' Sample sentence:', dragonModule.story.chapters[0].sentences?.[0]?.original); - } - } - } - - // 2. Tester l'extraction si possible - console.log('\\n2ïžâƒŁ Test d\\'extraction:'); - if (dragonModule && window.AdventureReaderGame) { - // CrĂ©er une instance temporaire pour tester - const testReader = { - extractSentences: window.AdventureReaderGame.prototype.extractSentences, - extractVocabulary: window.AdventureReaderGame.prototype.extractVocabulary, - extractStories: window.AdventureReaderGame.prototype.extractStories - }; - - try { - const sentences = testReader.extractSentences(dragonModule); - console.log(' Phrases extraites:', sentences.length); - if (sentences.length > 0) { - console.log(' PremiĂšre phrase:', sentences[0]); - } - - const vocab = testReader.extractVocabulary(dragonModule); - console.log(' Vocabulaire extrait:', vocab.length); - if (vocab.length > 0) { - console.log(' Premier mot:', vocab[0]); - } - - const stories = testReader.extractStories(dragonModule); - console.log(' Histoires extraites:', stories.length); - if (stories.length > 0) { - console.log(' PremiĂšre histoire:', stories[0].title); - } - - } catch (error) { - console.error(' ❌ Erreur d\\'extraction:', error); - } - } - - // 3. VĂ©rifier l'instance active si elle existe - console.log('\\n3ïžâƒŁ Instance active:'); - // Chercher dans le DOM s'il y a un jeu actif - const gameContainer = document.querySelector('.adventure-reader-wrapper'); - console.log(' Jeu Adventure Reader actif:', !!gameContainer); - - // VĂ©rifier les Ă©lĂ©ments du DOM - const modal = document.getElementById('reading-modal'); - console.log(' Modal de lecture:', !!modal); - - const mapElement = document.querySelector('.game-map'); - console.log(' Carte de jeu:', !!mapElement); - - const pots = document.querySelectorAll('.pot'); - const enemies = document.querySelectorAll('.enemy'); - console.log(' Pots sur la carte:', pots.length); - console.log(' Ennemis sur la carte:', enemies.length); - - console.log('\\n✅ Debug terminĂ©'); -} - -// Auto-exĂ©cution -debugAdventureReader(); \ No newline at end of file diff --git a/debug-compatibility.js b/debug-compatibility.js deleted file mode 100644 index 6e677dd..0000000 --- a/debug-compatibility.js +++ /dev/null @@ -1,84 +0,0 @@ -// === DEBUG SYSTÈME DE COMPATIBILITÉ === - -// Script Ă  injecter dans la console pour dĂ©bugger les problĂšmes - -window.debugCompatibility = { - - // Fonction pour logger les informations dĂ©taillĂ©es - logContentInfo: function(contentType) { - console.log('🔍 Debug CompatibilitĂ© pour:', contentType); - - // 1. VĂ©rifier si le contentScanner a ce contenu - if (window.AppNavigation && window.AppNavigation.scannedContent) { - const foundContent = window.AppNavigation.scannedContent.found.find(c => c.id === contentType); - console.log('📩 Contenu trouvĂ© par scanner:', foundContent); - } - - // 2. VĂ©rifier dans ContentModules - const moduleName = this.getModuleName(contentType); - console.log('đŸ·ïž Nom de module calculĂ©:', moduleName); - - if (window.ContentModules && window.ContentModules[moduleName]) { - const module = window.ContentModules[moduleName]; - console.log('📋 Module dans ContentModules:', module); - - // 3. Tester compatibilitĂ© directement - if (window.AppNavigation && window.AppNavigation.compatibilityChecker) { - const checker = window.AppNavigation.compatibilityChecker; - const games = ['whack-a-mole', 'memory-match', 'quiz-game', 'fill-the-blank', 'text-reader', 'adventure-reader']; - - console.log('🎼 Tests de compatibilitĂ©:'); - games.forEach(game => { - const result = checker.checkCompatibility(module, game); - console.log(` ${result.compatible ? '✅' : '❌'} ${game}: ${result.score}%`); - }); - } - } else { - console.error('❌ Module non trouvĂ©:', moduleName); - console.log('📋 Modules disponibles:', Object.keys(window.ContentModules || {})); - } - }, - - // Fonction pour convertir contentType vers moduleName (copie de la logique) - getModuleName: function(contentType) { - const mapping = { - 'sbs-level-7-8-new': 'SBSLevel78New', - 'basic-chinese': 'BasicChinese', - 'english-class-demo': 'EnglishClassDemo', - 'chinese-long-story': 'ChineseLongStory', - 'test-minimal': 'TestMinimal', - 'test-rich': 'TestRich' - }; - return mapping[contentType] || this.toPascalCase(contentType); - }, - - toPascalCase: function(str) { - return str.split('-').map(word => - word.charAt(0).toUpperCase() + word.slice(1) - ).join(''); - }, - - // Fonction pour tester avec Dragon's Pearl spĂ©cifiquement - testDragonsPearl: function() { - console.log('🐉 Test spĂ©cifique Dragon\'s Pearl'); - this.logContentInfo('chinese-long-story'); - }, - - // Fonction pour vĂ©rifier le contenu scannĂ© - listScannedContent: function() { - if (window.AppNavigation && window.AppNavigation.scannedContent) { - console.log('📋 Contenu scannĂ©:', window.AppNavigation.scannedContent.found.map(c => ({ - id: c.id, - name: c.name, - filename: c.filename - }))); - } else { - console.log('❌ Pas de contenu scannĂ© trouvĂ©'); - } - } -}; - -console.log('🔧 Script de debug chargĂ©. Utilisez:'); -console.log(' debugCompatibility.testDragonsPearl() - Test Dragon\'s Pearl'); -console.log(' debugCompatibility.listScannedContent() - Liste le contenu scannĂ©'); -console.log(' debugCompatibility.logContentInfo("content-id") - Debug contenu spĂ©cifique'); \ No newline at end of file diff --git a/diagnostic-scan-dynamique.js b/diagnostic-scan-dynamique.js deleted file mode 100644 index 2d78b39..0000000 --- a/diagnostic-scan-dynamique.js +++ /dev/null @@ -1,182 +0,0 @@ -// === DIAGNOSTIC COMPLET DU SCAN DYNAMIQUE === - -// Script de diagnostic Ă  exĂ©cuter dans la console pour identifier TOUS les problĂšmes - -function diagnosticComplet() { - console.log('🔍 DIAGNOSTIC COMPLET DU SCAN DYNAMIQUE\n'); - console.log('=====================================\n'); - - const issues = []; - const success = []; - - // 1. VĂ©rification des classes de base - console.log('1ïžâƒŁ VÉRIFICATION DES CLASSES DE BASE'); - console.log('-------------------------------------'); - - if (!window.ContentScanner) { - issues.push('❌ ContentScanner non chargĂ©'); - console.log('❌ ContentScanner: NON CHARGÉ'); - } else { - success.push('✅ ContentScanner chargĂ©'); - console.log('✅ ContentScanner: CHARGÉ'); - } - - if (!window.ContentGameCompatibility) { - issues.push('❌ ContentGameCompatibility non chargĂ©'); - console.log('❌ ContentGameCompatibility: NON CHARGÉ'); - } else { - success.push('✅ ContentGameCompatibility chargĂ©'); - console.log('✅ ContentGameCompatibility: CHARGÉ'); - } - - if (!window.AppNavigation) { - issues.push('❌ AppNavigation non chargĂ©'); - console.log('❌ AppNavigation: NON CHARGÉ'); - return { issues, success }; - } else { - success.push('✅ AppNavigation chargĂ©'); - console.log('✅ AppNavigation: CHARGÉ'); - } - - // 2. VĂ©rification de l'initialisation - console.log('\n2ïžâƒŁ VÉRIFICATION DE L\'INITIALISATION'); - console.log('--------------------------------------'); - - if (!window.AppNavigation.contentScanner) { - issues.push('❌ ContentScanner non initialisĂ© dans AppNavigation'); - console.log('❌ AppNavigation.contentScanner: NON INITIALISÉ'); - } else { - success.push('✅ ContentScanner initialisĂ©'); - console.log('✅ AppNavigation.contentScanner: INITIALISÉ'); - } - - if (!window.AppNavigation.compatibilityChecker) { - issues.push('❌ CompatibilityChecker non initialisĂ© dans AppNavigation'); - console.log('❌ AppNavigation.compatibilityChecker: NON INITIALISÉ'); - } else { - success.push('✅ CompatibilityChecker initialisĂ©'); - console.log('✅ AppNavigation.compatibilityChecker: INITIALISÉ'); - } - - // 3. VĂ©rification du contenu scannĂ© - console.log('\n3ïžâƒŁ VÉRIFICATION DU CONTENU SCANNÉ'); - console.log('----------------------------------'); - - if (!window.AppNavigation.scannedContent) { - issues.push('❌ Aucun contenu scannĂ© trouvĂ©'); - console.log('❌ scannedContent: VIDE'); - } else { - const found = window.AppNavigation.scannedContent.found || []; - console.log(`✅ scannedContent: ${found.length} modules trouvĂ©s`); - - if (found.length === 0) { - issues.push('❌ Scanner n\'a trouvĂ© aucun module'); - } else { - success.push(`✅ ${found.length} modules dĂ©tectĂ©s`); - - console.log('\n 📋 MODULES DÉTECTÉS:'); - found.forEach((content, index) => { - console.log(` ${index + 1}. "${content.name}" (ID: ${content.id})`); - console.log(` 📁 Fichier: ${content.filename}`); - console.log(` 📊 Vocab: ${content.stats?.vocabularyCount || 0}, Phrases: ${content.stats?.sentenceCount || 0}`); - }); - - // Chercher spĂ©cifiquement Dragon's Pearl - const dragonPearl = found.find(c => - c.name.includes('Dragon') || - c.id.includes('chinese-long-story') || - c.filename.includes('chinese-long-story') - ); - - if (dragonPearl) { - success.push('✅ Dragon\'s Pearl dĂ©tectĂ© dans le scan'); - console.log(`\n 🐉 DRAGON'S PEARL TROUVÉ:`); - console.log(` Nom: "${dragonPearl.name}"`); - console.log(` ID: "${dragonPearl.id}"`); - console.log(` Fichier: "${dragonPearl.filename}"`); - } else { - issues.push('❌ Dragon\'s Pearl non trouvĂ© dans le scan'); - console.log('\n ❌ DRAGON\'S PEARL: NON TROUVÉ'); - } - } - } - - // 4. VĂ©rification des modules JavaScript - console.log('\n4ïžâƒŁ VÉRIFICATION DES MODULES JAVASCRIPT'); - console.log('---------------------------------------'); - - if (!window.ContentModules) { - issues.push('❌ window.ContentModules non dĂ©fini'); - console.log('❌ window.ContentModules: NON DÉFINI'); - } else { - const modules = Object.keys(window.ContentModules); - console.log(`✅ window.ContentModules: ${modules.length} modules`); - console.log(` Modules: ${modules.join(', ')}`); - - if (window.ContentModules.ChineseLongStory) { - success.push('✅ Module ChineseLongStory chargĂ©'); - console.log('✅ ChineseLongStory: CHARGÉ'); - - const module = window.ContentModules.ChineseLongStory; - console.log(` Nom: "${module.name}"`); - console.log(` Vocabulaire: ${Object.keys(module.vocabulary || {}).length} mots`); - console.log(` Story: ${module.story ? 'OUI' : 'NON'}`); - } else { - issues.push('❌ Module ChineseLongStory non chargĂ©'); - console.log('❌ ChineseLongStory: NON CHARGÉ'); - } - } - - // 5. Test de compatibilitĂ© - console.log('\n5ïžâƒŁ TEST DE COMPATIBILITÉ'); - console.log('-------------------------'); - - if (window.AppNavigation?.compatibilityChecker && window.ContentModules?.ChineseLongStory) { - try { - const checker = window.AppNavigation.compatibilityChecker; - const content = window.ContentModules.ChineseLongStory; - - console.log('✅ Test de compatibilitĂ© possible'); - - const games = ['whack-a-mole', 'memory-match', 'quiz-game', 'text-reader']; - games.forEach(game => { - const result = checker.checkCompatibility(content, game); - const status = result.compatible ? '✅' : '❌'; - console.log(` ${status} ${game}: ${result.score}% - ${result.reason}`); - }); - - success.push('✅ SystĂšme de compatibilitĂ© fonctionnel'); - } catch (error) { - issues.push(`❌ Erreur test compatibilitĂ©: ${error.message}`); - console.log(`❌ ERREUR TEST: ${error.message}`); - } - } else { - issues.push('❌ Test de compatibilitĂ© impossible'); - console.log('❌ Test de compatibilitĂ©: IMPOSSIBLE'); - } - - // 6. Rapport final - console.log('\n📊 RAPPORT FINAL'); - console.log('================'); - console.log(`✅ SuccĂšs: ${success.length}`); - console.log(`❌ ProblĂšmes: ${issues.length}`); - - if (issues.length > 0) { - console.log('\n🚹 PROBLÈMES IDENTIFIÉS:'); - issues.forEach((issue, index) => { - console.log(`${index + 1}. ${issue}`); - }); - } - - if (success.length > 0) { - console.log('\n🎉 ÉLÉMENTS FONCTIONNELS:'); - success.forEach((item, index) => { - console.log(`${index + 1}. ${item}`); - }); - } - - return { issues, success }; -} - -// Auto-exĂ©cution -diagnosticComplet(); \ No newline at end of file diff --git a/english_exemple.json b/english_exemple.json deleted file mode 100644 index 105ce7a..0000000 --- a/english_exemple.json +++ /dev/null @@ -1,244 +0,0 @@ -{ - "name": "English Class Demo", - "description": "Complete example with all content types - vocabulary, grammar, audio, poems, exercises", - "difficulty": "mixed", - "language": "english", - "icon": "🇬🇧", - "vocabulary": { - "apple": { - "translation": "pomme", - "type": "noun", - "pronunciation": "audio/apple.mp3", - "difficulty": "beginner", - "examples": ["I eat an apple every day", "The apple is red and sweet"], - "grammarNotes": "Count noun - can be singular or plural" - }, - "run": { - "translation": "courir", - "type": "verb", - "pronunciation": "audio/run.mp3", - "difficulty": "beginner", - "examples": ["I run in the park", "She runs very fast"], - "grammarNotes": "Regular verb: run, runs, running, ran" - }, - "beautiful": { - "translation": "beau/belle", - "type": "adjective", - "pronunciation": "audio/beautiful.mp3", - "difficulty": "intermediate", - "examples": ["The sunset is beautiful", "She has beautiful eyes"], - "grammarNotes": "Can be used before noun or after 'be'" - }, - "hello": { - "translation": "bonjour", - "type": "greeting", - "pronunciation": "audio/hello.mp3", - "difficulty": "beginner", - "examples": ["Hello, how are you?", "Hello everyone!"], - "grammarNotes": "Common greeting used anytime" - }, - "cat": "chat", - "dog": "chien", - "house": "maison" - }, - "grammar": { - "presentSimple": { - "title": "Present Simple Tense", - "explanation": "Used for habits, facts, and general truths. Form: Subject + base verb (+ s for he/she/it)", - "examples": [ - { "english": "I walk to school", "french": "Je marche Ă  l'Ă©cole" }, - { "english": "She walks to school", "french": "Elle marche Ă  l'Ă©cole" }, - { "english": "They walk to school", "french": "Ils marchent Ă  l'Ă©cole" } - ], - "exercises": [ - "Complete: I _____ (play) tennis every Sunday", - "Transform: He walk to work → He _____ to work" - ] - }, - "articles": { - "title": "Articles: A, An, The", - "explanation": "A/An = indefinite articles (one of many). The = definite article (specific one)", - "examples": [ - { "english": "I see a cat", "french": "Je vois un chat" }, - { "english": "I see an elephant", "french": "Je vois un Ă©lĂ©phant" }, - { "english": "I see the cat from yesterday", "french": "Je vois le chat d'hier" } - ] - } - }, - "audio": { - "withText": [ - { - "title": "Daily Routine Conversation", - "audioFile": "audio/daily_routine.mp3", - "transcript": "A: What time do you wake up? B: I usually wake up at 7 AM. A: That's early! I wake up at 8:30. B: I like to exercise before work. A: That's a good habit!", - "translation": "A: À quelle heure te rĂ©veilles-tu? B: Je me rĂ©veille habituellement Ă  7h. A: C'est tĂŽt! Je me rĂ©veille Ă  8h30. B: J'aime faire de l'exercice avant le travail. A: C'est une bonne habitude!", - "timestamps": [ - { "time": 0.5, "text": "What time do you wake up?" }, - { "time": 3.2, "text": "I usually wake up at 7 AM" }, - { "time": 6.8, "text": "That's early! I wake up at 8:30" }, - { "time": 11.1, "text": "I like to exercise before work" }, - { "time": 14.5, "text": "That's a good habit!" } - ] - }, - { - "title": "Weather Report", - "audioFile": "audio/weather.mp3", - "transcript": "Today's weather: It's sunny and warm with a high of 25 degrees. Light winds from the south. Perfect day for outdoor activities!", - "translation": "MĂ©tĂ©o d'aujourd'hui: Il fait ensoleillĂ© et chaud avec un maximum de 25 degrĂ©s. Vents lĂ©gers du sud. JournĂ©e parfaite pour les activitĂ©s extĂ©rieures!" - } - ], - "withoutText": [ - { - "title": "Mystery Conversation", - "audioFile": "audio/mystery.mp3", - "questions": [ - { "question": "How many people are speaking?", "type": "ai_interpreted" }, - { "question": "What are they talking about?", "type": "ai_interpreted" }, - { "question": "What is the mood of the conversation?", "type": "ai_interpreted" } - ] - } - ] - }, - "poems": [ - { - "title": "Roses Are Red", - "content": "Roses are red,\nViolets are blue,\nSugar is sweet,\nAnd so are you.", - "translation": "Les roses sont rouges,\nLes violettes sont bleues,\nLe sucre est doux,\nEt toi aussi.", - "audioFile": "audio/roses_poem.mp3", - "culturalContext": "Traditional English nursery rhyme pattern, often used to teach basic rhyming and poetry structure to children." - }, - { - "title": "Twinkle, Twinkle", - "content": "Twinkle, twinkle, little star,\nHow I wonder what you are.\nUp above the world so high,\nLike a diamond in the sky.", - "audioFile": "audio/twinkle.mp3", - "culturalContext": "Famous children's lullaby, one of the most recognizable songs in English-speaking countries." - } - ], - "fillInBlanks": [ - { - "sentence": "I _____ to school every day", - "options": ["go", "goes", "going", "went"], - "correctAnswer": "go", - "explanation": "Present simple with 'I' uses base form of verb" - }, - { - "sentence": "She _____ a book right now", - "options": ["read", "reads", "reading", "is reading"], - "correctAnswer": "is reading", - "explanation": "Present continuous for actions happening now" - }, - { - "sentence": "The weather is _____ today", - "type": "open_ended", - "acceptedAnswers": ["nice", "good", "beautiful", "sunny", "warm", "pleasant", "lovely"], - "aiPrompt": "Evaluate if the answer is a positive adjective that could describe good weather" - }, - { - "sentence": "I feel _____ when I listen to music", - "type": "open_ended", - "acceptedAnswers": ["happy", "relaxed", "calm", "peaceful", "good", "better"], - "aiPrompt": "Check if the answer describes a positive emotion or feeling" - } - ], - "corrections": [ - { - "incorrect": "I are happy today", - "correct": "I am happy today", - "explanation": "Use 'am' with pronoun 'I', not 'are'", - "type": "grammar_correction" - }, - { - "incorrect": "She don't like apples", - "correct": "She doesn't like apples", - "explanation": "Use 'doesn't' with he/she/it, not 'don't'", - "type": "grammar_correction" - }, - { - "incorrect": "I can to swim", - "correct": "I can swim", - "explanation": "After modal verbs like 'can', use base form without 'to'", - "type": "grammar_correction" - } - ], - "comprehension": [ - { - "text": "Sarah is a 25-year-old teacher who lives in London. Every morning, she wakes up at 6:30 AM and goes for a jog in the park near her house. After jogging, she has breakfast and reads the news. She loves her job because she enjoys working with children and helping them learn. On weekends, Sarah likes to visit museums and try new restaurants with her friends.", - "questions": [ - { - "question": "What is Sarah's profession?", - "type": "multiple_choice", - "options": ["Doctor", "Teacher", "Engineer", "Artist"], - "correctAnswer": "Teacher" - }, - { - "question": "What does Sarah do every morning?", - "type": "ai_interpreted", - "evaluationPrompt": "Check if answer mentions waking up early, jogging, and having breakfast" - }, - { - "question": "Why does Sarah love her job?", - "type": "ai_interpreted", - "evaluationPrompt": "Verify answer mentions working with children and helping them learn" - }, - { - "question": "How would you describe Sarah's lifestyle?", - "type": "ai_interpreted", - "evaluationPrompt": "Accept answers mentioning active, healthy, social, or organized lifestyle" - } - ] - } - ], - "matching": [ - { - "title": "Match Animals to Their Sounds", - "leftColumn": ["Cat", "Dog", "Cow", "Bird"], - "rightColumn": ["Woof", "Meow", "Tweet", "Moo"], - "correctPairs": [ - { "left": "Cat", "right": "Meow" }, - { "left": "Dog", "right": "Woof" }, - { "left": "Cow", "right": "Moo" }, - { "left": "Bird", "right": "Tweet" } - ] - }, - { - "title": "Match Colors in English and French", - "leftColumn": ["Red", "Blue", "Green", "Yellow"], - "rightColumn": ["Bleu", "Vert", "Rouge", "Jaune"], - "correctPairs": [ - { "left": "Red", "right": "Rouge" }, - { "left": "Blue", "right": "Bleu" }, - { "left": "Green", "right": "Vert" }, - { "left": "Yellow", "right": "Jaune" } - ] - } - ], - "sentences": [ - { "english": "Hello, how are you?", "french": "Bonjour, comment allez-vous?" }, - { "english": "I like to read books", "french": "J'aime lire des livres" }, - { "english": "The weather is nice today", "french": "Il fait beau aujourd'hui" }, - { "english": "Can you help me please?", "french": "Pouvez-vous m'aider s'il vous plaĂźt?" } - ], - "texts": [ - { - "title": "My Daily Routine", - "content": "I wake up at 7 AM every day. First, I brush my teeth and take a shower. Then I have breakfast with my family. After breakfast, I go to work by bus. I work from 9 AM to 5 PM. In the evening, I cook dinner and watch TV. I go to bed at 10 PM.", - "translation": "Je me rĂ©veille Ă  7h tous les jours. D'abord, je me brosse les dents et prends une douche. Ensuite je prends le petit dĂ©jeuner avec ma famille. AprĂšs le petit dĂ©jeuner, je vais au travail en bus. Je travaille de 9h Ă  17h. Le soir, je cuisine le dĂźner et regarde la tĂ©lĂ©. Je me couche Ă  22h." - }, - { - "title": "The Four Seasons", - "content": "There are four seasons in a year: spring, summer, autumn, and winter. Spring is warm and flowers bloom. Summer is hot and sunny. Autumn is cool and leaves change colors. Winter is cold and it sometimes snows.", - "translation": "Il y a quatre saisons dans une annĂ©e: le printemps, l'Ă©tĂ©, l'automne et l'hiver. Le printemps est chaud et les fleurs fleurissent. L'Ă©tĂ© est chaud et ensoleillĂ©. L'automne est frais et les feuilles changent de couleur. L'hiver est froid et il neige parfois." - } - ], - "dialogues": [ - { - "title": "At the Restaurant", - "conversation": [ - { "speaker": "Waiter", "english": "Good evening! Welcome to our restaurant.", "french": "Bonsoir! Bienvenue dans notre restaurant." }, - { "speaker": "Customer", "english": "Thank you. Can I see the menu please?", "french": "Merci. Puis-je voir le menu s'il vous plaĂźt?" }, - { "speaker": "Waiter", "english": "Of course! Here you are. What would you like to drink?", "french": "Bien sĂ»r! Voici. Que voulez-vous boire?" }, - { "speaker": "Customer", "english": "I'll have a glass of water, please.", "french": "Je prendrai un verre d'eau, s'il vous plaĂźt." } - ] - } - ] -} \ No newline at end of file diff --git a/english_exemple_commented.json b/english_exemple_commented.json deleted file mode 100644 index 04e7748..0000000 --- a/english_exemple_commented.json +++ /dev/null @@ -1,620 +0,0 @@ -{ - // ======================================== - // EDUCATIONAL CONTENT MODULE SPECIFICATION - // ======================================== - // This JSON defines a complete content module for language learning applications. - // All fields are OPTIONAL unless explicitly marked as REQUIRED. - // Systems should gracefully handle missing fields and adapt functionality accordingly. - - // === CORE METADATA (REQUIRED) === - // Essential identification and configuration data - "id": "english_class_demo_complete_example", // REQUIRED: Unique identifier (lowercase, underscores) - "name": "English Class Demo - Complete Example", // REQUIRED: Human-readable display name - "description": "Comprehensive example showcasing all content structure possibilities", // REQUIRED: Brief description - "difficulty": 6, // REQUIRED: Integer 1-10 (1=absolute beginner, 10=native level) - "original_lang": "english", // REQUIRED: ISO language code of source content - "user_lang": "french", // REQUIRED: ISO language code for translations - "icon": "assets/icons/uk-flag.svg", // OPTIONAL: Path to icon file (relative or absolute) - "icon_fallback": "🇬🇧", // REQUIRED if icon specified: Emoji fallback for missing files - - // === CLASSIFICATION SYSTEM === - // Used for content discovery, filtering, and game compatibility assessment - "tags": [ - // Content characteristics - systems can filter/search using these - "beginner-friendly", // Suitable for beginners (difficulty ≀ 4) - "audio-rich", // Contains significant audio content (>50% items have audio) - "grammar-focus", // Emphasizes grammar learning (has grammar section) - "cultural-content", // Includes cultural context (has cultural section) - "interactive", // Has interactive exercises (matching, corrections, etc.) - "daily-life", // Real-world applicable content - "conversation", // Dialogue-based learning (has dialogues section) - "multimedia" // Multiple content types (text, audio, visual) - ], - - // === LEARNING OBJECTIVES === - // Skills and competencies this module addresses - used for progress tracking - "skills_covered": [ - "vocabulary_recognition", // Identifying and understanding words - "vocabulary_production", // Using words correctly in context - "listening_comprehension", // Understanding spoken language - "reading_comprehension", // Understanding written text - "pronunciation", // Correct sound production - "grammar_application", // Using grammar rules correctly - "cultural_awareness", // Understanding cultural context - "conversation_skills", // Interactive dialogue ability - "translation", // Converting between languages - "pattern_recognition", // Identifying linguistic patterns - "error_correction", // Identifying and fixing mistakes - "audio_discrimination" // Distinguishing between sounds - ], - - // ======================================== - // VOCABULARY SECTION - PROGRESSIVE COMPLEXITY - // ======================================== - // Word definitions with varying levels of detail. Systems should adapt based on available data. - "vocabulary": { - - // LEVEL 1: MINIMAL (Translation only) - // Simplest form - just word and translation string - // Usage: Basic vocabulary games, simple matching - "cat": "chat", - "dog": "chien", - "house": "maison", - - // LEVEL 2: BASIC (Essential data) - // Translation + grammatical type - // Usage: Games that need word categorization - "book": { - "translation": "livre", - "type": "noun" // Values: noun, verb, adjective, adverb, greeting, number, etc. - }, - - "read": { - "translation": "lire", - "type": "verb" - }, - - // LEVEL 3: MEDIUM (Enhanced with media OR pronunciation) - // Add ONE media type: pronunciation OR image - // Usage: Games with visual or audio components - "apple": { - "translation": "pomme", - "type": "noun", - "pronunciation": "/ˈÊp.əl/", // IPA phonetic notation (recommended format) - "image": "images/vocabulary/apple.jpg" // Path to image file - }, - - "beautiful": { - "translation": "beau/belle", - "type": "adjective", - "pronunciation": "/ˈbjuː.tÉȘ.fəl/", - "examples": ["The sunset is beautiful"] // Array of usage examples - }, - - // LEVEL 4: RICH (Multi-media) - // Multiple media types for enhanced learning - // Usage: Advanced vocabulary games, multimedia lessons - "elephant": { - "translation": "Ă©lĂ©phant", - "type": "noun", - "pronunciation": "/ˈel.ÉȘ.fənt/", - "audio": "audio/vocabulary/elephant.mp3", // Audio pronunciation file - "image": "images/vocabulary/elephant.jpg", // Visual representation - "examples": [ - "The elephant is huge", - "Elephants have good memory" - ] - }, - - // LEVEL 5: COMPREHENSIVE (Full linguistic data) - // Maximum detail for advanced language learning - // Usage: Professional language learning, detailed grammar games - "run": { - "translation": "courir", - "type": "verb", - "pronunciation": "/rʌn/", - "audio": "audio/vocabulary/run.mp3", - "image": "images/vocabulary/run_action.gif", // Can be GIF for actions - "examples": [ - "I run in the park every morning", - "She runs faster than me", - "They ran to catch the bus" - ], - "grammarNotes": "Irregular verb: run/runs/running/ran/run", // Teaching notes - "conjugation": { // Verb forms for grammar games - "present": ["run", "runs"], - "past": "ran", - "participle": "run", - "continuous": "running" - }, - "difficulty_context": "Physical action verb - easy to demonstrate" // Teaching hints - }, - - // LEVEL 6: ADVANCED (Cultural context) - // Includes cultural and contextual information - // Usage: Cultural awareness games, advanced language courses - "breakfast": { - "translation": "petit-dĂ©jeuner", - "type": "noun", - "pronunciation": "/ˈbrek.fəst/", - "audio": "audio/vocabulary/breakfast.mp3", - "image": "images/vocabulary/breakfast.jpg", - "examples": [ - "I have breakfast at 7 AM", - "What did you have for breakfast?", - "Breakfast is the most important meal" - ], - "cultural_note": "Traditional English breakfast includes eggs, bacon, beans, and toast" - } - }, - - // ======================================== - // GRAMMAR SYSTEM - STRUCTURED LESSONS - // ======================================== - // Step-by-step grammar instruction with alternating explanations and exercises - // NOTE: This system is for dedicated grammar games/apps, not general content games - "grammar": { - "present_simple_be": { // Lesson identifier (must be unique) - "id": "present_simple_be", // Same as key for validation - "title": "Present Simple - Verb 'to be'", // Display title - "difficulty": 3, // 1-10 scale - "prerequisite": null, // null = no prerequisite, or reference another lesson id - "estimated_time": 15, // Estimated minutes to complete - "learning_objectives": [ // Clear, measurable goals - "Conjugate 'to be' in present tense", - "Use 'to be' in affirmative sentences", - "Form questions with 'to be'" - ], - - // Sequential learning steps - MUST be in order - "steps": [ - { - "type": "explanation", // Types: "explanation" or "exercise" - "order": 1, // Integer ordering (must be sequential) - "title": "Introduction to 'be'", - "content": "The verb 'to be' is the most important verb in English. It has three forms in present tense.", - "translation": "Le verbe 'ĂȘtre' est le verbe le plus important en anglais. Il a trois formes au prĂ©sent.", - "examples": [ // Array of example objects - { "original": "I am happy", "userLanguage": "Je suis heureux" }, - { "original": "You are smart", "userLanguage": "Tu es intelligent" }, - { "original": "She is tall", "userLanguage": "Elle est grande" } - ] - }, - { - "type": "exercise", - "order": 2, - "exercise_type": "multiple_choice", // Exercise types: multiple_choice, transformation, fill_blanks, classification, conjugation - "title": "Choose the correct form", - "questions": [ // Array of question objects - { - "question": "I ___ a student", - "options": ["am", "is", "are"], // Array of choices - "correct": "am", // Single correct answer - "explanation": "Use 'am' with 'I'" // Feedback for learner - }, - { - "question": "She ___ my friend", - "options": ["am", "is", "are"], - "correct": "is", - "explanation": "Use 'is' with 'she', 'he', 'it'" - } - ] - }, - { - "type": "explanation", - "order": 3, - "title": "Negative forms", - "content": "To make negative sentences with 'be', add 'not' after the verb. We often use contractions.", - "translation": "Pour faire des phrases nĂ©gatives avec 'ĂȘtre', ajoutez 'not' aprĂšs le verbe. On utilise souvent des contractions.", - "examples": [ - { - "original": "I am not tired", - "userLanguage": "Je ne suis pas fatiguĂ©", - "contraction": "I'm not tired" // Optional contraction form - } - ] - }, - { - "type": "exercise", - "order": 4, - "exercise_type": "transformation", - "title": "Make these sentences negative", - "questions": [ - { - "original": "I am busy", // Source sentence - "correct": "I am not busy", // Primary correct answer - "alternative_correct": ["I'm not busy"] // Array of acceptable alternatives - } - ] - } - ], - - // Lesson summary and reinforcement - "summary": { - "key_points": [ // Main takeaways - "I am, you are, he/she/it is, we are, they are", - "Negative: add 'not' after 'be'", - "Questions: put 'be' before subject" - ], - "common_mistakes": [ // Frequent errors with corrections - { - "incorrect": "I are happy", - "correct": "I am happy", - "explanation": "Use 'am' with 'I'" - } - ] - } - } - }, - - // ======================================== - // TEXT CONTENT - FLEXIBLE USAGE - // ======================================== - // Text-based content that can optionally include exercises - "texts": [ - { - "title": "My Daily Routine", // Display title - "content": "I wake up at 7 AM every day. First, I brush my teeth and take a shower...", // Main text - "translation": "Je me rĂ©veille Ă  7h tous les jours. D'abord, je me brosse les dents...", // Full translation - - // OPTIONAL: Add comprehension questions to any text - "questions": [ - { - "question": "What time does the person wake up?", - "type": "multiple_choice", // Types: multiple_choice, ai_interpreted - "options": ["6 AM", "7 AM", "8 AM", "9 AM"], - "correctAnswer": "7 AM" - }, - { - "question": "Describe the person's evening routine", - "type": "ai_interpreted", // Requires AI evaluation - "evaluationPrompt": "Check if answer mentions cooking dinner and watching TV" // Prompt for AI evaluator - } - ], - - // OPTIONAL: Add fill-in-the-blank exercises to any text - "fillInBlanks": [ - { - "sentence": "I wake up ___ 7 AM every day", - "options": ["at", "in", "on"], // Multiple choice options - "correctAnswer": "at", - "explanation": "Use 'at' with specific times" - }, - { - "sentence": "The routine is very ___", - "type": "open_ended", // Open-ended answer - "acceptedAnswers": ["good", "nice", "healthy", "regular"], // Acceptable answers - "aiPrompt": "Check if answer describes routine positively" // AI evaluation prompt - } - ] - } - ], - - // ======================================== - // AUDIO-ONLY CONTENT - // ======================================== - // Pure listening exercises WITHOUT transcripts - // NOTE: Audio WITH text should go in texts[] or dialogues[] sections - "audio": [ - { - "title": "Mystery Conversation - Restaurant", - "audioFile": "audio/listening/restaurant_sounds.mp3", // Audio file path - "type": "ambient_listening", // Types: ambient_listening, sound_identification, pronunciation_exercise - "description": "Listen to the ambient sounds and conversation", // Optional description - "questions": [ // Listening comprehension questions - { - "question": "Where does this conversation take place?", - "type": "multiple_choice", - "options": ["Restaurant", "Office", "School", "Park"], - "correctAnswer": "Restaurant" - }, - { - "question": "How many people are speaking?", - "type": "ai_interpreted", - "evaluationPrompt": "Accept numeric answers indicating number of distinct voices" - } - ] - }, - { - "title": "Pronunciation Discrimination", - "audioFile": "audio/pronunciation/minimal_pairs.mp3", - "type": "pronunciation_exercise", - "description": "Listen to similar sounding words and identify differences", - "word_pairs": [ // For pronunciation exercises - ["ship", "sheep"], - ["live", "leave"], - ["cat", "cut"] - ] - } - ], - - // ======================================== - // CULTURAL CONTENT - RICH CONTEXT - // ======================================== - // Cultural material with educational value and context - "cultural": { - // Poetry and literary works - "poems": [ - { - "title": "Roses Are Red", - "content": "Roses are red,\nViolets are blue,\nSugar is sweet,\nAnd so are you.", - "translation": "Les roses sont rouges,\nLes violettes sont bleues...", - "audio": "audio/poems/roses.mp3", // Optional audio recitation - "image": "images/cultural/roses_poem_illustration.jpg", // Optional illustration - "type": "nursery_rhyme", // Types: nursery_rhyme, classic_poem, song, etc. - "cultural_context": "Traditional English nursery rhyme pattern...", - "learning_focus": ["rhyme_patterns", "basic_vocabulary", "rhythm"] // Educational objectives - } - ], - - // Proverbs and sayings - "proverbs": [ - { - "original": "The early bird catches the worm", - "userLanguage": "L'avenir appartient Ă  ceux qui se lĂšvent tĂŽt", - "meaning": "People who wake up early and start working have better chances of success", - "image": "images/cultural/early_bird_illustration.jpg", - "cultural_context": "Common English saying emphasizing the value of being proactive...", - "equivalent_proverbs": { // Cross-cultural equivalents - "french": "L'avenir appartient Ă  ceux qui se lĂšvent tĂŽt", - "literal": "Le premier oiseau attrape le ver" - } - } - ], - - // Unified cultural facts system - "culture_facts": [ - { - "name": "Tea Time", - "category": "tradition", // Categories: tradition, holiday, food, custom, etc. - "description": "Traditional British custom of drinking tea in the afternoon, usually around 4 PM", - "translation": "L'heure du thĂ© - tradition britannique...", - "image": "images/cultural/tea_time.jpg", - "cultural_significance": "Social ritual that brings people together...", - "vocabulary_related": ["tea", "biscuit", "afternoon", "tradition", "social"], // Related vocabulary - "region": "uk" // Geographic association (uk, us, global, etc.) - }, - { - "name": "Christmas", - "category": "holiday", - "date": "December 25th", // Optional date field for holidays - "description": "Major Christian holiday celebrating the birth of Jesus Christ", - "translation": "NoĂ«l - grande fĂȘte chrĂ©tienne...", - "image": "images/cultural/christmas_celebration.jpg", - "customs": ["gift_giving", "family_gatherings", "christmas_tree", "caroling"], // Associated customs - "vocabulary_related": ["Christmas", "gift", "tree", "family", "celebration"], - "region": "global" - }, - { - "name": "Fish and Chips", - "category": "food", - "description": "Traditional British dish of battered fish with fried potatoes", - "translation": "Poisson-frites - plat britannique traditionnel...", - "image": "images/cultural/fish_and_chips.jpg", - "cultural_context": "Popular working-class meal, often served in newspaper wrapping", - "vocabulary_related": ["fish", "chips", "batter", "traditional", "popular"], - "region": "uk", - "ingredients": ["fish", "potatoes", "batter", "oil"], // For food items - "typical_sides": ["mushy_peas", "tartar_sauce", "malt_vinegar"] - } - ] - }, - - // ======================================== - // SENTENCES WITH PARAMETERS - // ======================================== - // Generic sentence structure used for various exercises including corrections - "sentences": [ - { - "original": "Hello, how are you?", // Source language sentence - "userLanguage": "Bonjour, comment allez-vous?", // Target language translation - "type": "greeting", // Sentence classification - "formality": "neutral" // Additional parameter - }, - { - "original": "I like to read books", - "userLanguage": "J'aime lire des livres", - "type": "preference_statement", - "tense": "present_simple" - }, - - // Sentences with correction exercise data - { - "original": "I am happy today", // CORRECT version - "userLanguage": "Je suis heureux aujourd'hui", - "type": "correction_target", // Indicates this is for correction exercises - "correction_data": { - "incorrect_versions": [ // Array of common mistakes - { - "text": "I are happy today", // Incorrect version - "error_type": "subject_verb_agreement", // Classification of error - "explanation": "Use 'am' with pronoun 'I', not 'are'", - "difficulty": 2 // Difficulty of catching this error (1-10) - }, - { - "text": "I is happy today", - "error_type": "subject_verb_agreement", - "explanation": "Use 'am' with pronoun 'I', not 'is'", - "difficulty": 1 // Easier to spot - } - ], - "grammar_focus": "be_verb_conjugation", // Grammar topic - "common_mistake": true // Boolean: is this a frequent error? - } - } - ], - - // ======================================== - // MATCHING EXERCISES - DUAL SYSTEM - // ======================================== - // Two types of matching exercises: traditional 2-column and flexible multi-column - "matching": [ - - // TYPE 1: Traditional two-column matching (backward compatibility) - { - "title": "Match Animals to Their Sounds", - "type": "two_column_matching", // Explicit type declaration - "leftColumn": ["Cat", "Dog", "Cow", "Bird"], // Left side items - "rightColumn": ["Woof", "Meow", "Tweet", "Moo"], // Right side items - "correctPairs": [ // Valid connections - { "left": "Cat", "right": "Meow" }, - { "left": "Dog", "right": "Woof" }, - { "left": "Cow", "right": "Moo" }, - { "left": "Bird", "right": "Tweet" } - ] - }, - - // TYPE 2: Multi-column matching (new flexible system) - { - "title": "Build Correct Sentences", - "type": "multi_column_matching", // Flexible N-column system - "columns": [ // Array of columns (minimum 2, no maximum) - { - "id": 1, // REQUIRED: Numeric identifier for referencing - "name": "Subject", // OPTIONAL: Display label (can be omitted) - "items": ["I", "She", "They", "We"] // REQUIRED: Items in this column - }, - { - "id": 2, - "name": "Verb", - "items": ["am", "is", "are", "are"] - }, - { - "id": 3, - "name": "Complement", - "items": ["happy", "a teacher", "students", "friends"] - } - ], - "valid_combinations": [ // Valid combinations using column IDs - {"1": "I", "2": "am", "3": "happy"}, // References by column ID - {"1": "I", "2": "am", "3": "a teacher"}, - {"1": "She", "2": "is", "3": "happy"}, - {"1": "She", "2": "is", "3": "a teacher"}, - {"1": "They", "2": "are", "3": "students"}, - {"1": "They", "2": "are", "3": "friends"}, - {"1": "We", "2": "are", "3": "students"}, - {"1": "We", "2": "are", "3": "friends"} - ] - }, - - // TYPE 2 Example without column names (demonstrates flexibility) - { - "title": "Match Country Information", - "type": "multi_column_matching", - "columns": [ - { - "id": 1, - "name": "Country", - "items": ["France", "Spain", "Italy", "Germany"] - }, - { - "id": 2, - "name": "Capital", - "items": ["Paris", "Madrid", "Rome", "Berlin"] - }, - { - "id": 3, - // NO "name" field - demonstrates optional nature - "items": ["French", "Spanish", "Italian", "German"] - } - ], - "valid_combinations": [ - {"1": "France", "2": "Paris", "3": "French"}, - {"1": "Spain", "2": "Madrid", "3": "Spanish"}, - {"1": "Italy", "2": "Rome", "3": "Italian"}, - {"1": "Germany", "2": "Berlin", "3": "German"} - ] - } - ], - - // ======================================== - // DIALOGUES - CONVERSATIONAL CONTENT - // ======================================== - // Structured conversations between speakers - // NOTE: Audio WITH text belongs here, not in audio[] section - "dialogues": [ - { - "title": "At the Restaurant", // Dialogue title - "conversation": [ // Array of turns in conversation - { - "speaker": "Waiter", // Speaker identification - "original": "Good evening! Welcome to our restaurant.", - "userLanguage": "Bonsoir! Bienvenue dans notre restaurant." - }, - { - "speaker": "Customer", - "original": "Thank you. Can I see the menu please?", - "userLanguage": "Merci. Puis-je voir le menu s'il vous plaĂźt?" - } - ] - }, - - // Dialogue with synchronized audio - { - "title": "Daily Routine Conversation", - "audio": "audio/conversations/daily_routine.mp3", // Audio file with spoken dialogue - "conversation": [ - { - "speaker": "A", - "original": "What time do you wake up?", - "userLanguage": "À quelle heure te rĂ©veilles-tu?", - "timestamp": 0.5 // OPTIONAL: Time in audio file (seconds) - }, - { - "speaker": "B", - "original": "I usually wake up at 7 AM.", - "userLanguage": "Je me rĂ©veille habituellement Ă  7h.", - "timestamp": 3.2 - } - ] - } - ] - - // ======================================== - // IMPLEMENTATION NOTES FOR AI SYSTEMS - // ======================================== - /* - FIELD OPTIONALITY: - - All fields are optional unless marked REQUIRED - - Systems should gracefully handle missing fields - - Adapt functionality based on available data richness - - VOCABULARY LEVELS: - - Level 1 (string): Basic games only - - Level 2-3 (basic object): Standard games - - Level 4-6 (rich object): Advanced features - - EXERCISE TYPES: - - multiple_choice: Fixed options with single correct answer - - transformation: Convert one form to another - - fill_blanks: Complete sentences with missing words - - classification: Categorize items into groups - - conjugation: Verb form exercises - - ai_interpreted: Requires AI evaluation with prompt - - AUDIO PLACEMENT: - - audio[]: ONLY for content without transcripts - - texts[]/dialogues[]: For content WITH transcripts - - vocabulary.*.audio: Individual word pronunciation - - MATCHING SYSTEMS: - - two_column_matching: Traditional left-right matching - - multi_column_matching: Flexible N-column system with numeric IDs - - CULTURAL CONTENT: - - poems[]: Literary works with cultural context - - proverbs[]: Sayings with cross-cultural equivalents - - culture_facts[]: Unified system for traditions, holidays, food, customs - - ERROR HANDLING: - - Missing files (audio, images): Use fallbacks or skip features - - Invalid references: Ignore and continue with available content - - Malformed data: Log errors but don't crash, use defaults - - EXTENSIBILITY: - - New exercise types can be added without breaking existing systems - - Additional fields can be added to any section - - New sections can be added at root level - - Systems should ignore unknown fields gracefully - */ -} \ No newline at end of file diff --git a/english_exemple_fixed.json b/english_exemple_fixed.json deleted file mode 100644 index 11a7f00..0000000 --- a/english_exemple_fixed.json +++ /dev/null @@ -1,828 +0,0 @@ -{ - // === METADATA SECTION === - // Core module identification and language configuration - "id": "english_class_demo_complete_example", // Unique ID based on name (lowercase, underscores) - "name": "English Class Demo - Complete Example", - "description": "Comprehensive example showcasing all content structure possibilities", - "difficulty": 6, // Scale 1-10: 1=absolute beginner, 10=native level - "original_lang": "english", // Language of the original content - "user_lang": "french", // User's native language for translations - "icon": "assets/icons/uk-flag.svg", // Path to icon file - "icon_fallback": "🇬🇧", // Emoji fallback if file missing - - // === SYSTEM TAGS === - // Categorization for content discovery and filtering - "tags": [ - "beginner-friendly", // Suitable for beginners - "audio-rich", // Contains significant audio content - "grammar-focus", // Emphasizes grammar learning - "cultural-content", // Includes cultural context - "interactive", // Has interactive exercises - "daily-life", // Real-world applicable content - "conversation", // Dialogue-based learning - "multimedia" // Multiple content types (text, audio, visual) - ], - - // === SKILLS COVERED === - // Learning objectives and competencies addressed - "skills_covered": [ - "vocabulary_recognition", // Identifying and understanding words - "vocabulary_production", // Using words correctly in context - "listening_comprehension", // Understanding spoken language - "reading_comprehension", // Understanding written text - "pronunciation", // Correct sound production - "grammar_application", // Using grammar rules correctly - "cultural_awareness", // Understanding cultural context - "conversation_skills", // Interactive dialogue ability - "translation", // Converting between languages - "pattern_recognition", // Identifying linguistic patterns - "error_correction", // Identifying and fixing mistakes - "audio_discrimination" // Distinguishing between sounds - ], - - // === VOCABULARY SECTION === - // Multiple levels of vocabulary completion from minimal to comprehensive - "vocabulary": { - - // === MINIMAL LEVEL (Translation only) === - // Simplest form - just word and translation - "cat": "chat", - "dog": "chien", - "house": "maison", - - // === BASIC LEVEL (Essential data) === - // Translation + type - "book": { - "translation": "livre", - "type": "noun" - }, - - "read": { - "translation": "lire", - "type": "verb" - }, - - // === MEDIUM LEVEL (Common teaching elements) === - // Translation + type + pronunciation OR image - "apple": { - "translation": "pomme", - "type": "noun", - "pronunciation": "/ˈÊp.əl/", - "image": "images/vocabulary/apple.jpg" // Visual representation - }, - - "beautiful": { - "translation": "beau/belle", - "type": "adjective", - "pronunciation": "/ˈbjuː.tÉȘ.fəl/", - "examples": ["The sunset is beautiful"] // Single example - }, - - // === RICH LEVEL (Audio + visual) === - // Multiple media types for enhanced learning - "elephant": { - "translation": "Ă©lĂ©phant", - "type": "noun", - "pronunciation": "/ˈel.ÉȘ.fənt/", - "audio": "audio/vocabulary/elephant.mp3", - "image": "images/vocabulary/elephant.jpg", - "examples": [ - "The elephant is huge", - "Elephants have good memory" - ] - }, - - // === COMPREHENSIVE LEVEL (Full linguistic data) === - // All possible fields for maximum educational value - "run": { - "translation": "courir", - "type": "verb", - "pronunciation": "/rʌn/", - "audio": "audio/vocabulary/run.mp3", - "image": "images/vocabulary/run_action.gif", // Can be GIF for actions - "examples": [ - "I run in the park every morning", - "She runs faster than me", - "They ran to catch the bus" - ], - "grammarNotes": "Irregular verb: run/runs/running/ran/run", - "conjugation": { - "present": ["run", "runs"], - "past": "ran", - "participle": "run", - "continuous": "running" - }, - "difficulty_context": "Physical action verb - easy to demonstrate" - }, - - // === ADVANCED LEVEL (Cultural and contextual) === - "breakfast": { - "translation": "petit-dĂ©jeuner", - "type": "noun", - "pronunciation": "/ˈbrek.fəst/", - "audio": "audio/vocabulary/breakfast.mp3", - "image": "images/vocabulary/breakfast.jpg", - "examples": [ - "I have breakfast at 7 AM", - "What did you have for breakfast?", - "Breakfast is the most important meal" - ], - "cultural_note": "Traditional English breakfast includes eggs, bacon, beans, and toast" - } - }, - - // === GRAMMAR SYSTEM === - // Step-by-step grammar lessons with explanation -> exercise -> explanation -> exercise flow - "grammar": { - "present_simple_be": { - "id": "present_simple_be", - "title": "Present Simple - Verb 'to be'", - "difficulty": 3, - "prerequisite": null, // No prerequisite - foundational lesson - "estimated_time": 15, // minutes - "learning_objectives": [ - "Conjugate 'to be' in present tense", - "Use 'to be' in affirmative sentences", - "Form questions with 'to be'" - ], - - // Sequential steps: explanation -> exercise -> explanation -> exercise - "steps": [ - { - "type": "explanation", - "order": 1, - "title": "Introduction to 'be'", - "content": "The verb 'to be' is the most important verb in English. It has three forms in present tense.", - "translation": "Le verbe 'ĂȘtre' est le verbe le plus important en anglais. Il a trois formes au prĂ©sent.", - "examples": [ - { "original": "I am happy", "userLanguage": "Je suis heureux" }, - { "original": "You are smart", "userLanguage": "Tu es intelligent" }, - { "original": "She is tall", "userLanguage": "Elle est grande" } - ] - }, - { - "type": "exercise", - "order": 2, - "exercise_type": "multiple_choice", - "title": "Choose the correct form", - "questions": [ - { - "question": "I ___ a student", - "options": ["am", "is", "are"], - "correct": "am", - "explanation": "Use 'am' with 'I'" - }, - { - "question": "She ___ my friend", - "options": ["am", "is", "are"], - "correct": "is", - "explanation": "Use 'is' with 'she', 'he', 'it'" - }, - { - "question": "They ___ teachers", - "options": ["am", "is", "are"], - "correct": "are", - "explanation": "Use 'are' with 'they', 'we', 'you'" - } - ] - }, - { - "type": "explanation", - "order": 3, - "title": "Negative forms", - "content": "To make negative sentences with 'be', add 'not' after the verb. We often use contractions.", - "translation": "Pour faire des phrases nĂ©gatives avec 'ĂȘtre', ajoutez 'not' aprĂšs le verbe. On utilise souvent des contractions.", - "examples": [ - { "original": "I am not tired", "userLanguage": "Je ne suis pas fatiguĂ©", "contraction": "I'm not tired" }, - { "original": "He is not here", "userLanguage": "Il n'est pas ici", "contraction": "He isn't here" }, - { "original": "We are not ready", "userLanguage": "Nous ne sommes pas prĂȘts", "contraction": "We aren't ready" } - ] - }, - { - "type": "exercise", - "order": 4, - "exercise_type": "transformation", - "title": "Make these sentences negative", - "questions": [ - { - "original": "I am busy", - "correct": "I am not busy", - "alternative_correct": ["I'm not busy"] - }, - { - "original": "She is happy", - "correct": "She is not happy", - "alternative_correct": ["She isn't happy"] - }, - { - "original": "They are at home", - "correct": "They are not at home", - "alternative_correct": ["They aren't at home"] - } - ] - }, - { - "type": "explanation", - "order": 5, - "title": "Questions with 'be'", - "content": "To make questions, put the 'be' verb before the subject. The word order changes.", - "translation": "Pour faire des questions, mettez le verbe 'ĂȘtre' avant le sujet. L'ordre des mots change.", - "pattern": { - "statement": "Subject + be + complement", - "question": "Be + subject + complement + ?" - }, - "examples": [ - { - "statement": "You are ready", - "question": "Are you ready?", - "answer": "Yes, I am / No, I'm not" - }, - { - "statement": "He is a doctor", - "question": "Is he a doctor?", - "answer": "Yes, he is / No, he isn't" - } - ] - }, - { - "type": "exercise", - "order": 6, - "exercise_type": "transformation", - "title": "Transform to questions", - "questions": [ - { - "original": "You are tired", - "correct": "Are you tired?" - }, - { - "original": "She is a teacher", - "correct": "Is she a teacher?" - }, - { - "original": "They are students", - "correct": "Are they students?" - } - ] - }, - { - "type": "exercise", - "order": 7, - "exercise_type": "fill_blanks", - "title": "Complete the conversation", - "context": "A conversation between two people meeting for the first time", - "questions": [ - { - "sentence": "Hi! ___ you a new student?", - "correct": "Are", - "options": ["Are", "Is", "Am"] - }, - { - "sentence": "Yes, I ___. My name ___ Sarah.", - "correct": ["am", "is"], - "options": ["am/is", "is/am", "are/are"] - }, - { - "sentence": "___ you from France?", - "correct": "Are", - "options": ["Are", "Is", "Am"] - } - ] - } - ], - - // Summary and reinforcement - "summary": { - "key_points": [ - "I am, you are, he/she/it is, we are, they are", - "Negative: add 'not' after 'be'", - "Questions: put 'be' before subject" - ], - "common_mistakes": [ - { - "incorrect": "I are happy", - "correct": "I am happy", - "explanation": "Use 'am' with 'I'" - }, - { - "incorrect": "She am tired", - "correct": "She is tired", - "explanation": "Use 'is' with 'she'" - } - ] - } - }, - - "present_simple_verbs": { - "id": "present_simple_verbs", - "title": "Present Simple - Regular Verbs", - "difficulty": 4, - "prerequisite": "present_simple_be", // Must complete 'be' lesson first - "estimated_time": 20, - "learning_objectives": [ - "Use present simple for habits and facts", - "Add 's' for he/she/it", - "Form negatives with don't/doesn't" - ], - - "steps": [ - { - "type": "explanation", - "order": 1, - "title": "Present Simple usage", - "content": "We use present simple for habits, routines, facts, and things that are always true.", - "translation": "Nous utilisons le prĂ©sent simple pour les habitudes, routines, faits, et choses toujours vraies.", - "examples": [ - { "original": "I work every day", "userLanguage": "Je travaille tous les jours", "usage": "routine" }, - { "original": "The sun rises in the east", "userLanguage": "Le soleil se lĂšve Ă  l'est", "usage": "fact" }, - { "original": "She likes coffee", "userLanguage": "Elle aime le cafĂ©", "usage": "preference" } - ] - }, - { - "type": "exercise", - "order": 2, - "exercise_type": "classification", - "title": "Is it a habit, fact, or preference?", - "questions": [ - { - "sentence": "I eat breakfast at 8 AM", - "correct": "habit", - "options": ["habit", "fact", "preference"] - }, - { - "sentence": "Water boils at 100°C", - "correct": "fact", - "options": ["habit", "fact", "preference"] - }, - { - "sentence": "He loves music", - "correct": "preference", - "options": ["habit", "fact", "preference"] - } - ] - }, - { - "type": "explanation", - "order": 3, - "title": "Third person singular (he/she/it + s)", - "content": "With he, she, it, add 's' to the verb. This is very important in English!", - "translation": "Avec he, she, it, ajoutez 's' au verbe. C'est trĂšs important en anglais!", - "rules": [ - { "rule": "Normal verbs: add 's'", "example": "work → works, play → plays" }, - { "rule": "Verbs ending in s,x,ch,sh: add 'es'", "example": "watch → watches, fix → fixes" }, - { "rule": "Verbs ending in consonant + y: change y to ies", "example": "study → studies, try → tries" } - ], - "examples": [ - { "original": "I work in London", "userLanguage": "Je travaille Ă  Londres" }, - { "original": "She works in London", "userLanguage": "Elle travaille Ă  Londres" } - ] - }, - { - "type": "exercise", - "order": 4, - "exercise_type": "conjugation", - "title": "Add 's' when needed", - "questions": [ - { - "sentence": "He ___ (play) football", - "correct": "plays", - "base_verb": "play" - }, - { - "sentence": "She ___ (watch) TV", - "correct": "watches", - "base_verb": "watch" - }, - { - "sentence": "It ___ (fly) in the sky", - "correct": "flies", - "base_verb": "fly" - } - ] - } - ], - - "summary": { - "key_points": [ - "Present simple = habits, facts, preferences", - "He/she/it + verb + s", - "I/you/we/they + base verb" - ], - "common_mistakes": [ - { - "incorrect": "She work here", - "correct": "She works here", - "explanation": "Add 's' with he/she/it" - } - ] - } - } - }, - - // === TEXT CONTENT SECTION === - // All text-based content with optional question/exercise metadata - "texts": [ - { - "title": "My Daily Routine", - "content": "I wake up at 7 AM every day. First, I brush my teeth and take a shower. Then I have breakfast with my family. After breakfast, I go to work by bus. I work from 9 AM to 5 PM. In the evening, I cook dinner and watch TV. I go to bed at 10 PM.", - "translation": "Je me rĂ©veille Ă  7h tous les jours. D'abord, je me brosse les dents et prends une douche. Ensuite je prends le petit dĂ©jeuner avec ma famille. AprĂšs le petit dĂ©jeuner, je vais au travail en bus. Je travaille de 9h Ă  17h. Le soir, je cuisine le dĂźner et regarde la tĂ©lĂ©. Je me couche Ă  22h.", - // Optional: Add comprehension questions to any text - "questions": [ - { - "question": "What time does the person wake up?", - "type": "multiple_choice", - "options": ["6 AM", "7 AM", "8 AM", "9 AM"], - "correctAnswer": "7 AM" - }, - { - "question": "Describe the person's evening routine", - "type": "ai_interpreted", - "evaluationPrompt": "Check if answer mentions cooking dinner and watching TV" - } - ] - }, - - { - "title": "The Four Seasons", - "content": "There are four seasons in a year: spring, summer, autumn, and winter. Spring is warm and flowers bloom. Summer is hot and sunny. Autumn is cool and leaves change colors. Winter is cold and it sometimes snows.", - "translation": "Il y a quatre saisons dans une annĂ©e: le printemps, l'Ă©tĂ©, l'automne et l'hiver. Le printemps est chaud et les fleurs fleurissent. L'Ă©tĂ© est chaud et ensoleillĂ©. L'automne est frais et les feuilles changent de couleur. L'hiver est froid et il neige parfois.", - // Optional: Add fill-in-the-blank exercises to any text - "fillInBlanks": [ - { - "sentence": "There are _____ seasons in a year", - "options": ["three", "four", "five", "six"], - "correctAnswer": "four", - "explanation": "Spring, summer, autumn, and winter make four seasons" - }, - { - "sentence": "Spring is _____ and flowers bloom", - "type": "open_ended", - "acceptedAnswers": ["warm", "nice", "pleasant", "mild"], - "aiPrompt": "Check if answer describes spring weather positively" - } - ] - } - ], - - // === AUDIO-ONLY CONTENT === - // Pure listening exercises WITHOUT text/transcript (text-based audio goes in texts/dialogues) - "audio": [ - { - "title": "Mystery Conversation - Restaurant", - "audioFile": "audio/listening/restaurant_sounds.mp3", - "type": "ambient_listening", - "questions": [ - { - "question": "Where does this conversation take place?", - "type": "multiple_choice", - "options": ["Restaurant", "Office", "School", "Park"], - "correctAnswer": "Restaurant" - }, - { - "question": "How many people are speaking?", - "type": "ai_interpreted", - "evaluationPrompt": "Accept numeric answers indicating number of distinct voices" - } - ] - }, - { - "title": "Sound Recognition", - "audioFile": "audio/sounds/morning_routine.mp3", - "type": "sound_identification", - "description": "Listen and identify the morning routine sounds", - "questions": [ - { - "question": "What sounds did you hear?", - "type": "ai_interpreted", - "evaluationPrompt": "Check for mentions of alarm, shower, coffee, breakfast sounds" - } - ] - }, - { - "title": "Pronunciation Discrimination", - "audioFile": "audio/pronunciation/minimal_pairs.mp3", - "type": "pronunciation_exercise", - "description": "Listen to similar sounding words and identify differences", - "word_pairs": [ - ["ship", "sheep"], - ["live", "leave"], - ["cat", "cut"] - ] - } - ], - - // === CULTURAL CONTENT === - // Rich cultural material with context and educational value - "cultural": { - // Poetry and literary works - "poems": [ - { - "title": "Roses Are Red", - "content": "Roses are red,\nViolets are blue,\nSugar is sweet,\nAnd so are you.", - "translation": "Les roses sont rouges,\nLes violettes sont bleues,\nLe sucre est doux,\nEt toi aussi.", - "audio": "audio/poems/roses.mp3", - "image": "images/cultural/roses_poem_illustration.jpg", - "type": "nursery_rhyme", - "cultural_context": "Traditional English nursery rhyme pattern, often used to teach basic rhyming and poetry structure to children.", - "learning_focus": ["rhyme_patterns", "basic_vocabulary", "rhythm"] - } - ], - - // Proverbs and sayings - "proverbs": [ - { - "original": "The early bird catches the worm", - "userLanguage": "L'avenir appartient Ă  ceux qui se lĂšvent tĂŽt", - "meaning": "People who wake up early and start working have better chances of success", - "image": "images/cultural/early_bird_illustration.jpg", - "cultural_context": "Common English saying emphasizing the value of being proactive and starting early", - "equivalent_proverbs": { - "french": "L'avenir appartient Ă  ceux qui se lĂšvent tĂŽt", - "literal": "Le premier oiseau attrape le ver" - } - } - ], - - // Cultural facts - unified system for traditions, holidays, food, etc. - "culture_facts": [ - { - "name": "Tea Time", - "category": "tradition", - "description": "Traditional British custom of drinking tea in the afternoon, usually around 4 PM", - "translation": "L'heure du thĂ© - tradition britannique de boire le thĂ© l'aprĂšs-midi, gĂ©nĂ©ralement vers 16h", - "image": "images/cultural/tea_time.jpg", - "cultural_significance": "Social ritual that brings people together, often includes biscuits or small cakes", - "vocabulary_related": ["tea", "biscuit", "afternoon", "tradition", "social"], - "region": "uk" - }, - { - "name": "Christmas", - "category": "holiday", - "date": "December 25th", - "description": "Major Christian holiday celebrating the birth of Jesus Christ", - "translation": "NoĂ«l - grande fĂȘte chrĂ©tienne cĂ©lĂ©brant la naissance de JĂ©sus-Christ", - "image": "images/cultural/christmas_celebration.jpg", - "customs": ["gift_giving", "family_gatherings", "christmas_tree", "caroling"], - "vocabulary_related": ["Christmas", "gift", "tree", "family", "celebration"], - "region": "global" - }, - { - "name": "Fish and Chips", - "category": "food", - "description": "Traditional British dish of battered fish with fried potatoes", - "translation": "Poisson-frites - plat britannique traditionnel de poisson en pĂąte avec des pommes de terre frites", - "image": "images/cultural/fish_and_chips.jpg", - "cultural_context": "Popular working-class meal, often served in newspaper wrapping", - "vocabulary_related": ["fish", "chips", "batter", "traditional", "popular"], - "region": "uk", - "ingredients": ["fish", "potatoes", "batter", "oil"], - "typical_sides": ["mushy_peas", "tartar_sauce", "malt_vinegar"] - }, - { - "name": "Thanksgiving", - "category": "holiday", - "date": "Fourth Thursday in November", - "description": "American holiday celebrating gratitude and harvest", - "translation": "Action de grĂące - fĂȘte amĂ©ricaine cĂ©lĂ©brant la gratitude et la rĂ©colte", - "image": "images/cultural/thanksgiving_dinner.jpg", - "customs": ["family_dinner", "turkey_meal", "gratitude_sharing", "football_watching"], - "vocabulary_related": ["thanksgiving", "turkey", "grateful", "harvest", "family"], - "region": "us" - } - ] - }, - - // === SENTENCES WITH CORRECTION PARAMETERS === - // Generic sentence structure that can be used for various exercises including corrections - "sentences": [ - { - "original": "Hello, how are you?", - "userLanguage": "Bonjour, comment allez-vous?", - "type": "greeting", - "formality": "neutral" - }, - { - "original": "I like to read books", - "userLanguage": "J'aime lire des livres", - "type": "preference_statement", - "tense": "present_simple" - }, - { - "original": "The weather is nice today", - "userLanguage": "Il fait beau aujourd'hui", - "type": "observation", - "topic": "weather" - }, - // Sentences specifically for correction exercises - { - "original": "I am happy today", // Correct version - "userLanguage": "Je suis heureux aujourd'hui", - "type": "correction_target", - "correction_data": { - "incorrect_versions": [ - { - "text": "I are happy today", - "error_type": "subject_verb_agreement", - "explanation": "Use 'am' with pronoun 'I', not 'are'", - "difficulty": 2 - }, - { - "text": "I is happy today", - "error_type": "subject_verb_agreement", - "explanation": "Use 'am' with pronoun 'I', not 'is'", - "difficulty": 1 - } - ], - "grammar_focus": "be_verb_conjugation", - "common_mistake": true - } - }, - { - "original": "She doesn't like apples", // Correct version - "userLanguage": "Elle n'aime pas les pommes", - "type": "correction_target", - "correction_data": { - "incorrect_versions": [ - { - "text": "She don't like apples", - "error_type": "subject_verb_agreement", - "explanation": "Use 'doesn't' with he/she/it, not 'don't'", - "difficulty": 3 - }, - { - "text": "She not like apples", - "error_type": "auxiliary_verb_missing", - "explanation": "Need auxiliary verb 'doesn't' for negative statements", - "difficulty": 4 - } - ], - "grammar_focus": "negative_present_simple", - "common_mistake": true - } - }, - { - "original": "I can swim", // Correct version - "userLanguage": "Je sais nager", - "type": "correction_target", - "correction_data": { - "incorrect_versions": [ - { - "text": "I can to swim", - "error_type": "infinitive_after_modal", - "explanation": "After modal verbs like 'can', use base form without 'to'", - "difficulty": 5 - } - ], - "grammar_focus": "modal_verbs", - "common_mistake": true - } - } - ], - - // === MATCHING EXERCISES === - // Connect-the-lines style exercises - "matching": [ - { - "title": "Match Animals to Their Sounds", - "type": "two_column_matching", - "leftColumn": ["Cat", "Dog", "Cow", "Bird"], - "rightColumn": ["Woof", "Meow", "Tweet", "Moo"], - "correctPairs": [ - { "left": "Cat", "right": "Meow" }, - { "left": "Dog", "right": "Woof" }, - { "left": "Cow", "right": "Moo" }, - { "left": "Bird", "right": "Tweet" } - ] - }, - { - "title": "Match Colors in English and French", - "type": "two_column_matching", - "leftColumn": ["Red", "Blue", "Green", "Yellow"], - "rightColumn": ["Bleu", "Vert", "Rouge", "Jaune"], - "correctPairs": [ - { "left": "Red", "right": "Rouge" }, - { "left": "Blue", "right": "Bleu" }, - { "left": "Green", "right": "Vert" }, - { "left": "Yellow", "right": "Jaune" } - ] - }, - { - "title": "Build Correct Sentences", - "type": "multi_column_matching", - "columns": [ - { - "id": 1, - "name": "Subject", - "items": ["I", "She", "They", "We"] - }, - { - "id": 2, - "name": "Verb", - "items": ["am", "is", "are", "are"] - }, - { - "id": 3, - "name": "Complement", - "items": ["happy", "a teacher", "students", "friends"] - } - ], - "valid_combinations": [ - {"1": "I", "2": "am", "3": "happy"}, - {"1": "I", "2": "am", "3": "a teacher"}, - {"1": "She", "2": "is", "3": "happy"}, - {"1": "She", "2": "is", "3": "a teacher"}, - {"1": "They", "2": "are", "3": "students"}, - {"1": "They", "2": "are", "3": "friends"}, - {"1": "We", "2": "are", "3": "students"}, - {"1": "We", "2": "are", "3": "friends"} - ] - }, - { - "title": "Match Country Information", - "type": "multi_column_matching", - "columns": [ - { - "id": 1, - "name": "Country", - "items": ["France", "Spain", "Italy", "Germany"] - }, - { - "id": 2, - "name": "Capital", - "items": ["Paris", "Madrid", "Rome", "Berlin"] - }, - { - "id": 3, - "items": ["French", "Spanish", "Italian", "German"] - } - ], - "valid_combinations": [ - {"1": "France", "2": "Paris", "3": "French"}, - {"1": "Spain", "2": "Madrid", "3": "Spanish"}, - {"1": "Italy", "2": "Rome", "3": "Italian"}, - {"1": "Germany", "2": "Berlin", "3": "German"} - ] - } - ], - - - // === DIALOGUES === - // Structured conversations between speakers (text with audio goes here, not in audio section) - "dialogues": [ - { - "title": "At the Restaurant", - "conversation": [ - { - "speaker": "Waiter", - "original": "Good evening! Welcome to our restaurant.", - "userLanguage": "Bonsoir! Bienvenue dans notre restaurant." - }, - { - "speaker": "Customer", - "original": "Thank you. Can I see the menu please?", - "userLanguage": "Merci. Puis-je voir le menu s'il vous plaĂźt?" - }, - { - "speaker": "Waiter", - "original": "Of course! Here you are. What would you like to drink?", - "userLanguage": "Bien sĂ»r! Voici. Que voulez-vous boire?" - } - ] - }, - { - "title": "Daily Routine Conversation", - "audio": "audio/conversations/daily_routine.mp3", // Audio WITH text belongs here - "conversation": [ - { - "speaker": "A", - "original": "What time do you wake up?", - "userLanguage": "À quelle heure te rĂ©veilles-tu?", - "timestamp": 0.5 - }, - { - "speaker": "B", - "original": "I usually wake up at 7 AM.", - "userLanguage": "Je me rĂ©veille habituellement Ă  7h.", - "timestamp": 3.2 - }, - { - "speaker": "A", - "original": "That's early! I wake up at 8:30.", - "userLanguage": "C'est tĂŽt! Je me rĂ©veille Ă  8h30.", - "timestamp": 6.8 - }, - { - "speaker": "B", - "original": "I like to exercise before work.", - "userLanguage": "J'aime faire de l'exercice avant le travail.", - "timestamp": 11.1 - }, - { - "speaker": "A", - "original": "That's a good habit!", - "userLanguage": "C'est une bonne habitude!", - "timestamp": 14.5 - } - ] - } - ] -} \ No newline at end of file diff --git a/english_exemple_ultra_commented.json b/english_exemple_ultra_commented.json deleted file mode 100644 index 863f0d9..0000000 --- a/english_exemple_ultra_commented.json +++ /dev/null @@ -1,2224 +0,0 @@ -{ - // ======================================================================================================== - // ======================================================================================================== - // EDUCATIONAL CONTENT MODULE SPECIFICATION - // COMPLETE REFERENCE IMPLEMENTATION - // ======================================================================================================== - // ======================================================================================================== - // - // This JSON file serves as the definitive specification and reference implementation for educational - // content modules used in language learning applications. It demonstrates EVERY possible field, - // parameter, and configuration option available in the system. - // - // CRITICAL IMPLEMENTATION NOTES FOR AI SYSTEMS: - // ============================================= - // 1. FIELD OPTIONALITY: Unless explicitly marked as "REQUIRED", every single field in this specification - // is OPTIONAL. AI systems and game engines MUST be designed to gracefully handle missing fields. - // Do NOT crash or throw errors when fields are absent - instead, adapt functionality based on - // available data richness. - // - // 2. PROGRESSIVE ENHANCEMENT: This specification follows a progressive enhancement model. Basic games - // can work with minimal data (just translations), while advanced features unlock as more data - // becomes available. AI systems should detect data richness and enable appropriate features. - // - // 3. BACKWARD COMPATIBILITY: This format maintains 100% backward compatibility with simpler formats. - // Legacy content using old structures will continue to work without modification. - // - // 4. EXTENSIBILITY: New fields and sections can be added without breaking existing implementations. - // AI systems should ignore unknown fields and continue processing known data. - // - // 5. VALIDATION: Before processing, AI systems should validate the basic structure but should NOT - // fail on missing optional fields. Use default values and graceful degradation. - // - // ======================================================================================================== - - // ======================================================================================================== - // CORE METADATA SECTION - // ======================================================================================================== - // This section contains essential identification and configuration data that every content module - // MUST provide. These fields are used for content discovery, compatibility assessment, and basic - // system functionality. Without these core fields, the content module cannot be processed. - - // REQUIRED: Unique identifier for this content module - // SPECIFICATION: Must be lowercase, use underscores for spaces, contain only alphanumeric characters - // USAGE: Used as primary key in databases, file naming, URL generation, and cross-references - // VALIDATION: Must be unique across all content modules in the system - // AI SYSTEMS: Use this for caching, indexing, and relationship mapping between modules - "id": "english_class_demo_complete_example", - - // REQUIRED: Human-readable display name for this content module - // SPECIFICATION: Should be concise but descriptive, maximum 100 characters recommended - // USAGE: Displayed in user interfaces, content browsers, and selection menus - // LOCALIZATION: This is in the original language; translations may be provided separately - // AI SYSTEMS: Use for search indexing, content recommendations, and display purposes - "name": "English Class Demo - Complete Example", - - // REQUIRED: Brief description explaining what this content module contains and teaches - // SPECIFICATION: Should be 1-3 sentences, maximum 300 characters, clear and informative - // USAGE: Shown in content previews, tooltips, and selection interfaces - // SEO: Should contain relevant keywords for content discovery - // AI SYSTEMS: Use for content categorization, similarity matching, and recommendation algorithms - "description": "Comprehensive example showcasing all content structure possibilities", - - // REQUIRED: Difficulty level on a standardized 1-10 scale - // SPECIFICATION: Integer values only, standardized meanings: - // 1-2: Absolute beginner (first words, basic greetings) - // 3-4: Beginner (simple sentences, basic grammar) - // 5-6: Intermediate (complex sentences, intermediate grammar) - // 7-8: Advanced (nuanced language, advanced concepts) - // 9-10: Native/Expert level (idioms, cultural subtleties, professional language) - // USAGE: Used for content filtering, prerequisite checking, and adaptive difficulty - // AI SYSTEMS: Critical for content sequencing and personalized learning path generation - "difficulty": 6, - - // REQUIRED: ISO 639-1 language code for the source/original language of the content - // SPECIFICATION: Two-letter lowercase ISO code (en, fr, es, de, etc.) - // USAGE: Determines the source language for all "original" fields throughout the module - // LOCALIZATION: Enables proper text-to-speech, spell checking, and grammar analysis - // AI SYSTEMS: Essential for language-specific processing and cross-language content mapping - "original_lang": "english", - - // REQUIRED: ISO 639-1 language code for the user's native language (translation target) - // SPECIFICATION: Two-letter lowercase ISO code, determines translation language - // USAGE: Defines the language for all "userLanguage" fields in the module - // PERSONALIZATION: Allows system to adapt content to user's native language - // AI SYSTEMS: Used for translation validation, cultural adaptation, and localized feedback - "user_lang": "french", - - // OPTIONAL: Path to icon file representing this content module - // SPECIFICATION: Can be relative path, absolute path, or URL. Supported formats: SVG, PNG, JPG, WebP - // FALLBACK: If file is missing or fails to load, use icon_fallback instead - // SIZING: Recommended size 64x64px minimum, should be square aspect ratio - // AI SYSTEMS: Validate file existence before display, implement graceful fallback to icon_fallback - "icon": "assets/icons/uk-flag.svg", - - // REQUIRED IF icon IS SPECIFIED: Emoji fallback for when icon file is unavailable - // SPECIFICATION: Single Unicode emoji character that represents the content theme - // USAGE: Displayed when icon file fails to load, in text-only interfaces, or minimal UIs - // ACCESSIBILITY: Should be descriptive and relevant to content theme - // AI SYSTEMS: Always validate this field exists when icon field is present - "icon_fallback": "🇬🇧", - - // ======================================================================================================== - // CLASSIFICATION AND TAGGING SYSTEM - // ======================================================================================================== - // This section provides structured metadata for content discovery, filtering, and automatic - // compatibility assessment. Tags enable AI systems to make intelligent decisions about content - // usage, game compatibility, and learning path optimization. - - // OPTIONAL: Array of classification tags for content discovery and filtering - // SPECIFICATION: Use lowercase, hyphen-separated tags from the standardized taxonomy below - // USAGE: Content browsers can filter by these tags, AI can assess game compatibility - // EXTENSIBILITY: New tags can be added, but use standard taxonomy when possible - // AI SYSTEMS: Use for automatic content categorization and compatibility scoring - "tags": [ - // CONTENT DIFFICULTY TAGS (mutually exclusive): - "beginner-friendly", // Suitable for beginners (difficulty ≀ 4) - // "intermediate-level", // For intermediate learners (difficulty 5-6) - // "advanced-content", // For advanced learners (difficulty 7-8) - // "expert-native", // For native/expert level (difficulty 9-10) - - // MEDIA RICHNESS TAGS (can combine multiple): - "audio-rich", // Contains significant audio content (>50% of vocabulary items have audio) - // "image-heavy", // Contains many images (>50% of vocabulary items have images) - // "video-content", // Contains video materials - // "text-only", // Primarily text-based content - - // LEARNING FOCUS TAGS (can combine multiple): - "grammar-focus", // Emphasizes grammar learning (has grammar section or grammar exercises) - // "vocabulary-focus", // Primarily vocabulary building - // "pronunciation-focus", // Emphasis on pronunciation and phonetics - // "conversation-focus", // Dialogue and speaking practice emphasis - - // CONTENT TYPE TAGS (can combine multiple): - "cultural-content", // Includes cultural context, traditions, customs (has cultural section) - "interactive", // Has interactive exercises (matching, corrections, fill-in-blanks) - "daily-life", // Real-world applicable content (practical situations) - "conversation", // Dialogue-based learning (has dialogues section) - "multimedia", // Multiple content types (text, audio, visual combined) - - // PEDAGOGICAL APPROACH TAGS (can combine multiple): - // "gamified", // Designed for game-based learning - // "formal-academic", // Academic/textbook style content - // "informal-casual", // Casual, conversational learning style - // "immersive", // Immersive, context-rich learning - - // THEMATIC CONTENT TAGS (can combine multiple): - // "business-english", // Professional/business context - // "travel-language", // Travel and tourism focused - // "academic-language", // Academic and educational contexts - // "everyday-situations" // Common daily life situations - ], - - // OPTIONAL: Array of learning skills and competencies addressed by this content module - // SPECIFICATION: Use standardized skill identifiers for consistency across modules - // USAGE: Progress tracking systems use this to map learning objectives and outcomes - // ASSESSMENT: AI tutoring systems can focus on specific skills based on this metadata - // ANALYTICS: Learning analytics can track skill development across multiple modules - "skills_covered": [ - // VOCABULARY SKILLS: - "vocabulary_recognition", // Passive vocabulary: recognizing and understanding words when encountered - "vocabulary_production", // Active vocabulary: using words correctly in speech and writing - "vocabulary_categorization", // Grouping words by themes, topics, or grammatical categories - - // LISTENING SKILLS: - "listening_comprehension", // Understanding spoken language in various contexts - "audio_discrimination", // Distinguishing between similar sounds, words, or phrases - "listening_for_detail", // Extracting specific information from audio content - "listening_for_gist", // Understanding general meaning and main ideas from audio - - // READING SKILLS: - "reading_comprehension", // Understanding written text at sentence and paragraph level - "reading_for_detail", // Extracting specific information from written text - "reading_fluency", // Reading smoothly and efficiently - "skimming_scanning", // Quick reading techniques for information gathering - - // SPEAKING AND PRONUNCIATION SKILLS: - "pronunciation", // Correct sound production and accent training - "intonation_stress", // Proper word stress and sentence intonation patterns - "oral_fluency", // Speaking smoothly and naturally - "conversation_skills", // Interactive dialogue ability and turn-taking - - // GRAMMAR AND STRUCTURE SKILLS: - "grammar_application", // Using grammar rules correctly in context - "sentence_construction", // Building grammatically correct sentences - "pattern_recognition", // Identifying linguistic patterns and structures - "error_correction", // Identifying and fixing grammatical mistakes - - // CULTURAL AND CONTEXTUAL SKILLS: - "cultural_awareness", // Understanding cultural context and appropriateness - "pragmatic_competence", // Using language appropriately in social contexts - "cross_cultural_communication", // Communicating effectively across cultures - - // COGNITIVE AND LEARNING SKILLS: - "translation", // Converting meaning between languages - "language_comparison", // Understanding similarities and differences between languages - "metalinguistic_awareness", // Understanding how language works as a system - "learning_strategies", // Developing effective language learning techniques - - // FUNCTIONAL SKILLS: - "task_completion", // Using language to accomplish specific tasks - "information_processing", // Understanding and organizing linguistic information - "critical_thinking", // Analyzing and evaluating language use and meaning - "creative_expression" // Using language for creative and personal expression - ], - - // ======================================================================================================== - // VOCABULARY SECTION - PROGRESSIVE COMPLEXITY - // ======================================================================================================== - // The vocabulary section demonstrates a progressive complexity model where content creators can - // start with basic word-translation pairs and gradually add richer linguistic data. This design - // ensures that simple content works in basic games while enabling advanced features as data - // richness increases. AI systems should detect the complexity level of each vocabulary entry - // and enable appropriate features accordingly. - // - // PROGRESSIVE COMPLEXITY LEVELS: - // ============================= - // Level 1 (MINIMAL): String value only - "word": "translation" - // Level 2 (BASIC): Object with translation and type - // Level 3 (MEDIUM): Adds pronunciation OR image (single media enhancement) - // Level 4 (RICH): Multiple media types (audio + image + examples) - // Level 5 (COMPREHENSIVE): Full linguistic data (conjugations, grammar notes) - // Level 6 (ADVANCED): Cultural context and regional variations - // - // AI GAME COMPATIBILITY MATRIX: - // ============================= - // Basic matching games: Require Level 1 minimum - // Pronunciation games: Require Level 3+ with pronunciation or audio - // Visual games: Require Level 3+ with images - // Grammar games: Require Level 5+ with conjugation data - // Cultural games: Require Level 6+ with cultural context - // - "vocabulary": { - - // ================================================================================================ - // LEVEL 1: MINIMAL COMPLEXITY - // ================================================================================================ - // DESCRIPTION: Simplest possible format - just a word and its translation as a string value - // USAGE: Perfect for basic vocabulary games, simple matching exercises, flashcards - // GAME COMPATIBILITY: Works with ALL game types that need basic translation pairs - // PERFORMANCE: Fastest to parse and process, minimal memory footprint - // AUTHORING: Easiest for content creators - just word pairs in spreadsheets - // AI PROCESSING: Detect by checking if value is string (not object) - - "cat": "chat", // English word -> French translation (string format) - "dog": "chien", // Simple word pair, no additional metadata - "house": "maison", // Minimal format ensures maximum compatibility - "water": "eau", // AI systems: treat these as basic vocabulary items - "food": "nourriture", // Enable basic matching, flashcard, and quiz games - - // ================================================================================================ - // LEVEL 2: BASIC COMPLEXITY - // ================================================================================================ - // DESCRIPTION: Object format with essential linguistic metadata - // ADDS: Grammatical type classification for enhanced game mechanics - // USAGE: Enables grammar-aware games, categorization exercises, word type sorting - // GAME COMPATIBILITY: Grammar games can now categorize words appropriately - // AUTHORING EASE: Still simple - just add one field for word type - // AI PROCESSING: Detect by checking for object with 'translation' and 'type' fields only - - "book": { - "translation": "livre", - "type": "noun" // REQUIRED: grammatical category for this word - // STANDARD VALUES: noun, verb, adjective, adverb, pronoun, - // preposition, conjunction, interjection, article, greeting, - // number, color, food, animal, body_part, clothing, etc. - // AI SYSTEMS: Use for word categorization games and grammar exercises - }, - - "read": { - "translation": "lire", - "type": "verb" // Enables verb conjugation games and grammar pattern recognition - }, - - "happy": { - "translation": "heureux", - "type": "adjective" // Enables adjective comparison games and descriptive exercises - }, - - // ================================================================================================ - // LEVEL 3: MEDIUM COMPLEXITY - // ================================================================================================ - // DESCRIPTION: Enhanced with ONE media type - either pronunciation OR image - // ADDS: Single multimedia enhancement for richer learning experience - // USAGE: Enables pronunciation games OR visual recognition games (not both) - // STRATEGY: Choose pronunciation for abstract words, images for concrete nouns - // GAME COMPATIBILITY: Unlocks pronunciation games OR visual matching games - // AUTHORING: Moderate effort - requires recording audio OR finding/creating images - // AI PROCESSING: Detect by presence of 'pronunciation' OR 'image' field (mutually exclusive at this level) - - "apple": { - "translation": "pomme", - "type": "noun", - "pronunciation": "/ˈÊp.əl/", // IPA (International Phonetic Alphabet) notation - // SPECIFICATION: Use standard IPA symbols enclosed in forward slashes - // USAGE: Text-to-speech systems, pronunciation games, phonetic exercises - // VALIDATION: AI should verify IPA format correctness - // ALTERNATIVES: Can also accept simplified phonetic (AP-uhl) - "image": "images/vocabulary/apple.jpg" // Path to visual representation - // SPECIFICATION: Relative or absolute path, supports JPG, PNG, SVG, WebP - // USAGE: Visual vocabulary games, memory games, image-word matching - // FALLBACK: AI should handle missing image files gracefully - // SIZING: Recommended minimum 256x256px for clarity - }, - - "beautiful": { - "translation": "beau/belle", - "type": "adjective", - "pronunciation": "/ˈbjuː.tÉȘ.fəl/", - "examples": ["The sunset is beautiful"] // OPTIONAL: Array of usage examples in context - // USAGE: Help learners understand word usage and context - // SPECIFICATION: Use simple, clear sentences appropriate for difficulty level - // AI SYSTEMS: Can be used for context-based exercises and comprehension - }, - - // ================================================================================================ - // LEVEL 4: RICH COMPLEXITY - // ================================================================================================ - // DESCRIPTION: Multiple media types for comprehensive multimedia learning - // ADDS: Combination of audio, visual, and textual enhancements - // USAGE: Enables advanced vocabulary games with multiple sensory inputs - // LEARNING THEORY: Supports multiple learning styles (visual, auditory, kinesthetic) - // GAME COMPATIBILITY: Unlocks ALL types of multimedia vocabulary games - // AUTHORING: Significant effort - requires multiple media assets per word - // AI PROCESSING: Detect by presence of multiple media fields (audio + image + examples) - - "elephant": { - "translation": "Ă©lĂ©phant", - "type": "noun", - "pronunciation": "/ˈel.ÉȘ.fənt/", - "audio": "audio/vocabulary/elephant.mp3", // Audio pronunciation file - // SPECIFICATION: MP3, WAV, or OGG format, max 10 seconds - // QUALITY: Clear, native speaker pronunciation, minimal background noise - // USAGE: Pronunciation games, listening exercises, audio-visual matching - // FALLBACK: If audio fails, use text-to-speech as backup - "image": "images/vocabulary/elephant.jpg", // Visual representation - // SPECIFICATION: High-quality image, clear subject, minimal background - // CONTEXT: Should show typical/recognizable example of the concept - // ACCESSIBILITY: Should work well with colorblind users - "examples": [ - "The elephant is huge", // Multiple usage examples - "Elephants have good memory" // Shows different contexts and grammatical patterns - ] - // AI SYSTEMS: Rich media enables sophisticated games like: - // - Audio-visual matching (hear word, click correct image) - // - Multi-modal memory games (audio + visual + text) - // - Pronunciation practice with visual feedback - // - Context-based sentence completion exercises - }, - - // ================================================================================================ - // LEVEL 5: COMPREHENSIVE COMPLEXITY - // ================================================================================================ - // DESCRIPTION: Complete linguistic analysis with grammatical patterns and relationships - // ADDS: Advanced linguistic metadata for professional language learning - // USAGE: Enables sophisticated grammar games, conjugation practice, linguistic analysis - // TARGET AUDIENCE: Advanced learners, language teachers, linguistic research - // GAME COMPATIBILITY: Unlocks advanced grammar games and linguistic pattern recognition - // AUTHORING: Expert-level effort - requires linguistic knowledge and detailed analysis - // AI PROCESSING: Detect by presence of 'conjugation' or 'grammarNotes' fields - - "run": { - "translation": "courir", - "type": "verb", - "pronunciation": "/rʌn/", - "audio": "audio/vocabulary/run.mp3", - "image": "images/vocabulary/run_action.gif", // SPECIFICATION: Can be GIF for action words - // USAGE: Animated images help demonstrate actions - // PERFORMANCE: Keep GIFs under 2MB for web performance - "examples": [ - "I run in the park every morning", // Present tense usage - "She runs faster than me", // Third person singular form - "They ran to catch the bus" // Past tense usage - shows verb conjugation in context - ], - "grammarNotes": "Irregular verb: run/runs/running/ran/run", // Educational notes for teachers/advanced learners - // USAGE: Displayed in grammar-focused exercises - // CONTENT: Should highlight important patterns, irregularities, or usage rules - "conjugation": { // OPTIONAL: Detailed verb conjugation patterns - "present": ["run", "runs"], // Array: [base form, third person singular] - "past": "ran", // Past tense form (string for regular, object for complex) - "participle": "run", // Past participle form - "continuous": "running" // Present participle / gerund form - // EXTENSIBILITY: Can add more tenses (future, conditional, subjunctive) as needed - // AI SYSTEMS: Use for automatic conjugation exercises and grammar pattern recognition - }, - "difficulty_context": "Physical action verb - easy to demonstrate" // Teaching hints for AI tutors - // USAGE: Helps AI systems provide contextual learning tips - // CONTENT: Pedagogical insights for optimal teaching approach - }, - - // ================================================================================================ - // LEVEL 6: ADVANCED COMPLEXITY (Cultural Context) - // ================================================================================================ - // DESCRIPTION: Maximum linguistic richness with cultural and contextual information - // ADDS: Cultural awareness, regional variations, cross-cultural understanding - // USAGE: Advanced cultural competency games, cross-cultural communication training - // TARGET AUDIENCE: Advanced learners, cultural immersion programs, international communication - // GAME COMPATIBILITY: Enables cultural awareness games and contextual learning - // AUTHORING: Expert cultural knowledge required, significant research effort - // AI PROCESSING: Detect by presence of 'cultural_note' field - - "breakfast": { - "translation": "petit-dĂ©jeuner", - "type": "noun", - "pronunciation": "/ˈbrek.fəst/", - "audio": "audio/vocabulary/breakfast.mp3", - "image": "images/vocabulary/breakfast.jpg", // Should show culturally representative breakfast - "examples": [ - "I have breakfast at 7 AM", - "What did you have for breakfast?", - "Breakfast is the most important meal" - ], - "cultural_note": "Traditional English breakfast includes eggs, bacon, beans, and toast" - // SPECIFICATION: Brief cultural context explaining cultural significance - // USAGE: Cultural awareness games, cross-cultural communication training - // CONTENT: Should explain cultural practices, traditions, or social norms - // LENGTH: Keep concise (1-2 sentences) for game integration - // AI SYSTEMS: Use for cultural competency assessment and awareness building - } - - // ================================================================================================ - // AI IMPLEMENTATION GUIDELINES FOR VOCABULARY - // ================================================================================================ - /* - COMPLEXITY DETECTION ALGORITHM: - ============================== - 1. Check if value is string -> Level 1 (Minimal) - 2. Check if object has only 'translation' and 'type' -> Level 2 (Basic) - 3. Check if has 'pronunciation' OR 'image' (not both) -> Level 3 (Medium) - 4. Check if has multiple media fields -> Level 4 (Rich) - 5. Check if has 'conjugation' or 'grammarNotes' -> Level 5 (Comprehensive) - 6. Check if has 'cultural_note' -> Level 6 (Advanced) - - GAME COMPATIBILITY MATRIX: - ========================= - Basic Flashcards: Level 1+ - Visual Matching: Level 3+ (with image) - Audio Pronunciation: Level 3+ (with pronunciation or audio) - Grammar Exercises: Level 5+ (with conjugation) - Cultural Games: Level 6+ (with cultural_note) - Advanced Multimedia: Level 4+ (with multiple media) - - ERROR HANDLING: - ============== - - Missing audio files: Fall back to text-to-speech - - Missing image files: Use default placeholder or skip visual components - - Invalid IPA pronunciation: Use simplified phonetic or skip pronunciation features - - Malformed conjugation: Fall back to basic form without conjugation exercises - - PERFORMANCE OPTIMIZATION: - ======================== - - Lazy load media files (audio, images) only when needed - - Cache processed vocabulary data for faster game startup - - Preload critical media for smooth gameplay experience - - Use progressive image loading for better perceived performance - */ - }, - - // ======================================================================================================== - // GRAMMAR SYSTEM - STRUCTURED PEDAGOGY - // ======================================================================================================== - // The grammar system implements a comprehensive pedagogical framework for step-by-step language - // instruction. It follows educational best practices with alternating explanation and practice phases, - // prerequisite tracking, and competency-based progression. This system is designed for dedicated - // grammar learning applications rather than general content games. - // - // PEDAGOGICAL FRAMEWORK: - // ===================== - // 1. SCAFFOLDED LEARNING: Each lesson builds on previous knowledge with clear prerequisites - // 2. INTERLEAVED PRACTICE: Explanations alternate with exercises for optimal retention - // 3. COMPETENCY MAPPING: Clear learning objectives and measurable outcomes - // 4. ADAPTIVE DIFFICULTY: Multiple exercise types accommodate different learning styles - // 5. IMMEDIATE FEEDBACK: Explanations provided for every exercise answer - // - // IMPLEMENTATION NOTES FOR AI SYSTEMS: - // =================================== - // - This system requires a dedicated grammar learning interface - // - Steps must be completed in order - do not allow skipping - // - Track completion status for prerequisite validation - // - Provide rich feedback using explanation fields - // - Adapt presentation based on user performance and learning style - // - "grammar": { - - // ================================================================================================ - // FOUNDATIONAL GRAMMAR LESSON EXAMPLE - // ================================================================================================ - // This lesson demonstrates the complete structure for grammar instruction, including all - // possible fields and educational components. AI systems should use this as a template - // for grammar lesson implementation. - - "present_simple_be": { // LESSON IDENTIFIER: Must be unique within this content module - // NAMING CONVENTION: Use descriptive, hierarchical naming - // VALIDATION: Must match the object key for consistency - - // === LESSON METADATA === - "id": "present_simple_be", // REQUIRED: Exact duplicate of object key (for validation) - "title": "Present Simple - Verb 'to be'", // REQUIRED: Human-readable lesson title for UI display - "difficulty": 3, // REQUIRED: Lesson difficulty on 1-10 scale - // GUIDELINE: Should align with overall module difficulty ±2 levels - "prerequisite": null, // REQUIRED: Reference to prerequisite lesson ID, or null if foundational - // VALIDATION: AI must verify prerequisite completion before allowing access - // DEPENDENCY CHAIN: Must not create circular dependencies - "estimated_time": 15, // REQUIRED: Estimated completion time in minutes - // USAGE: Help learners plan study sessions and set expectations - // ACCURACY: Should be realistic for average learner at stated difficulty level - - // === LEARNING OBJECTIVES === - "learning_objectives": [ // REQUIRED: Array of clear, measurable learning goals - // SPECIFICATION: Use action verbs (conjugate, identify, form, apply) - // ASSESSMENT: Each objective should be testable through lesson exercises - // GRANULARITY: 3-5 objectives per lesson for optimal focus - "Conjugate 'to be' in present tense", // Specific skill: verb conjugation - "Use 'to be' in affirmative sentences", // Application: positive statements - "Form questions with 'to be'" // Synthesis: interrogative transformation - ], - - // === INSTRUCTIONAL SEQUENCE === - // CRITICAL: Steps must be completed in order. AI systems should enforce sequential progression - // PEDAGOGY: Alternates between explanation (input) and exercise (practice) for optimal learning - // ADAPTIVITY: AI can adjust pacing based on user performance but must maintain sequence - "steps": [ - - // ======================================================================================== - // EXPLANATION STEP EXAMPLE - // ======================================================================================== - // Explanation steps provide new information, concepts, and examples before practice - - { - "type": "explanation", // REQUIRED: "explanation" or "exercise" - "order": 1, // REQUIRED: Sequential integer, must start at 1 - "title": "Introduction to 'be'", // REQUIRED: Brief title for this instructional step - "content": "The verb 'to be' is the most important verb in English. It has three forms in present tense.", - // REQUIRED: Main instructional content - // GUIDELINES: Clear, concise language appropriate for difficulty level - // LENGTH: 1-3 sentences for explanations, longer for complex concepts - "translation": "Le verbe 'ĂȘtre' est le verbe le plus important en anglais. Il a trois formes au prĂ©sent.", - // REQUIRED: Translation in user's native language - // USAGE: Ensures comprehension for non-native speakers - // QUALITY: Should be natural, not literal translation - "examples": [ // OPTIONAL: Array of illustrative examples - { - "original": "I am happy", - "userLanguage": "Je suis heureux" - }, - { - "original": "You are smart", - "userLanguage": "Tu es intelligent" - }, - { - "original": "She is tall", - "userLanguage": "Elle est grande" - } - ] - }, - - // ======================================================================================== - // EXERCISE STEP - MULTIPLE CHOICE - // ======================================================================================== - // Exercise steps provide immediate practice of concepts just taught - - { - "type": "exercise", - "order": 2, - "exercise_type": "multiple_choice", // REQUIRED: Specific exercise format - // AVAILABLE TYPES: multiple_choice, transformation, - // fill_blanks, classification, conjugation, matching - "title": "Choose the correct form", // REQUIRED: Clear instruction for the exercise - "questions": [ // REQUIRED: Array of question objects - { - "question": "I ___ a student", // The exercise prompt with blank to fill - "options": ["am", "is", "are"], // Array of possible answers (2-5 options recommended) - "correct": "am", // The correct answer (must match one option exactly) - "explanation": "Use 'am' with 'I'" // REQUIRED: Feedback explaining why this answer is correct - // PEDAGOGY: Reinforces the grammatical rule - }, - { - "question": "She ___ my friend", - "options": ["am", "is", "are"], - "correct": "is", - "explanation": "Use 'is' with 'she', 'he', 'it'" - }, - { - "question": "They ___ teachers", - "options": ["am", "is", "are"], - "correct": "are", - "explanation": "Use 'are' with 'they', 'we', 'you'" - } - ] - }, - - // ======================================================================================== - // ADVANCED EXPLANATION WITH PATTERNS - // ======================================================================================== - // More complex explanations can include structured patterns and detailed examples - - { - "type": "explanation", - "order": 3, - "title": "Negative forms", - "content": "To make negative sentences with 'be', add 'not' after the verb. We often use contractions.", - "translation": "Pour faire des phrases nĂ©gatives avec 'ĂȘtre', ajoutez 'not' aprĂšs le verbe. On utilise souvent des contractions.", - "examples": [ - { - "original": "I am not tired", - "userLanguage": "Je ne suis pas fatiguĂ©", - "contraction": "I'm not tired" // OPTIONAL: Shows contracted form - }, - { - "original": "He is not here", - "userLanguage": "Il n'est pas ici", - "contraction": "He isn't here" - }, - { - "original": "We are not ready", - "userLanguage": "Nous ne sommes pas prĂȘts", - "contraction": "We aren't ready" - } - ] - }, - - // ======================================================================================== - // EXERCISE STEP - TRANSFORMATION - // ======================================================================================== - // Transformation exercises require converting one form to another - - { - "type": "exercise", - "order": 4, - "exercise_type": "transformation", - "title": "Make these sentences negative", - "questions": [ - { - "original": "I am busy", // Source sentence to transform - "correct": "I am not busy", // Primary correct answer - "alternative_correct": ["I'm not busy"] // OPTIONAL: Array of acceptable alternatives - // USAGE: Accommodates contractions, word order variations - }, - { - "original": "She is happy", - "correct": "She is not happy", - "alternative_correct": ["She isn't happy"] - }, - { - "original": "They are at home", - "correct": "They are not at home", - "alternative_correct": ["They aren't at home"] - } - ] - }, - - // ======================================================================================== - // EXPLANATION WITH STRUCTURAL PATTERNS - // ======================================================================================== - // Advanced explanations can include formal patterns and systematic rules - - { - "type": "explanation", - "order": 5, - "title": "Questions with 'be'", - "content": "To make questions, put the 'be' verb before the subject. The word order changes.", - "translation": "Pour faire des questions, mettez le verbe 'ĂȘtre' avant le sujet. L'ordre des mots change.", - - "pattern": { // OPTIONAL: Formal grammatical patterns - "statement": "Subject + be + complement", // Pattern for statements - "question": "Be + subject + complement + ?" // Pattern for questions - // USAGE: Helps visual learners understand structural relationships - // EXTENSION: Can include negative patterns, other transformations - }, - - "examples": [ - { - "statement": "You are ready", // Statement form - "question": "Are you ready?", // Question form - "answer": "Yes, I am / No, I'm not" // OPTIONAL: Expected response patterns - }, - { - "statement": "He is a doctor", - "question": "Is he a doctor?", - "answer": "Yes, he is / No, he isn't" - } - ] - }, - - // ======================================================================================== - // CONTEXTUAL EXERCISE - // ======================================================================================== - // Exercises can include context to make practice more meaningful and engaging - - { - "type": "exercise", - "order": 6, - "exercise_type": "fill_blanks", - "title": "Complete the conversation", - "context": "A conversation between two people meeting for the first time", // OPTIONAL: Situational context - // USAGE: Makes exercises more engaging and realistic - // BENEFITS: Provides cultural context and practical application - "questions": [ - { - "sentence": "Hi! ___ you a new student?", - "correct": "Are", - "options": ["Are", "Is", "Am"] // Can include options for guidance - }, - { - "sentence": "Yes, I ___. My name ___ Sarah.", - "correct": ["am", "is"], // Multiple blanks require array of answers - "options": ["am/is", "is/am", "are/are"] // Can show combined options for clarity - }, - { - "sentence": "___ you from France?", - "correct": "Are", - "options": ["Are", "Is", "Am"] - } - ] - } - ], - - // === LESSON SUMMARY AND REINFORCEMENT === - // Provides consolidation and reference material for the completed lesson - "summary": { - "key_points": [ // REQUIRED: Essential takeaways from lesson - // FORMAT: Concise bullet points (3-7 items) - // CONTENT: Core rules, patterns, or concepts taught - "I am, you are, he/she/it is, we are, they are", // Conjugation pattern - "Negative: add 'not' after 'be'", // Negation rule - "Questions: put 'be' before subject" // Question formation rule - ], - "common_mistakes": [ // OPTIONAL: Frequent errors with corrections - // PEDAGOGY: Helps learners avoid typical pitfalls - // FORMAT: incorrect → correct with explanation - { - "incorrect": "I are happy", - "correct": "I am happy", - "explanation": "Use 'am' with 'I'" - }, - { - "incorrect": "She am tired", - "correct": "She is tired", - "explanation": "Use 'is' with 'she'" - } - ] - } - } - - // ================================================================================================ - // ADDITIONAL GRAMMAR LESSON EXAMPLE - // ================================================================================================ - // Demonstrates prerequisite system and lesson sequencing - - // "present_simple_verbs": { // Second lesson building on first - // "id": "present_simple_verbs", - // "title": "Present Simple - Regular Verbs", - // "difficulty": 4, // Slightly harder than prerequisite - // "prerequisite": "present_simple_be", // Must complete "be" lesson first - // "estimated_time": 20, // Longer, more complex lesson - // "learning_objectives": [ - // "Use present simple for habits and facts", - // "Add 's' for he/she/it", - // "Form negatives with don't/doesn't" - // ], - // // ... additional steps following same pattern - // } - - // ================================================================================================ - // AI IMPLEMENTATION GUIDELINES FOR GRAMMAR - // ================================================================================================ - /* - PREREQUISITE VALIDATION: - ====================== - - Check completion status before allowing lesson access - - Display prerequisite chain to learners - - Recommend review if prerequisite scores are low - - Prevent circular dependencies in lesson design - - STEP SEQUENCING: - =============== - - Enforce strict sequential progression (no skipping) - - Save progress after each completed step - - Allow review of previous steps within same lesson - - Resume from last incomplete step on lesson restart - - EXERCISE TYPE HANDLING: - ===================== - multiple_choice: Present options, validate single selection - transformation: Accept input, check against correct and alternatives - fill_blanks: Handle single or multiple blanks per question - classification: Sort items into categories - conjugation: Provide base verb, expect correct form - matching: Connect items from different columns - - FEEDBACK SYSTEMS: - ================ - - Always show explanation after answer (correct or incorrect) - - Provide immediate feedback, not delayed - - Use explanations to reinforce grammatical concepts - - Adapt feedback tone to learner's proficiency level - - PERFORMANCE TRACKING: - =================== - - Track completion time for each step - - Monitor error rates by exercise type - - Identify struggling concepts for review recommendations - - Generate progress reports for learner motivation - - ERROR HANDLING: - ============== - - Handle malformed lesson data gracefully - - Provide fallback content for missing steps - - Validate answer formats before processing - - Log errors for content improvement feedback - */ - }, - - // ======================================================================================================== - // TEXT CONTENT - FLEXIBLE INTEGRATION - // ======================================================================================================== - // The text content section provides reading materials that can optionally be enhanced with exercises. - // This flexible design allows content creators to start with simple reading texts and progressively - // add interactive elements. AI systems should detect the presence of exercise fields and enable - // appropriate interactive features while gracefully handling text-only content. - // - // DESIGN PHILOSOPHY: - // ================== - // 1. CONTENT FIRST: Texts are valuable on their own, exercises are enhancement - // 2. OPTIONAL INTERACTION: Any text can become interactive by adding exercise fields - // 3. MULTIPLE EXERCISE TYPES: Supports comprehension questions and fill-in-blanks in same text - // 4. CONTEXTUAL LEARNING: Exercises draw from the actual text content for authenticity - // 5. PROGRESSIVE ENHANCEMENT: Basic reading → comprehension → interactive completion - // - "texts": [ - - // ================================================================================================ - // BASIC TEXT WITH COMPREHENSION - // ================================================================================================ - // Demonstrates text with reading comprehension questions of multiple types - - { - "title": "My Daily Routine", // REQUIRED: Display title for the text - // USAGE: Shown in content browsers, reading interfaces - // LENGTH: Keep concise and descriptive - - "content": "I wake up at 7 AM every day. First, I brush my teeth and take a shower. Then I have breakfast with my family. After breakfast, I go to work by bus. I work from 9 AM to 5 PM. In the evening, I cook dinner and watch TV. I go to bed at 10 PM.", - // REQUIRED: Main text content for reading - // LANGUAGE: Should be in original_lang specified in metadata - // COMPLEXITY: Appropriate for stated difficulty level - // LENGTH: 50-500 words recommended for optimal engagement - - "translation": "Je me rĂ©veille Ă  7h tous les jours. D'abord, je me brosse les dents et prends une douche. Ensuite je prends le petit dĂ©jeuner avec ma famille. AprĂšs le petit dĂ©jeuner, je vais au travail en bus. Je travaille de 9h Ă  17h. Le soir, je cuisine le dĂźner et regarde la tĂ©lĂ©. Je me couche Ă  22h.", - // REQUIRED: Complete translation in user_lang - // QUALITY: Should be natural, culturally appropriate translation - // USAGE: Learning support, comprehension verification, cultural adaptation - - // OPTIONAL: Reading comprehension questions - // ACTIVATION: AI systems should detect presence of this field and enable comprehension mode - // VARIETY: Mix question types for comprehensive assessment - "questions": [ - { - "question": "What time does the person wake up?", // Factual recall question - "type": "multiple_choice", // QUESTION TYPES: multiple_choice, ai_interpreted - "options": ["6 AM", "7 AM", "8 AM", "9 AM"], // 3-5 options recommended - "correctAnswer": "7 AM" // Must match one option exactly - // AI PROCESSING: Straightforward validation, immediate feedback possible - }, - { - "question": "Describe the person's evening routine", // Open-ended comprehension - "type": "ai_interpreted", // Requires AI evaluation - "evaluationPrompt": "Check if answer mentions cooking dinner and watching TV" - // REQUIRED for ai_interpreted: Guidance for AI evaluator - // SPECIFICITY: Clear criteria for acceptable answers - // FLEXIBILITY: Allow for paraphrasing and varied expression - }, - { - "question": "How does the person get to work?", // Detail extraction - "type": "multiple_choice", - "options": ["by car", "by bus", "on foot", "by train"], - "correctAnswer": "by bus" - }, - { - "question": "What do you think about this daily routine? Is it healthy?", // Critical thinking - "type": "ai_interpreted", - "evaluationPrompt": "Accept thoughtful opinions about the routine's health aspects, whether positive or negative, as long as reasoning is provided" - } - ], - - // OPTIONAL: Fill-in-the-blank exercises based on the text content - // PEDAGOGY: Reinforces vocabulary and grammar from authentic reading material - // INTEGRATION: Blanks should come from actual text sentences for authenticity - "fillInBlanks": [ - { - "sentence": "I wake up ___ 7 AM every day", // Direct quote from text with blank - "options": ["at", "in", "on"], // Preposition practice - "correctAnswer": "at", - "explanation": "Use 'at' with specific times" // Grammar rule reinforcement - }, - { - "sentence": "I ___ breakfast with my family", // Vocabulary reinforcement - "options": ["have", "make", "do"], // Collocations practice - "correctAnswer": "have", - "explanation": "'Have breakfast' is the correct collocation" - }, - { - "sentence": "The daily routine seems very ___", // Open-ended vocabulary practice - "type": "open_ended", // No fixed options - "acceptedAnswers": ["organized", "structured", "regular", "busy", "normal"], // Multiple valid answers - "aiPrompt": "Accept descriptive adjectives that could reasonably describe a daily routine" - } - ] - }, - - // ================================================================================================ - // CONTENT-RICH TEXT EXAMPLE - // ================================================================================================ - // Demonstrates more complex text with cultural elements and varied exercise types - - { - "title": "The Four Seasons", - "content": "There are four seasons in a year: spring, summer, autumn, and winter. Spring is warm and flowers bloom. Summer is hot and sunny. Autumn is cool and leaves change colors. Winter is cold and it sometimes snows.", - "translation": "Il y a quatre saisons dans une annĂ©e: le printemps, l'Ă©tĂ©, l'automne et l'hiver. Le printemps est chaud et les fleurs fleurissent. L'Ă©tĂ© est chaud et ensoleillĂ©. L'automne est frais et les feuilles changent de couleur. L'hiver est froid et il neige parfois.", - - // VOCABULARY INTEGRATION: Questions can reference vocabulary from other sections - "questions": [ - { - "question": "How many seasons are there in a year?", - "type": "multiple_choice", - "options": ["three", "four", "five", "six"], - "correctAnswer": "four" - }, - { - "question": "Which season do you like best and why?", // Personal connection - "type": "ai_interpreted", - "evaluationPrompt": "Accept any season choice with reasonable explanation about weather, activities, or personal preferences" - } - ], - - "fillInBlanks": [ - { - "sentence": "There are _____ seasons in a year", - "options": ["three", "four", "five", "six"], - "correctAnswer": "four", - "explanation": "Spring, summer, autumn, and winter make four seasons" - }, - { - "sentence": "Spring is _____ and flowers bloom", - "type": "open_ended", - "acceptedAnswers": ["warm", "nice", "pleasant", "mild"], - "aiPrompt": "Check if answer describes spring weather positively" - } - ] - } - - // ================================================================================================ - // TEXT-ONLY EXAMPLE (Minimal Configuration) - // ================================================================================================ - // Demonstrates that texts can exist without exercises for simple reading practice - - // { - // "title": "Simple Reading Practice", - // "content": "This is a simple text for reading practice. It has no exercises attached.", - // "translation": "Ceci est un texte simple pour la pratique de lecture. Il n'a pas d'exercices attachĂ©s." - // // NO questions or fillInBlanks fields - just reading material - // // AI SYSTEMS: Should present this as reading-only content - // } - - // ================================================================================================ - // AI IMPLEMENTATION GUIDELINES FOR TEXTS - // ================================================================================================ - /* - CONTENT DETECTION: - ================= - - Check for presence of 'questions' field to enable comprehension mode - - Check for presence of 'fillInBlanks' field to enable interactive completion - - Present text-only content in reading mode without interactive elements - - Combine both modes if both fields are present - - QUESTION TYPE HANDLING: - ====================== - multiple_choice: Present options clearly, validate selection - ai_interpreted: Use evaluationPrompt for AI assessment, provide detailed feedback - Mix types within same text for varied assessment - - FILL-IN-BLANKS PROCESSING: - ========================= - Standard format: Present options, validate selection - Open-ended format: Use AI evaluation with acceptedAnswers as guidance - Hybrid approach: Accept predefined answers OR AI evaluation for flexibility - - CONTENT ADAPTATION: - ================== - - Adjust reading difficulty presentation based on user level - - Provide vocabulary support for difficult words - - Enable translation toggle for comprehension support - - Track reading time and comprehension scores - - EXERCISE INTEGRATION: - ==================== - - Present reading first, then exercises (or interleaved for advanced users) - - Reference text content in exercise feedback - - Allow re-reading during exercise completion - - Highlight relevant text sections for answers - - ACCESSIBILITY: - ============= - - Support text-to-speech for reading content - - Provide font size adjustment - - Enable high contrast mode for visual accessibility - - Support keyboard navigation for exercises - */ - ], - - // ======================================================================================================== - // AUDIO-ONLY CONTENT - PURE LISTENING - // ======================================================================================================== - // This section is specifically for audio content WITHOUT accompanying text or transcripts. - // The key distinction is that learners must rely solely on listening skills without textual support. - // Content that has both audio AND text should be placed in the texts[] or dialogues[] sections instead. - // - // PEDAGOGICAL PURPOSE: - // =================== - // 1. PURE LISTENING SKILLS: Develops audio comprehension without visual text cues - // 2. REAL-WORLD SIMULATION: Mimics authentic listening situations (conversations, announcements, etc.) - // 3. AUDIO DISCRIMINATION: Trains ear to distinguish sounds, accents, and speech patterns - // 4. CONTEXTUAL INFERENCE: Builds ability to understand meaning from audio context alone - // - // CONTENT GUIDELINES: - // ================== - // - Audio should be clear and professionally recorded - // - Background noise should be minimal unless part of the exercise design - // - Duration should be appropriate for difficulty level (30 seconds to 3 minutes) - // - Multiple speakers can be used for realistic conversation practice - // - "audio": [ - - // ================================================================================================ - // AMBIENT LISTENING EXERCISE - // ================================================================================================ - // Tests ability to identify context and extract information from environmental audio cues - - { - "title": "Mystery Conversation - Restaurant", // REQUIRED: Descriptive title for the exercise - "audioFile": "audio/listening/restaurant_sounds.mp3", // REQUIRED: Path to audio file - // SPECIFICATION: MP3, WAV, or OGG format - // QUALITY: Clear audio, appropriate volume levels - // DURATION: 30 seconds to 2 minutes recommended - - "type": "ambient_listening", // REQUIRED: Type of listening exercise - // TYPES: ambient_listening, sound_identification, - // pronunciation_exercise, dictation, conversation_analysis - - "description": "Listen to the ambient sounds and conversation", // OPTIONAL: Brief description of what to expect - // USAGE: Helps set learner expectations - // CONTENT: Should not give away answers - - "questions": [ // REQUIRED: Array of listening comprehension questions - { - "question": "Where does this conversation take place?", // Context identification - "type": "multiple_choice", - "options": ["Restaurant", "Office", "School", "Park"], - "correctAnswer": "Restaurant" - // PEDAGOGY: Tests ability to identify setting from audio context clues - }, - { - "question": "How many people are speaking?", // Audio discrimination - "type": "ai_interpreted", - "evaluationPrompt": "Accept numeric answers indicating number of distinct voices" - // CHALLENGE: Requires distinguishing between different speakers - }, - { - "question": "What is the mood or atmosphere of the conversation?", // Inference skills - "type": "ai_interpreted", - "evaluationPrompt": "Accept descriptions of mood such as friendly, formal, rushed, relaxed, etc." - // ADVANCED SKILL: Reading emotional context from audio cues - } - ] - }, - - // ================================================================================================ - // SOUND IDENTIFICATION EXERCISE - // ================================================================================================ - // Focuses on recognizing specific sounds and their sequence in daily life contexts - - { - "title": "Sound Recognition - Morning Routine", - "audioFile": "audio/sounds/morning_routine.mp3", - "type": "sound_identification", - "description": "Listen and identify the morning routine sounds in order", - - "questions": [ - { - "question": "What sounds did you hear in order?", // Sequencing challenge - "type": "ai_interpreted", - "evaluationPrompt": "Check for mentions of alarm clock, shower, coffee brewing, breakfast preparation sounds in logical sequence" - // COGNITIVE SKILL: Memory and sequencing from audio information - }, - { - "question": "Which sound happened first?", // Specific identification - "type": "multiple_choice", - "options": ["Alarm clock", "Shower running", "Coffee brewing", "Door closing"], - "correctAnswer": "Alarm clock" - }, - { - "question": "How long do you think this morning routine takes?", // Time estimation - "type": "ai_interpreted", - "evaluationPrompt": "Accept reasonable time estimates between 15-45 minutes with basic reasoning" - } - ] - }, - - // ================================================================================================ - // PRONUNCIATION DISCRIMINATION EXERCISE - // ================================================================================================ - // Specialized for training phonetic discrimination and pronunciation awareness - - { - "title": "Pronunciation Discrimination - Minimal Pairs", - "audioFile": "audio/pronunciation/minimal_pairs.mp3", - "type": "pronunciation_exercise", - "description": "Listen to similar sounding words and identify differences", - - "word_pairs": [ // OPTIONAL: Specific to pronunciation exercises - ["ship", "sheep"], // Minimal pair examples - ["live", "leave"], // Helps learners focus on specific sound differences - ["cat", "cut"] // Used for targeted pronunciation training - ], - - "questions": [ - { - "question": "Which word did you hear first in the first pair?", - "type": "multiple_choice", - "options": ["ship", "sheep"], - "correctAnswer": "ship" - // PRECISION SKILL: Distinguishing minimal sound differences - }, - { - "question": "How many different word pairs did you identify?", - "type": "multiple_choice", - "options": ["2", "3", "4", "5"], - "correctAnswer": "3" - // COUNTING SKILL: Audio attention and memory - } - ] - }, - - // ================================================================================================ - // DICTATION EXERCISE EXAMPLE - // ================================================================================================ - // Pure dictation without visual text support - advanced listening skill - - { - "title": "Simple Dictation - Numbers and Time", - "audioFile": "audio/dictation/numbers_time.mp3", - "type": "dictation", - "description": "Listen and write down exactly what you hear", - - "questions": [ - { - "question": "Write the time you heard", // Exact transcription required - "type": "ai_interpreted", - "evaluationPrompt": "Accept variations of 'three thirty', '3:30', 'half past three' for the time mentioned" - // PRECISION: Tests ability to capture specific information accurately - }, - { - "question": "How many numbers were mentioned in total?", // Quantitative listening - "type": "multiple_choice", - "options": ["3", "4", "5", "6"], - "correctAnswer": "4" - } - ] - } - - // ================================================================================================ - // AI IMPLEMENTATION GUIDELINES FOR AUDIO - // ================================================================================================ - /* - AUDIO FILE HANDLING: - =================== - - Validate audio file existence before presenting exercise - - Provide audio controls: play, pause, rewind, adjust speed - - Support multiple playback attempts (typically 2-3 times) - - Handle audio loading errors gracefully with user-friendly messages - - EXERCISE TYPE PROCESSING: - ======================== - ambient_listening: Focus on context and environment recognition - sound_identification: Emphasize specific sound recognition and sequencing - pronunciation_exercise: Use word_pairs data for focused phonetic training - dictation: Require exact or near-exact transcription accuracy - conversation_analysis: Analyze speaker interactions and communication patterns - - QUESTION RESPONSE HANDLING: - ========================== - multiple_choice: Standard validation against correct answer - ai_interpreted: Use evaluationPrompt for flexible assessment - Allow partial credit for complex listening tasks - Provide rich feedback referencing specific audio segments when possible - - ACCESSIBILITY AND USABILITY: - ============================ - - Provide volume controls and audio quality indicators - - Support keyboard shortcuts for audio control - - Enable subtitle toggle ONLY for accessibility needs (not for exercise content) - - Implement progress tracking for long audio files - - ADAPTIVE FEATURES: - ================= - - Allow playback speed adjustment (0.75x to 1.25x) - - Provide difficulty progression (start with clear audio, add background noise) - - Track listening patterns to identify problem areas - - Suggest replay strategies for improved comprehension - */ - ], - - // ======================================================================================================== - // CULTURAL CONTENT - COMPREHENSIVE CONTEXT - // ======================================================================================================== - // The cultural section provides rich contextual information that enhances language learning with - // cultural awareness and cross-cultural understanding. This content supports advanced pedagogical - // goals beyond pure language mechanics, helping learners understand the cultural framework in - // which the language operates. - // - // PEDAGOGICAL OBJECTIVES: - // ====================== - // 1. CULTURAL COMPETENCY: Understanding cultural norms, values, and practices - // 2. CONTEXTUAL LANGUAGE USE: Learning when and how to use language appropriately - // 3. CROSS-CULTURAL AWARENESS: Comparing and contrasting different cultural approaches - // 4. AUTHENTIC COMMUNICATION: Preparing for real-world cultural interactions - // 5. CULTURAL SENSITIVITY: Developing respect and understanding for cultural differences - // - "cultural": { - - // ================================================================================================ - // POETRY AND LITERARY WORKS - // ================================================================================================ - // Literary content provides cultural insights through traditional and contemporary works - - "poems": [ - { - "title": "Roses Are Red", // REQUIRED: Title of the literary work - "content": "Roses are red,\nViolets are blue,\nSugar is sweet,\nAnd so are you.", - // REQUIRED: Full text of the poem/literary work - // FORMAT: Use \n for line breaks in poetry - // PRESERVATION: Maintain original formatting and structure - - "translation": "Les roses sont rouges,\nLes violettes sont bleues,\nLe sucre est doux,\nEt toi aussi.", - // REQUIRED: Translation preserving poetic structure - // CHALLENGE: Maintain rhythm and rhyme when possible - // CULTURAL ADAPTATION: May require cultural equivalent rather than literal translation - - "audio": "audio/poems/roses.mp3", // OPTIONAL: Audio recitation of the poem - // QUALITY: Should demonstrate proper pronunciation and rhythm - // SPEAKER: Native speaker with clear articulation - - "image": "images/cultural/roses_poem_illustration.jpg", // OPTIONAL: Visual illustration - // CONTENT: Should enhance understanding or cultural context - // STYLE: Can be artistic, historical, or educational - - "type": "nursery_rhyme", // REQUIRED: Classification of literary work - // TYPES: nursery_rhyme, classic_poem, song, proverb, - // folk_tale, modern_poetry, traditional_chant - - "cultural_context": "Traditional English nursery rhyme pattern, often used to teach basic rhyming and poetry structure to children.", - // REQUIRED: Explanation of cultural significance - // CONTENT: Historical background, social context, usage patterns - // AUDIENCE: Should be accessible to language learners - - "learning_focus": ["rhyme_patterns", "basic_vocabulary", "rhythm"] - // OPTIONAL: Specific pedagogical elements highlighted - // USAGE: Guides teachers and AI systems on educational applications - // VALUES: linguistic features, cultural concepts, learning skills - } - ], - - // ================================================================================================ - // PROVERBS AND SAYINGS - // ================================================================================================ - // Traditional wisdom expressions that reveal cultural values and thinking patterns - - "proverbs": [ - { - "original": "The early bird catches the worm", // REQUIRED: Proverb in original language - "userLanguage": "L'avenir appartient Ă  ceux qui se lĂšvent tĂŽt", - // REQUIRED: Translation (may be cultural equivalent, not literal) - - "meaning": "People who wake up early and start working have better chances of success", - // REQUIRED: Plain language explanation of the proverb's meaning - // AUDIENCE: Should be clear to non-native speakers - // DEPTH: Explain both literal and metaphorical meanings - - "image": "images/cultural/early_bird_illustration.jpg", // OPTIONAL: Visual representation - // CONTENT: Can be literal (bird with worm) or metaphorical (early worker) - - "cultural_context": "Common English saying emphasizing the value of being proactive and starting early", - // REQUIRED: Cultural significance and usage context - // SCOPE: When, where, and by whom this proverb is commonly used - - "equivalent_proverbs": { // OPTIONAL: Cross-cultural equivalent expressions - "french": "L'avenir appartient Ă  ceux qui se lĂšvent tĂŽt", // Direct cultural equivalent - "literal": "Le premier oiseau attrape le ver" // Literal translation for comparison - // USAGE: Helps learners understand cultural translation vs. literal translation - // EXPANSION: Can include equivalents from multiple cultures - } - } - ], - - // ================================================================================================ - // UNIFIED CULTURAL FACTS SYSTEM - // ================================================================================================ - // Comprehensive system for various cultural elements: traditions, holidays, food, customs, etc. - // This unified approach allows for consistent data structure across different cultural domains. - - "culture_facts": [ - - // ============================================================================================ - // TRADITION EXAMPLE - // ============================================================================================ - { - "name": "Tea Time", // REQUIRED: Name of the cultural element - "category": "tradition", // REQUIRED: Type of cultural element - // CATEGORIES: tradition, holiday, food, custom, - // celebration, social_norm, business_practice, educational_practice - - "description": "Traditional British custom of drinking tea in the afternoon, usually around 4 PM", - // REQUIRED: Clear, factual description - // AUDIENCE: Accessible to non-native speakers and cultural outsiders - - "translation": "L'heure du thĂ© - tradition britannique de boire le thĂ© l'aprĂšs-midi, gĂ©nĂ©ralement vers 16h", - // REQUIRED: Translation with cultural adaptation - // APPROACH: May include explanatory additions for cultural clarity - - "image": "images/cultural/tea_time.jpg", // OPTIONAL: Representative photograph or illustration - // CONTENT: Should show authentic cultural practice - // QUALITY: High quality, culturally respectful representation - - "cultural_significance": "Social ritual that brings people together, often includes biscuits or small cakes", - // OPTIONAL: Deeper cultural meaning and social function - // DEPTH: Explains WHY this practice is culturally important - - "vocabulary_related": ["tea", "biscuit", "afternoon", "tradition", "social"], - // OPTIONAL: Associated vocabulary for language learning - // INTEGRATION: Links cultural content with vocabulary learning - // USAGE: Can be used for themed vocabulary exercises - - "region": "uk" // OPTIONAL: Geographic/cultural region identifier - // VALUES: uk, us, australia, canada, global, etc. - // USAGE: Helps learners understand cultural scope and variation - }, - - // ============================================================================================ - // HOLIDAY EXAMPLE - // ============================================================================================ - { - "name": "Christmas", - "category": "holiday", - "date": "December 25th", // OPTIONAL: Specific date for holidays and celebrations - // FORMAT: Natural language date description - // CULTURAL VARIATION: Note when dates vary by culture/region - - "description": "Major Christian holiday celebrating the birth of Jesus Christ", - "translation": "NoĂ«l - grande fĂȘte chrĂ©tienne cĂ©lĂ©brant la naissance de JĂ©sus-Christ", - "image": "images/cultural/christmas_celebration.jpg", - - "customs": ["gift_giving", "family_gatherings", "christmas_tree", "caroling"], - // OPTIONAL: Associated practices and traditions - // FORMAT: Array of short descriptive phrases - // USAGE: Vocabulary building and cultural understanding - - "vocabulary_related": ["Christmas", "gift", "tree", "family", "celebration"], - "region": "global" // Indicates widespread cultural adoption - }, - - // ============================================================================================ - // FOOD EXAMPLE - // ============================================================================================ - { - "name": "Fish and Chips", - "category": "food", - "description": "Traditional British dish of battered fish with fried potatoes", - "translation": "Poisson-frites - plat britannique traditionnel de poisson en pĂąte avec des pommes de terre frites", - "image": "images/cultural/fish_and_chips.jpg", - - "cultural_context": "Popular working-class meal, often served in newspaper wrapping", - // OPTIONAL: Social and historical context - // CONTENT: Class associations, historical development, social significance - - "vocabulary_related": ["fish", "chips", "batter", "traditional", "popular"], - "region": "uk", - - "ingredients": ["fish", "potatoes", "batter", "oil"], - // OPTIONAL: Specific to food items - // USAGE: Cooking vocabulary, dietary information - - "typical_sides": ["mushy_peas", "tartar_sauce", "malt_vinegar"] - // OPTIONAL: Additional food vocabulary and cultural eating patterns - }, - - // ============================================================================================ - // HOLIDAY WITH REGIONAL VARIATION - // ============================================================================================ - { - "name": "Thanksgiving", - "category": "holiday", - "date": "Fourth Thursday in November", // US-specific date format - "description": "American holiday celebrating gratitude and harvest", - "translation": "Action de grĂące - fĂȘte amĂ©ricaine cĂ©lĂ©brant la gratitude et la rĂ©colte", - "image": "images/cultural/thanksgiving_dinner.jpg", - - "customs": ["family_dinner", "turkey_meal", "gratitude_sharing", "football_watching"], - "vocabulary_related": ["thanksgiving", "turkey", "grateful", "harvest", "family"], - "region": "us" // Region-specific cultural element - } - - // ============================================================================================ - // ADDITIONAL CULTURAL CATEGORY EXAMPLES - // ============================================================================================ - // Additional categories can include: - // - business_practice: "Bowing in Japanese business meetings" - // - social_norm: "Queuing politely in British culture" - // - educational_practice: "Raising hand to speak in American classrooms" - // - celebration: "Quinceañera in Latin American culture" - // - custom: "Removing shoes before entering homes in many Asian cultures" - ] - - // ================================================================================================ - // AI IMPLEMENTATION GUIDELINES FOR CULTURAL CONTENT - // ================================================================================================ - /* - CULTURAL SENSITIVITY: - ==================== - - Present cultural information respectfully and accurately - - Avoid stereotypes and overgeneralizations - - Include cultural variations within same regions/countries - - Acknowledge cultural evolution and contemporary changes - - CONTENT ORGANIZATION: - ==================== - - Use category field for systematic organization and filtering - - Enable region-based filtering for location-specific learning - - Cross-reference vocabulary_related with main vocabulary section - - Link cultural facts to relevant exercises and activities - - MULTIMEDIA INTEGRATION: - ====================== - - Validate image files and provide meaningful alt text - - Support audio pronunciation for cultural terms - - Enable interactive cultural comparison exercises - - Provide visual cultural timelines for historical context - - PEDAGOGICAL APPLICATIONS: - ======================== - - Create cultural awareness quizzes using culture_facts data - - Develop comparative culture exercises across regions - - Integrate cultural vocabulary into standard language games - - Generate discussion prompts for cultural exchange - - ACCESSIBILITY AND INCLUSION: - =========================== - - Provide multiple cultural perspectives on shared practices - - Include contemporary as well as traditional cultural elements - - Support learners from diverse cultural backgrounds - - Enable cultural reflection and comparison exercises - */ - }, - - // ======================================================================================================== - // SENTENCES WITH COMPREHENSIVE PARAMETERS - // ======================================================================================================== - // The sentences section serves as a versatile, unified system for various language exercises including - // translation practice, grammar correction, and contextual learning. This design eliminates redundancy - // by using a single data structure with rich parameters to support multiple exercise types. - // - // DESIGN PHILOSOPHY: - // ================== - // 1. UNIFIED STRUCTURE: One sentence format supports multiple exercise types - // 2. RICH PARAMETERS: Extensive metadata enables sophisticated exercise generation - // 3. CORRECTION INTEGRATION: Includes both correct forms and common errors - // 4. CONTEXTUAL CLASSIFICATION: Sentences tagged for situational appropriateness - // 5. PROGRESSIVE COMPLEXITY: From simple translation to advanced error correction - // - "sentences": [ - - // ================================================================================================ - // BASIC SENTENCE EXAMPLES - // ================================================================================================ - // Simple sentences with fundamental classification for basic exercises - - { - "original": "Hello, how are you?", // REQUIRED: Source language sentence - "userLanguage": "Bonjour, comment allez-vous?", // REQUIRED: Target language translation - "type": "greeting", // REQUIRED: Functional classification - // TYPES: greeting, question, statement, command, exclamation, - // request, invitation, apology, thanks, goodbye - - "formality": "neutral" // OPTIONAL: Register and appropriateness level - // VALUES: formal, neutral, informal, casual, intimate - // USAGE: Teaches sociolinguistic appropriateness - }, - - { - "original": "I like to read books", - "userLanguage": "J'aime lire des livres", - "type": "preference_statement", // Semantic classification - "tense": "present_simple" // OPTIONAL: Grammatical tense identification - // VALUES: present_simple, present_continuous, past_simple, etc. - // USAGE: Grammar-focused exercises and tense practice - }, - - { - "original": "The weather is nice today", - "userLanguage": "Il fait beau aujourd'hui", - "type": "observation", - "topic": "weather" // OPTIONAL: Thematic classification - // VALUES: weather, food, family, work, travel, health, etc. - // USAGE: Thematic vocabulary exercises and conversation practice - }, - - // ================================================================================================ - // CORRECTION-ENABLED SENTENCES - // ================================================================================================ - // Sentences with comprehensive error correction data for grammar instruction - - { - "original": "I am happy today", // CORRECT version serves as the teaching target - "userLanguage": "Je suis heureux aujourd'hui", - "type": "correction_target", // REQUIRED: Indicates this sentence has error correction data - - "correction_data": { // REQUIRED for correction_target type - "incorrect_versions": [ // Array of common mistakes and their analysis - { - "text": "I are happy today", // The incorrect sentence learners might produce - "error_type": "subject_verb_agreement", // Classification of the grammatical error - // TYPES: subject_verb_agreement, tense_error, word_order, - // article_error, preposition_error, spelling_error, etc. - - "explanation": "Use 'am' with pronoun 'I', not 'are'", - // REQUIRED: Clear explanation of why it's wrong - // PEDAGOGY: Should teach the underlying rule - - "difficulty": 2 // OPTIONAL: How hard this error is to catch (1-10 scale) - // USAGE: Adaptive error presentation based on learner level - }, - { - "text": "I is happy today", - "error_type": "subject_verb_agreement", - "explanation": "Use 'am' with pronoun 'I', not 'is'", - "difficulty": 1 // Easier error to spot than the previous one - } - ], - - "grammar_focus": "be_verb_conjugation", // OPTIONAL: Main grammatical concept being taught - // INTEGRATION: Links to grammar section lessons - // VALUES: Should match grammar lesson IDs when possible - - "common_mistake": true // OPTIONAL: Boolean indicating if this is a frequent error - // USAGE: Prioritize common mistakes in error correction exercises - } - }, - - { - "original": "She doesn't like apples", // Another correction example with different error types - "userLanguage": "Elle n'aime pas les pommes", - "type": "correction_target", - "correction_data": { - "incorrect_versions": [ - { - "text": "She don't like apples", - "error_type": "subject_verb_agreement", - "explanation": "Use 'doesn't' with he/she/it, not 'don't'", - "difficulty": 3 - }, - { - "text": "She not like apples", - "error_type": "auxiliary_verb_missing", - "explanation": "Need auxiliary verb 'doesn't' for negative statements", - "difficulty": 4 - } - ], - "grammar_focus": "negative_present_simple", - "common_mistake": true - } - }, - - { - "original": "I can swim", // Modal verb correction example - "userLanguage": "Je sais nager", - "type": "correction_target", - "correction_data": { - "incorrect_versions": [ - { - "text": "I can to swim", - "error_type": "infinitive_after_modal", - "explanation": "After modal verbs like 'can', use base form without 'to'", - "difficulty": 5 - } - ], - "grammar_focus": "modal_verbs", - "common_mistake": true - } - }, - - // ================================================================================================ - // CONTEXTUALLY RICH SENTENCES - // ================================================================================================ - // Sentences with extensive contextual metadata for sophisticated exercises - - { - "original": "Could you please pass the salt?", - "userLanguage": "Pourriez-vous me passer le sel, s'il vous plaĂźt?", - "type": "polite_request", - "formality": "formal", - "topic": "dining", - "situation": "restaurant_meal", // OPTIONAL: Specific situational context - // VALUES: restaurant_meal, business_meeting, family_dinner, - // casual_conversation, phone_call, etc. - // USAGE: Situational language practice and appropriateness training - - "cultural_note": "Polite request format commonly used in formal dining situations" - // OPTIONAL: Cultural usage information - // INTEGRATION: Links sentence usage to cultural practices - }, - - { - "original": "I'm running late for the meeting", - "userLanguage": "Je suis en retard pour la rĂ©union", - "type": "statement", - "formality": "neutral", - "topic": "work", - "situation": "business_context", - "tense": "present_continuous", - "emotion": "stress" // OPTIONAL: Emotional context - // VALUES: happiness, stress, anger, excitement, sadness, etc. - // USAGE: Emotional expression exercises and empathy building - } - - // ================================================================================================ - // SPECIALIZED SENTENCE TYPES - // ================================================================================================ - // Examples of sentences optimized for specific learning objectives - - // PRONUNCIATION FOCUS: - // { - // "original": "She sells seashells by the seashore", - // "userLanguage": "Elle vend des coquillages au bord de mer", - // "type": "tongue_twister", - // "pronunciation_focus": ["s_sound", "sh_sound"], - // "difficulty_pronunciation": 8 - // } - - // IDIOM TEACHING: - // { - // "original": "It's raining cats and dogs", - // "userLanguage": "Il pleut des cordes", - // "type": "idiom", - // "literal_meaning": "It's raining very heavily", - // "cultural_origin": "English weather expressions" - // } - - // CONDITIONAL STRUCTURES: - // { - // "original": "If I were rich, I would travel the world", - // "userLanguage": "Si j'Ă©tais riche, je voyagerais autour du monde", - // "type": "conditional_statement", - // "conditional_type": "second_conditional", - // "grammar_focus": "hypothetical_situations" - // } - - // ================================================================================================ - // AI IMPLEMENTATION GUIDELINES FOR SENTENCES - // ================================================================================================ - /* - EXERCISE TYPE GENERATION: - ======================== - - Use type field to generate appropriate exercise formats - - Leverage correction_data for error identification games - - Apply formality/situation filters for contextual appropriateness training - - Combine multiple parameters for complex exercise generation - - CORRECTION EXERCISE PROCESSING: - ============================== - - Present incorrect_versions for learners to identify and correct - - Use difficulty ratings for adaptive error presentation - - Provide rich feedback using explanation fields - - Track error_type patterns for personalized grammar focus - - CONTEXTUAL EXERCISE INTEGRATION: - =============================== - - Group sentences by topic for thematic learning sessions - - Filter by situation for role-play and scenario practice - - Use formality levels for register awareness training - - Apply cultural_note data for cross-cultural communication exercises - - PARAMETER-BASED FILTERING: - ========================= - - Enable complex queries: "formal greetings for business situations" - - Support multi-parameter filtering: topic + formality + tense - - Provide parameter-based difficulty progression - - Generate themed exercise sets using metadata combinations - - ADAPTIVE LEARNING FEATURES: - ========================== - - Track learner performance by error_type for focused practice - - Adapt sentence selection based on cultural background - - Provide situational appropriateness feedback - - Generate personalized correction exercise sequences - */ - ], - - // ======================================================================================================== - // MATCHING EXERCISES - DUAL SYSTEM ARCHITECTURE - // ======================================================================================================== - // The matching section implements a dual system that supports both traditional two-column matching - // (for backward compatibility) and a flexible multi-column system (for advanced exercises). - // This design ensures existing content continues to work while enabling sophisticated new exercise types. - // - // ARCHITECTURAL BENEFITS: - // ====================== - // 1. BACKWARD COMPATIBILITY: Existing two-column exercises continue to work unchanged - // 2. PROGRESSIVE ENHANCEMENT: Content creators can migrate to multi-column format when needed - // 3. FLEXIBLE COMPLEXITY: Support for 2-N column exercises with single data structure - // 4. UNIVERSAL APPLICABILITY: Same system works for vocabulary, grammar, geography, logic, etc. - // 5. CLEAR TYPE DISTINCTION: Explicit type field prevents processing confusion - // - "matching": [ - - // ================================================================================================ - // TYPE 1: TRADITIONAL TWO-COLUMN MATCHING - // ================================================================================================ - // Classic left-right matching format for simple correspondence exercises - // MAINTAINED FOR: Backward compatibility, simple vocabulary matching, basic concept pairs - - { - "title": "Match Animals to Their Sounds", // REQUIRED: Exercise title for display - "type": "two_column_matching", // REQUIRED: Explicit type declaration - // PROCESSING: AI systems should detect this type and use legacy matching interface - - "leftColumn": ["Cat", "Dog", "Cow", "Bird"], // REQUIRED: Items for left side of matching interface - // ORDER: Can be randomized by game engine for variety - - "rightColumn": ["Woof", "Meow", "Tweet", "Moo"], // REQUIRED: Items for right side of matching interface - // COUNT: Should match leftColumn count for 1:1 matching - - "correctPairs": [ // REQUIRED: Array defining correct matches - { "left": "Cat", "right": "Meow" }, // Each pair object specifies one correct connection - { "left": "Dog", "right": "Woof" }, // VALUES: Must exactly match items from left/right columns - { "left": "Cow", "right": "Moo" }, - { "left": "Bird", "right": "Tweet" } - ] - // GAME MECHANICS: Drag-and-drop, click-to-connect, or tap-based matching - // VALIDATION: Check learner connections against correctPairs array - // FEEDBACK: Immediate validation with visual/audio feedback - }, - - { - "title": "Match Colors in English and French", // Another traditional matching example - "type": "two_column_matching", - "leftColumn": ["Red", "Blue", "Green", "Yellow"], - "rightColumn": ["Bleu", "Vert", "Rouge", "Jaune"], - "correctPairs": [ - { "left": "Red", "right": "Rouge" }, - { "left": "Blue", "right": "Bleu" }, - { "left": "Green", "right": "Vert" }, - { "left": "Yellow", "right": "Jaune" } - ] - }, - - // ================================================================================================ - // TYPE 2: MULTI-COLUMN MATCHING SYSTEM - // ================================================================================================ - // Flexible N-column system for complex relationships and sentence construction - // APPLICATIONS: Grammar construction, complex relationships, logical sequences, categorization - - { - "title": "Build Correct Sentences", // REQUIRED: Descriptive title for complex exercise - "type": "multi_column_matching", // REQUIRED: Identifies this as flexible column system - - "columns": [ // REQUIRED: Array of column definitions (minimum 2, no maximum) - { - "id": 1, // REQUIRED: Numeric identifier for referencing in valid_combinations - // SPECIFICATION: Use simple integers starting from 1 - // UNIQUENESS: Must be unique within this exercise - - "name": "Subject", // OPTIONAL: Display label for column header - // USAGE: Shown in game interface to guide learners - // OMISSION: Can be left out for unlabeled columns - - "items": ["I", "She", "They", "We"] // REQUIRED: Array of items available in this column - // FLEXIBILITY: Any number of items, any content type - }, - { - "id": 2, - "name": "Verb", - "items": ["am", "is", "are", "are"] // Note: "are" appears twice for multiple subjects - }, - { - "id": 3, - "name": "Complement", - "items": ["happy", "a teacher", "students", "friends"] - } - ], - - "valid_combinations": [ // REQUIRED: Array of correct multi-column combinations - // REFERENCE: Uses column IDs as keys, item text as values - {"1": "I", "2": "am", "3": "happy"}, // Valid sentence: "I am happy" - {"1": "I", "2": "am", "3": "a teacher"}, // Valid sentence: "I am a teacher" - {"1": "She", "2": "is", "3": "happy"}, // Valid sentence: "She is happy" - {"1": "She", "2": "is", "3": "a teacher"}, // Valid sentence: "She is a teacher" - {"1": "They", "2": "are", "3": "students"}, // Valid sentence: "They are students" - {"1": "They", "2": "are", "3": "friends"}, // Valid sentence: "They are friends" - {"1": "We", "2": "are", "3": "students"}, // Valid sentence: "We are students" - {"1": "We", "2": "are", "3": "friends"} // Valid sentence: "We are friends" - ] - // GAME MECHANICS: Sequential selection across columns, drag-and-drop assembly, or tap-to-build - // VALIDATION: Check learner's column selections against valid_combinations array - // PARTIAL VALIDATION: Can check partial combinations for immediate feedback - // COMPLEXITY SCALING: More columns = more complex relationships and grammar concepts - }, - - // ================================================================================================ - // MULTI-COLUMN WITHOUT COLUMN NAMES - // ================================================================================================ - // Demonstrates flexibility by omitting optional column names - - { - "title": "Match Country Information", - "type": "multi_column_matching", - "columns": [ - { - "id": 1, - "name": "Country", // Has name for clear identification - "items": ["France", "Spain", "Italy", "Germany"] - }, - { - "id": 2, - "name": "Capital", // Has name for educational clarity - "items": ["Paris", "Madrid", "Rome", "Berlin"] - }, - { - "id": 3, - // NO "name" field - demonstrates optional nature - // INTERFACE: Game can show "Column 3" or use generic label - "items": ["French", "Spanish", "Italian", "German"] - } - ], - "valid_combinations": [ - {"1": "France", "2": "Paris", "3": "French"}, - {"1": "Spain", "2": "Madrid", "3": "Spanish"}, - {"1": "Italy", "2": "Rome", "3": "Italian"}, - {"1": "Germany", "2": "Berlin", "3": "German"} - ] - } - - // ================================================================================================ - // ADVANCED MULTI-COLUMN EXAMPLES - // ================================================================================================ - // Additional examples showing the system's versatility - - // COMPLEX GRAMMAR CONSTRUCTION (5 columns): - // { - // "title": "Build Complex English Sentences", - // "type": "multi_column_matching", - // "columns": [ - // {"id": 1, "name": "Subject", "items": ["I", "She", "They"]}, - // {"id": 2, "name": "Auxiliary", "items": ["don't", "doesn't", "do"]}, - // {"id": 3, "name": "Main Verb", "items": ["eat", "like", "want"]}, - // {"id": 4, "name": "Object", "items": ["fish", "coffee", "chocolate"]}, - // {"id": 5, "name": "Time", "items": ["often", "never", "sometimes"]} - // ], - // "valid_combinations": [ - // {"1": "I", "2": "don't", "3": "eat", "4": "fish", "5": "often"}, - // {"1": "She", "2": "doesn't", "3": "like", "4": "coffee", "5": "never"} - // ] - // } - - // LOGICAL CATEGORIZATION (4 columns): - // { - // "title": "Categorize by Properties", - // "type": "multi_column_matching", - // "columns": [ - // {"id": 1, "name": "Animal", "items": ["Dog", "Fish", "Bird"]}, - // {"id": 2, "name": "Habitat", "items": ["Land", "Water", "Air"]}, - // {"id": 3, "name": "Movement", "items": ["Walks", "Swims", "Flies"]}, - // {"id": 4, "name": "Sound", "items": ["Barks", "Silent", "Chirps"]} - // ], - // "valid_combinations": [ - // {"1": "Dog", "2": "Land", "3": "Walks", "4": "Barks"}, - // {"1": "Fish", "2": "Water", "3": "Swims", "4": "Silent"}, - // {"1": "Bird", "2": "Air", "3": "Flies", "4": "Chirps"} - // ] - // } - - // ================================================================================================ - // AI IMPLEMENTATION GUIDELINES FOR MATCHING - // ================================================================================================ - /* - TYPE DETECTION AND PROCESSING: - ============================== - - Check 'type' field first to determine processing approach - - two_column_matching: Use traditional left-right interface - - multi_column_matching: Use flexible column-based interface - - Validate data structure matches declared type - - TWO-COLUMN PROCESSING: - ===================== - - Present leftColumn and rightColumn in separate interface areas - - Randomize order for variety while maintaining correctPairs validation - - Support drag-and-drop, click-to-connect, or touch-based matching - - Validate against correctPairs array for immediate feedback - - MULTI-COLUMN PROCESSING: - ======================= - - Dynamically generate interface based on columns array length - - Use column 'name' fields for headers when provided - - Fall back to generic labels ("Column 1", "Column 2") when name absent - - Reference valid_combinations using column IDs as keys - - VALIDATION STRATEGIES: - ===================== - - For two-column: Direct lookup in correctPairs array - - For multi-column: Check learner selection against valid_combinations - - Support partial validation for multi-column exercises - - Provide immediate feedback for correct and incorrect combinations - - INTERFACE ADAPTATION: - ==================== - - Scale interface layout based on number of columns - - Adapt to different screen sizes and orientations - - Support keyboard navigation for accessibility - - Provide clear visual feedback for selections and validation - - EXERCISE GENERATION: - =================== - - Use multi-column system for sentence construction exercises - - Apply two-column system for simple vocabulary matching - - Generate exercises of varying complexity based on column count - - Support themed exercises using column categorization - */ - ], - - // ======================================================================================================== - // DIALOGUES - CONVERSATIONAL CONTENT SYSTEM - // ======================================================================================================== - // The dialogues section provides structured conversational content for communication skills development. - // This system supports both text-only conversations and audio-synchronized dialogues with precise timing. - // It serves as the primary location for content that combines audio WITH text (unlike the audio section - // which is for audio-only content). - // - // PEDAGOGICAL APPLICATIONS: - // ======================== - // 1. CONVERSATION PRACTICE: Role-play and dialogue repetition exercises - // 2. PRONUNCIATION TRAINING: Audio-text synchronization for pronunciation practice - // 3. CONTEXTUAL LEARNING: Language use in realistic social situations - // 4. CULTURAL COMMUNICATION: Appropriate language use in different cultural contexts - // 5. LISTENING COMPREHENSION: Following conversations with textual support - // - "dialogues": [ - - // ================================================================================================ - // TEXT-ONLY DIALOGUE EXAMPLE - // ================================================================================================ - // Simple conversational content without audio for reading and role-play practice - - { - "title": "At the Restaurant", // REQUIRED: Descriptive title for the dialogue - // USAGE: Shown in content browsers and exercise interfaces - // CONTEXT: Should indicate setting or situation - - "conversation": [ // REQUIRED: Array of dialogue turns/exchanges - // STRUCTURE: Sequential turns between speakers - // FLEXIBILITY: Any number of turns, any number of speakers - - { - "speaker": "Waiter", // REQUIRED: Speaker identification - // FORMAT: Can be names, roles, or generic labels (A, B, C) - // CONSISTENCY: Use same identifier throughout dialogue - - "original": "Good evening! Welcome to our restaurant.", - // REQUIRED: Speaker's utterance in source language - // NATURALNESS: Should reflect authentic conversational language - - "userLanguage": "Bonsoir! Bienvenue dans notre restaurant." - // REQUIRED: Translation in learner's target language - // CULTURAL ADAPTATION: Should reflect appropriate cultural norms - }, - { - "speaker": "Customer", - "original": "Thank you. Can I see the menu please?", - "userLanguage": "Merci. Puis-je voir le menu s'il vous plaĂźt?" - }, - { - "speaker": "Waiter", - "original": "Of course! Here you are. What would you like to drink?", - "userLanguage": "Bien sĂ»r! Voici. Que voulez-vous boire?" - } - ] - // USAGE APPLICATIONS: - // - Reading comprehension exercises - // - Role-play practice (learners take different speaker roles) - // - Translation practice - // - Cultural appropriateness training - // - Conversation pattern recognition - }, - - // ================================================================================================ - // AUDIO-SYNCHRONIZED DIALOGUE - // ================================================================================================ - // Advanced dialogue with audio track and precise timing for multimedia learning - - { - "title": "Daily Routine Conversation", - "audio": "audio/conversations/daily_routine.mp3", // OPTIONAL: Audio file containing spoken dialogue - // SPECIFICATION: Should contain clear recording of entire conversation - // QUALITY: Professional recording with distinct speakers - // SYNCHRONIZATION: Must match conversation array content exactly - - "conversation": [ - { - "speaker": "A", // Generic speaker labels for role-play flexibility - "original": "What time do you wake up?", - "userLanguage": "À quelle heure te rĂ©veilles-tu?", - "timestamp": 0.5 // OPTIONAL: Time in seconds when this line begins in audio - // PRECISION: Allows for precise audio-text synchronization - // APPLICATIONS: Pronunciation practice, listening comprehension - }, - { - "speaker": "B", - "original": "I usually wake up at 7 AM.", - "userLanguage": "Je me rĂ©veille habituellement Ă  7h.", - "timestamp": 3.2 // Next speaker's line starts at 3.2 seconds - }, - { - "speaker": "A", - "original": "That's early! I wake up at 8:30.", - "userLanguage": "C'est tĂŽt! Je me rĂ©veille Ă  8h30.", - "timestamp": 6.8 - }, - { - "speaker": "B", - "original": "I like to exercise before work.", - "userLanguage": "J'aime faire de l'exercice avant le travail.", - "timestamp": 11.1 - }, - { - "speaker": "A", - "original": "That's a good habit!", - "userLanguage": "C'est une bonne habitude!", - "timestamp": 14.5 - } - ] - // ADVANCED APPLICATIONS: - // - Audio-text synchronization exercises - // - Pronunciation training with native speaker models - // - Listening comprehension with textual support - // - Speed and rhythm training - // - Accent and intonation practice - } - - // ================================================================================================ - // ADDITIONAL DIALOGUE EXAMPLES - // ================================================================================================ - // Examples showing various dialogue types and complexity levels - - // BUSINESS CONVERSATION: - // { - // "title": "Job Interview", - // "audio": "audio/conversations/job_interview.mp3", - // "conversation": [ - // { - // "speaker": "Interviewer", - // "original": "Tell me about your work experience.", - // "userLanguage": "Parlez-moi de votre expĂ©rience professionnelle.", - // "timestamp": 1.0, - // "formality": "formal", // Additional metadata for register training - // "cultural_note": "Direct questioning is normal in American job interviews" - // }, - // { - // "speaker": "Candidate", - // "original": "I have five years of experience in marketing.", - // "userLanguage": "J'ai cinq ans d'expĂ©rience en marketing.", - // "timestamp": 4.5, - // "formality": "formal" - // } - // ] - // } - - // CASUAL CONVERSATION: - // { - // "title": "Friends Meeting", - // "conversation": [ - // { - // "speaker": "Alex", - // "original": "Hey! How's it going?", - // "userLanguage": "Salut! Comment ça va?", - // "formality": "casual", - // "emotion": "friendly" - // }, - // { - // "speaker": "Jordan", - // "original": "Pretty good! Want to grab some coffee?", - // "userLanguage": "PlutĂŽt bien! Tu veux prendre un cafĂ©?", - // "formality": "casual", - // "speech_act": "invitation" - // } - // ] - // } - - // CULTURAL CONTEXT DIALOGUE: - // { - // "title": "British Tea Time", - // "cultural_context": "Traditional British afternoon tea customs", - // "conversation": [ - // { - // "speaker": "Host", - // "original": "Would you care for some tea?", - // "userLanguage": "Prendriez-vous du thĂ©?", - // "cultural_note": "Formal invitation typical in British tea culture" - // }, - // { - // "speaker": "Guest", - // "original": "That would be lovely, thank you.", - // "userLanguage": "Ce serait merveilleux, merci.", - // "cultural_note": "Polite acceptance maintaining formal register" - // } - // ] - // } - - // ================================================================================================ - // AI IMPLEMENTATION GUIDELINES FOR DIALOGUES - // ================================================================================================ - /* - AUDIO SYNCHRONIZATION: - ===================== - - Use timestamp data for precise audio-text alignment - - Support playback controls: play, pause, rewind, segment replay - - Enable click-to-play functionality for individual dialogue lines - - Provide speed adjustment (0.5x to 1.5x) for pronunciation practice - - ROLE-PLAY FUNCTIONALITY: - ======================= - - Allow learners to select and practice different speaker roles - - Provide recording capability for pronunciation practice - - Compare learner pronunciation with original audio when available - - Support turn-taking exercises with audio cues - - COMPREHENSION EXERCISES: - ======================= - - Generate comprehension questions based on dialogue content - - Create fill-in-the-blank exercises using dialogue text - - Develop role-appropriate response generation exercises - - Support dialogue completion and continuation activities - - CULTURAL INTEGRATION: - ==================== - - Use cultural_note data for cross-cultural communication training - - Highlight formality and register variations within dialogues - - Provide cultural context explanations for communication patterns - - Enable comparative dialogue analysis across cultures - - PROGRESSIVE DIFFICULTY: - ====================== - - Start with text-only dialogues for reading comprehension - - Progress to audio-supported dialogues for listening skills - - Advance to role-play and production exercises - - Culminate in free conversation based on dialogue patterns - - ACCESSIBILITY FEATURES: - ====================== - - Provide subtitle toggle for hearing-impaired users - - Support keyboard navigation for audio controls - - Enable adjustable text size for visual accessibility - - Offer translation toggle for comprehension support - */ - ] - - // ======================================================================================================== - // FINAL IMPLEMENTATION NOTES - // ======================================================================================================== - /* - GLOBAL VALIDATION RULES: - ======================== - 1. Required fields must be present and non-empty - 2. Optional fields can be omitted entirely - 3. File paths should be validated for existence before use - 4. Language codes should follow ISO 639-1 standard - 5. Difficulty scales should be consistent (1-10 integers) - 6. Cross-references (like prerequisite IDs) should be validated - - ERROR HANDLING STRATEGIES: - ========================= - 1. Missing required fields: Log error and skip content item - 2. Missing optional fields: Continue processing with graceful degradation - 3. Invalid file paths: Use fallbacks or skip media-dependent features - 4. Malformed data: Log error details for content creator feedback - 5. Unknown fields: Ignore silently to support future extensibility - - PERFORMANCE OPTIMIZATION: - ======================== - 1. Lazy load media files (audio, images) only when needed - 2. Cache processed content data for faster subsequent access - 3. Pre-validate content structure on load for quick error detection - 4. Use efficient data structures for fast content lookup and filtering - 5. Implement progressive loading for large content modules - - LOCALIZATION SUPPORT: - ==================== - 1. All user-facing text should support translation - 2. Cultural content should adapt to learner's cultural context - 3. Date, time, and number formats should follow locale conventions - 4. Audio content should support multiple accent variations when possible - 5. Interface elements should support right-to-left languages when applicable - - EXTENSIBILITY FRAMEWORK: - ======================= - 1. New exercise types can be added without breaking existing content - 2. Additional metadata fields can be added to any content section - 3. New content sections can be added at the root level - 4. Custom field validation can be implemented for specific use cases - 5. Plugin architecture should support third-party content enhancements - - QUALITY ASSURANCE: - ================= - 1. Content should be reviewed by native speakers for linguistic accuracy - 2. Cultural content should be validated by cultural experts - 3. Audio quality should meet professional standards for educational use - 4. Visual content should be tested for accessibility and cultural sensitivity - 5. Exercise difficulty should be validated through learner testing - */ -} \ No newline at end of file diff --git a/migrate-console.js b/migrate-console.js deleted file mode 100644 index cd1cdeb..0000000 --- a/migrate-console.js +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env node -// Script de migration des console.log vers logSh -const fs = require('fs'); -const path = require('path'); - -// Fonction pour parcourir rĂ©cursivement les fichiers -function walkSync(dir, filelist = []) { - const files = fs.readdirSync(dir); - - files.forEach(file => { - const filepath = path.join(dir, file); - const stat = fs.statSync(filepath); - - if (stat.isDirectory()) { - // Skip certains dossiers - if (!['node_modules', '.git', 'export_logger'].includes(file)) { - filelist = walkSync(filepath, filelist); - } - } else if (file.endsWith('.js') && !file.startsWith('migrate-')) { - filelist.push(filepath); - } - }); - - return filelist; -} - -// Fonction pour migrer un fichier -function migrateFile(filepath) { - console.log(`🔄 Migration: ${filepath}`); - - let content = fs.readFileSync(filepath, 'utf8'); - let modified = false; - - // Remplacements avec mapping vers logSh - const replacements = [ - // console.log -> logSh avec niveau INFO - { - pattern: /console\.log\((.*?)\);?/g, - replacement: (match, args) => { - // Si c'est dĂ©jĂ  un template string avec des variables, le garder tel quel - if (args.includes('`') || args.includes('${')) { - return `logSh(${args}, 'INFO');`; - } - // Sinon, traiter normalement - return `logSh(${args}, 'INFO');`; - } - }, - - // console.warn -> logSh avec niveau WARN - { - pattern: /console\.warn\((.*?)\);?/g, - replacement: (match, args) => { - return `logSh(${args}, 'WARN');`; - } - }, - - // console.error -> logSh avec niveau ERROR - { - pattern: /console\.error\((.*?)\);?/g, - replacement: (match, args) => { - return `logSh(${args}, 'ERROR');`; - } - } - ]; - - // Appliquer les remplacements - replacements.forEach(({ pattern, replacement }) => { - const originalContent = content; - content = content.replace(pattern, replacement); - if (content !== originalContent) { - modified = true; - } - }); - - // Sauvegarder si modifiĂ© - if (modified) { - fs.writeFileSync(filepath, content, 'utf8'); - console.log(`✅ MigrĂ©: ${filepath}`); - return true; - } else { - console.log(`⏞ Pas de changement: ${filepath}`); - return false; - } -} - -// Script principal -function main() { - console.log('🚀 DĂ©marrage migration console vers logSh...'); - - const projectRoot = __dirname; - const jsFiles = walkSync(projectRoot); - - console.log(`📁 TrouvĂ© ${jsFiles.length} fichiers JavaScript`); - - let migratedCount = 0; - - jsFiles.forEach(filepath => { - if (migrateFile(filepath)) { - migratedCount++; - } - }); - - console.log(`\n🎉 Migration terminĂ©e!`); - console.log(`📊 ${migratedCount} fichiers modifiĂ©s sur ${jsFiles.length}`); - console.log(`\n🔍 Pour vĂ©rifier, lance:`); - console.log(`grep -r "console\\." --include="*.js" . || echo "✅ Plus de console dans le code!"`); -} - -// Lancer le script -if (require.main === module) { - main(); -} - -module.exports = { migrateFile, walkSync }; \ No newline at end of file diff --git a/quick-debug.js b/quick-debug.js deleted file mode 100644 index b484ac7..0000000 --- a/quick-debug.js +++ /dev/null @@ -1,56 +0,0 @@ -// === TEST RAPIDE À COPIER-COLLER DANS LA CONSOLE === - -// Copie-colle ça dans la console du navigateur pour dĂ©boguer -function quickDebug() { - console.log('🔧 Quick Debug du systĂšme de compatibilitĂ©\n'); - - // 1. VĂ©rifier que les classes existent - console.log('1ïžâƒŁ Classes disponibles:'); - console.log(' ContentGameCompatibility:', !!window.ContentGameCompatibility); - console.log(' ContentScanner:', !!window.ContentScanner); - console.log(' AppNavigation:', !!window.AppNavigation); - - // 2. VĂ©rifier l'initialisation - console.log('\n2ïžâƒŁ Initialisation AppNavigation:'); - if (window.AppNavigation) { - console.log(' compatibilityChecker:', !!window.AppNavigation.compatibilityChecker); - console.log(' contentScanner:', !!window.AppNavigation.contentScanner); - console.log(' scannedContent:', !!window.AppNavigation.scannedContent); - - if (window.AppNavigation.scannedContent) { - console.log(' Contenu trouvĂ©:', window.AppNavigation.scannedContent.found?.length || 0); - } - } - - // 3. VĂ©rifier les modules chargĂ©s - console.log('\n3ïžâƒŁ Modules de contenu:'); - if (window.ContentModules) { - const modules = Object.keys(window.ContentModules); - console.log(' Modules:', modules); - - if (window.ContentModules.ChineseLongStory) { - console.log(' ✅ ChineseLongStory trouvĂ©'); - } else { - console.log(' ❌ ChineseLongStory manquant'); - } - } else { - console.log(' ❌ window.ContentModules manquant'); - } - - // 4. Test de compatibilitĂ© direct - console.log('\n4ïžâƒŁ Test de compatibilitĂ© direct:'); - if (window.AppNavigation?.compatibilityChecker && window.ContentModules?.ChineseLongStory) { - const checker = window.AppNavigation.compatibilityChecker; - const content = window.ContentModules.ChineseLongStory; - - const result = checker.checkCompatibility(content, 'whack-a-mole'); - console.log(' Test whack-a-mole:', result.compatible, `(${result.score}%)`); - } else { - console.log(' ❌ Impossible - composants manquants'); - } - - console.log('\n✅ Debug terminĂ©'); -} - -// Auto-exĂ©cution -quickDebug(); \ No newline at end of file diff --git a/sbs-level-7-8-GENERATED-from-js.json b/sbs-level-7-8-GENERATED-from-js.json deleted file mode 100644 index 8934274..0000000 --- a/sbs-level-7-8-GENERATED-from-js.json +++ /dev/null @@ -1,206 +0,0 @@ -{ - "id": "sbs_level_7_8_converted_from_js", - "name": "SBS Level 7-8 (Converted from JavaScript)", - "description": "English learning content covering housing and clothing vocabulary - automatically converted from legacy JavaScript format to ultra-modular JSON specification", - "difficulty_level": 7, - "original_lang": "english", - "user_lang": "chinese", - "icon": "🏠", - "tags": [ - "vocabulary", - "intermediate", - "places", - "housing", - "clothing" - ], - "vocabulary": { - "central": { - "user_language": "äž­ćżƒçš„ïŒ›äž­ć€źçš„", - "original_language": "central" - }, - "avenue": { - "user_language": "ć€§èĄ—ïŒ›æž—è«é“", - "original_language": "avenue" - }, - "refrigerator": { - "user_language": "憰矱", - "original_language": "refrigerator" - }, - "closet": { - "user_language": "èĄŁæŸœïŒ›ćŁæ©±", - "original_language": "closet" - }, - "elevator": { - "user_language": "ç””æąŻ", - "original_language": "elevator" - }, - "building": { - "user_language": "ć»șç­‘ç‰©ïŒ›ć€§æ„Œ", - "original_language": "building" - }, - "air conditioner": { - "user_language": "ç©ș调", - "original_language": "air conditioner" - }, - "superintendent": { - "user_language": "äž»çźĄïŒ›èŽŸèŽŁäșș", - "original_language": "superintendent" - }, - "bus stop": { - "user_language": "慬äș€èœŠç«™", - "original_language": "bus stop" - }, - "jacuzzi": { - "user_language": "按摩攎猞", - "original_language": "jacuzzi" - }, - "shirt": { - "user_language": "èĄŹèĄ«", - "original_language": "shirt" - }, - "coat": { - "user_language": "ć€–ć„—ă€ć€§èĄŁ", - "original_language": "coat" - }, - "dress": { - "user_language": "èżžèĄŁèŁ™", - "original_language": "dress" - }, - "skirt": { - "user_language": "çŸ­èŁ™", - "original_language": "skirt" - }, - "blouse": { - "user_language": "ć„łćŒèĄŹèĄ«", - "original_language": "blouse" - }, - "jacket": { - "user_language": "ć€čć…‹ă€çŸ­ć€–ć„—", - "original_language": "jacket" - }, - "sweater": { - "user_language": "æŻ›èĄŁă€é’ˆç»‡èĄ«", - "original_language": "sweater" - }, - "suit": { - "user_language": "ć„—èŁ…ă€è„żèŁ…", - "original_language": "suit" - }, - "tie": { - "user_language": "鱆澩", - "original_language": "tie" - }, - "pants": { - "user_language": "èŁ€ć­", - "original_language": "pants" - }, - "jeans": { - "user_language": "ç‰›ä»”èŁ€", - "original_language": "jeans" - }, - "belt": { - "user_language": "è…°ćžŠă€çšźćžŠ", - "original_language": "belt" - }, - "hat": { - "user_language": "ćžœć­", - "original_language": "hat" - }, - "glove": { - "user_language": "æ‰‹ć„—", - "original_language": "glove" - }, - "glasses": { - "user_language": "県镜", - "original_language": "glasses" - }, - "pajamas": { - "user_language": "çĄèĄŁ", - "original_language": "pajamas" - }, - "shoes": { - "user_language": "鞋歐", - "original_language": "shoes" - } - }, - "sentences": [ - { - "id": "sentence_1", - "original_language": "Amy's apartment building is in the center of town.", - "user_language": "è‰Ÿç±łçš„ć…ŹćŻ“æ„ŒćœšćŸŽé•‡äž­ćżƒă€‚" - }, - { - "id": "sentence_2", - "original_language": "There's a lot of noise near Amy's apartment building.", - "user_language": "è‰Ÿç±łçš„ć…ŹćŻ“æ„Œé™„èż‘ćŸˆć”ă€‚" - }, - { - "id": "sentence_3", - "original_language": "The superintendent is very helpful.", - "user_language": "缡理摘非澾äčäșŽćŠ©äșș。" - }, - { - "id": "sentence_4", - "original_language": "I need to buy new clothes for winter.", - "user_language": "我需芁äžș憏怩äč°æ–°èĄŁæœă€‚" - } - ], - "conversion_metadata": { - "converted_from": "legacy_javascript_module", - "conversion_timestamp": "2025-09-16T11:50:26.158Z", - "conversion_system": "ultra_modular_converter_v1.0", - "original_format": "js_content_module", - "target_format": "ultra_modular_json_v2.0", - "original_stats": { - "vocabulary_count": 27, - "sentence_count": 4, - "has_complex_phrases": true - }, - "detected_capabilities": { - "hasVocabulary": true, - "hasSentences": true, - "hasGrammar": false, - "hasAudio": false, - "hasDialogues": false, - "hasExercises": false, - "hasMatching": false, - "hasCulture": false, - "vocabularyDepth": 1, - "contentRichness": 2.7, - "vocabularyCount": 27, - "sentenceCount": 4, - "complexPhrases": 2 - }, - "game_compatibility": { - "whack-a-mole": { - "compatible": true, - "score": 54, - "reason": "NĂ©cessite vocabulaire" - }, - "memory-match": { - "compatible": true, - "score": 40.5, - "reason": "Optimal pour vocabulaire visuel" - }, - "quiz-game": { - "compatible": true, - "score": 42, - "reason": "Fonctionne avec tout contenu" - }, - "text-reader": { - "compatible": true, - "score": 40, - "reason": "NĂ©cessite phrases Ă  lire" - } - }, - "quality_score": 91 - }, - "system_validation": { - "format_version": "2.0", - "specification": "ultra_modular", - "backwards_compatible": true, - "memory_stored": true, - "conversion_verified": true, - "ready_for_games": true - } -} \ No newline at end of file diff --git a/start-websocket-logger.bat b/start-websocket-logger.bat deleted file mode 100644 index ac59987..0000000 --- a/start-websocket-logger.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -echo ======================================== -echo WebSocket Logger Server -echo ======================================== -echo. - -cd /d "%~dp0\export_logger" - -echo Demarrage du serveur WebSocket sur le port 8082... -node websocket-server.js - -pause \ No newline at end of file diff --git a/start-websocket-logger.sh b/start-websocket-logger.sh deleted file mode 100644 index 8865120..0000000 --- a/start-websocket-logger.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -echo "========================================" -echo " WebSocket Logger Server" -echo "========================================" -echo "" - -# Se dĂ©placer dans le dossier export_logger -cd "$(dirname "$0")/export_logger" - -echo "DĂ©marrage du serveur WebSocket sur le port 8082..." -node websocket-server.js \ No newline at end of file diff --git a/test-aws-signature.js b/test-aws-signature.js deleted file mode 100644 index 987f72f..0000000 --- a/test-aws-signature.js +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env node - -// Test de signature AWS pour DigitalOcean Spaces -const crypto = require('crypto'); - -// Configuration avec ta clĂ© read-only -const config = { - DO_ACCESS_KEY: 'DO801XTYPE968NZGAQM3', - DO_SECRET_KEY: 'rfKPjampdpUCYhn02XrKg6IWKmqebjg9HQTGxNLzJQY', - DO_REGION: 'fra1', - DO_ENDPOINT: 'https://autocollant.fra1.digitaloceanspaces.com', - DO_CONTENT_PATH: 'Class_generator/ContentMe' -}; - -// Fonction de hash SHA256 -function sha256(message) { - return crypto.createHash('sha256').update(message, 'utf8').digest('hex'); -} - -// Fonction HMAC SHA256 -function hmacSha256(key, message) { - return crypto.createHmac('sha256', key).update(message, 'utf8').digest(); -} - -// GĂ©nĂ©ration de la signature AWS V4 -async function generateAWSSignature(method, url) { - const accessKey = config.DO_ACCESS_KEY; - const secretKey = config.DO_SECRET_KEY; - const region = config.DO_REGION; - const service = 's3'; - - const now = new Date(); - const dateStamp = now.toISOString().slice(0, 10).replace(/-/g, ''); - const timeStamp = now.toISOString().slice(0, 19).replace(/[-:]/g, '') + 'Z'; - - console.log(`🕐 Timestamp: ${timeStamp}`); - console.log(`📅 Date: ${dateStamp}`); - - // Parse URL - const urlObj = new URL(url); - const host = urlObj.hostname; - const canonicalUri = urlObj.pathname || '/'; - const canonicalQueryString = urlObj.search ? urlObj.search.slice(1) : ''; - - console.log(`🌐 Host: ${host}`); - console.log(`📍 URI: ${canonicalUri}`); - console.log(`❓ Query: ${canonicalQueryString}`); - - // Canonical headers - const canonicalHeaders = `host:${host}\nx-amz-date:${timeStamp}\n`; - const signedHeaders = 'host;x-amz-date'; - - console.log(`📝 Canonical headers:\n${canonicalHeaders}`); - - // Create canonical request - const payloadHash = method === 'GET' ? sha256('') : 'UNSIGNED-PAYLOAD'; - const canonicalRequest = [ - method, - canonicalUri, - canonicalQueryString, - canonicalHeaders, - signedHeaders, - payloadHash - ].join('\n'); - - console.log(`📋 Canonical request:\n${canonicalRequest}`); - console.log(`🔱 Payload hash: ${payloadHash}`); - - // Create string to sign - const algorithm = 'AWS4-HMAC-SHA256'; - const credentialScope = `${dateStamp}/${region}/${service}/aws4_request`; - const canonicalRequestHash = sha256(canonicalRequest); - const stringToSign = [ - algorithm, - timeStamp, - credentialScope, - canonicalRequestHash - ].join('\n'); - - console.log(`🔐 String to sign:\n${stringToSign}`); - console.log(`🔗 Canonical request hash: ${canonicalRequestHash}`); - - // Calculate signature - const kDate = hmacSha256('AWS4' + secretKey, dateStamp); - const kRegion = hmacSha256(kDate, region); - const kService = hmacSha256(kRegion, service); - const kSigning = hmacSha256(kService, 'aws4_request'); - const signature = hmacSha256(kSigning, stringToSign).toString('hex'); - - console.log(`✍ Signature: ${signature}`); - - // Create authorization header - const authorization = `${algorithm} Credential=${accessKey}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signature}`; - - console.log(`🔑 Authorization: ${authorization}`); - - return { - 'Authorization': authorization, - 'X-Amz-Date': timeStamp, - 'X-Amz-Content-Sha256': payloadHash - }; -} - -// Test avec fetch -async function testDigitalOceanAccess() { - console.log('🚀 Test d\'accĂšs DigitalOcean Spaces avec signature AWS\n'); - - const testUrl = `${config.DO_ENDPOINT}/${config.DO_CONTENT_PATH}/greetings-basic.json`; - console.log(`🎯 URL de test: ${testUrl}\n`); - - try { - const headers = await generateAWSSignature('GET', testUrl); - - console.log('\n📩 Headers finaux:'); - console.log(JSON.stringify(headers, null, 2)); - - // Test avec node-fetch si disponible - try { - const fetch = require('node-fetch'); - console.log('\n🌐 Test avec node-fetch...'); - - const response = await fetch(testUrl, { - method: 'GET', - headers: headers - }); - - console.log(`📡 Status: ${response.status} ${response.statusText}`); - - if (response.ok) { - const content = await response.text(); - console.log(`✅ SuccĂšs ! Contenu (${content.length} chars): ${content.substring(0, 200)}...`); - } else { - const errorText = await response.text(); - console.log(`❌ Erreur: ${errorText}`); - } - } catch (fetchError) { - console.log('⚠ node-fetch non disponible, test signature seulement'); - console.log('✅ Signature gĂ©nĂ©rĂ©e avec succĂšs !'); - } - - } catch (error) { - console.error(`❌ Erreur: ${error.message}`); - } -} - -// Lancer le test -testDigitalOceanAccess(); \ No newline at end of file diff --git a/test-chinese-content.json b/test-chinese-content.json deleted file mode 100644 index a76397a..0000000 --- a/test-chinese-content.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "Test Chinese Vocabulary", - "description": "Basic Chinese characters for testing", - "difficulty": "beginner", - "language": "chinese", - "vocabulary": { - "äœ ć„œ": { - "user_language": "bonjour", - "type": "greeting", - "pronunciation": "nǐ hǎo", - "hskLevel": "HSK1", - "examples": ["äœ ć„œïŒŒæŹąèżŽïŒ", "äœ ć„œć—ïŒŸ"] - }, - "è°ąè°ą": { - "user_language": "merci", - "type": "greeting", - "pronunciation": "xiĂš xiĂš", - "hskLevel": "HSK1" - }, - "猫": { - "user_language": "chat", - "type": "noun", - "pronunciation": "māo", - "hskLevel": "HSK1", - "examples": ["我有䞀ćȘ猫"] - }, - "狗": { - "user_language": "chien", - "type": "noun", - "pronunciation": "gǒu", - "hskLevel": "HSK1" - }, - "æ°Ž": { - "user_language": "eau", - "type": "noun", - "pronunciation": "shuǐ", - "hskLevel": "HSK1" - }, - "ć­Šäč ": { - "user_language": "Ă©tudier", - "type": "verb", - "pronunciation": "xuĂ© xĂ­", - "hskLevel": "HSK2" - }, - "è€ćžˆ": { - "user_language": "professeur", - "type": "noun", - "pronunciation": "lǎo shÄ«", - "hskLevel": "HSK2" - }, - "歩生": { - "user_language": "Ă©tudiant", - "type": "noun", - "pronunciation": "xuĂ© shēng", - "hskLevel": "HSK2" - } - } -} \ No newline at end of file diff --git a/test-compatibility-system.html b/test-compatibility-system.html deleted file mode 100644 index 56bab77..0000000 --- a/test-compatibility-system.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - Test SystĂšme de CompatibilitĂ© - - - -

🎯 Test du SystĂšme de CompatibilitĂ© Content-Game

- -
-

Chargement des modules

- -
-
- -
-

Tests de compatibilité

- -
-
- -
-

Log des opérations

- -
-
- - - - - - - - - - \ No newline at end of file diff --git a/test-connection.html b/test-connection.html deleted file mode 100644 index 60a98fe..0000000 --- a/test-connection.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - Test WebSocket Connection - - -

Test WebSocket Connection

-
Connecting...
-
- - - - \ No newline at end of file diff --git a/test-content-loading.html b/test-content-loading.html deleted file mode 100644 index 4f0cadf..0000000 --- a/test-content-loading.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Test Content Loading - - -

Content Loading Test

-
- - - - - - - - - - \ No newline at end of file diff --git a/test-conversion-english-exemple.js b/test-conversion-english-exemple.js deleted file mode 100644 index 10d0eb5..0000000 --- a/test-conversion-english-exemple.js +++ /dev/null @@ -1,321 +0,0 @@ -#!/usr/bin/env node - -// Test de conversion: english-exemple-commented.js → JSON Ultra-Modulaire -console.log('🚀 Conversion english-exemple-commented.js → JSON Ultra-Modulaire'); -console.log('================================================================'); - -// Simuler l'environnement browser -global.window = { - ContentModules: {} -}; - -// Charger le module JS -require('./js/content/english-exemple-commented.js'); - -// RĂ©cupĂ©rer le module depuis l'objet global -const englishModule = global.window?.ContentModules?.EnglishExempleCommented; - -if (!englishModule) { - console.error('❌ Erreur: Module EnglishExempleCommented non trouvĂ©'); - process.exit(1); -} - -console.log('✅ Module JS chargĂ©:'); -console.log(` - ${Object.keys(englishModule.vocabulary).length} mots de vocabulaire`); -console.log(` - ${englishModule.sentences?.length || 0} phrases`); -console.log(` - ${englishModule.texts?.length || 0} textes`); -console.log(` - ${englishModule.dialogues?.length || 0} dialogues`); -console.log(''); - -// Fonction de conversion COMPLÈTE (toutes les donnĂ©es JS) -function convertToUltraModular(jsModule) { - const ultraModular = { - // ======================================== - // CORE METADATA - Conversion honnĂȘte - // ======================================== - id: "english_exemple_commented_from_js", - name: jsModule.name || "English Example Commented", - description: jsModule.description || "Converted from JavaScript module", - - // DifficultĂ©: on peut l'infĂ©rer du champ difficulty s'il existe - difficulty_level: jsModule.difficulty === 'intermediate' ? 5 : - jsModule.difficulty === 'easy' ? 3 : - jsModule.difficulty === 'hard' ? 7 : 4, - - // Langues dĂ©tectĂ©es - original_lang: jsModule.language || "english", - user_lang: "french", // DĂ©tectĂ© depuis les traductions - - // Icon simple - icon: "📚", - - // Tags basĂ©s sur le contenu rĂ©el - tags: [], - - // Skills covered si disponible - skills_covered: jsModule.skills_covered || [], - - // ======================================== - // VOCABULARY - Conversion fidĂšle avec tous les niveaux - // ======================================== - vocabulary: {}, - - // ======================================== - // GRAMMAR - SystĂšme de grammaire complet - // ======================================== - grammar: {}, - - // ======================================== - // SENTENCES - Conversion fidĂšle - // ======================================== - sentences: [], - - // ======================================== - // TEXTS - Conversion fidĂšle - // ======================================== - texts: [], - - // ======================================== - // DIALOGUES - Conversion fidĂšle - // ======================================== - dialogues: [], - - // ======================================== - // AUDIO - Contenu audio - // ======================================== - audio: [], - - // ======================================== - // CORRECTIONS - Exercices de correction - // ======================================== - corrections: [], - - // ======================================== - // FILL-IN-BLANKS - Exercices fill-in-blanks - // ======================================== - fillInBlanks: [], - - // ======================================== - // CULTURAL - Contenu culturel - // ======================================== - cultural: {}, - - // ======================================== - // MATCHING - Exercices de matching - // ======================================== - matching: [], - - // ======================================== - // METADATA - Pour tracer la conversion - // ======================================== - conversion_metadata: { - converted_from: "javascript_module", - conversion_timestamp: new Date().toISOString(), - source_file: "english-exemple-commented.js", - conversion_system: "honest_converter_v3.0_complete", - conversion_notes: "Conversion complĂšte de toutes les donnĂ©es JS" - } - }; - - // ======================================== - // VOCABULARY - Conversion complĂšte avec tous les niveaux - // ======================================== - if (jsModule.vocabulary) { - for (const [word, translation] of Object.entries(jsModule.vocabulary)) { - if (typeof translation === 'string') { - // Format simple: garder tel quel - ultraModular.vocabulary[word] = { - user_language: translation, - original_language: word - }; - } else if (typeof translation === 'object') { - // Objet complet: prĂ©server toutes les propriĂ©tĂ©s - ultraModular.vocabulary[word] = { - user_language: translation.translation || translation.french || translation, - original_language: word - }; - - // Ajouter toutes les propriĂ©tĂ©s qui existent - if (translation.type) ultraModular.vocabulary[word].type = translation.type; - if (translation.pronunciation) ultraModular.vocabulary[word].pronunciation = translation.pronunciation; - if (translation.audio) ultraModular.vocabulary[word].audio = translation.audio; - if (translation.image) ultraModular.vocabulary[word].image = translation.image; - if (translation.examples) ultraModular.vocabulary[word].examples = translation.examples; - if (translation.grammarNotes) ultraModular.vocabulary[word].grammarNotes = translation.grammarNotes; - if (translation.conjugation) ultraModular.vocabulary[word].conjugation = translation.conjugation; - if (translation.difficulty_context) ultraModular.vocabulary[word].difficulty_context = translation.difficulty_context; - if (translation.cultural_note) ultraModular.vocabulary[word].cultural_note = translation.cultural_note; - } - } - } - - // ======================================== - // GRAMMAR - Conversion complĂšte - // ======================================== - if (jsModule.grammar) { - ultraModular.grammar = jsModule.grammar; - } - - // ======================================== - // SENTENCES - Conversion fidĂšle - // ======================================== - if (jsModule.sentences && Array.isArray(jsModule.sentences)) { - ultraModular.sentences = jsModule.sentences.map((sentence, idx) => ({ - id: `sentence_${idx + 1}`, - original_language: sentence.english || sentence.original, - user_language: sentence.french || sentence.translation - })); - } - - // ======================================== - // TEXTS - Conversion complĂšte avec exercices - // ======================================== - if (jsModule.texts && Array.isArray(jsModule.texts)) { - ultraModular.texts = jsModule.texts.map((text, idx) => { - const convertedText = { - id: `text_${idx + 1}`, - title: text.title, - original_language: text.content || text.english, - user_language: text.translation || text.french - }; - - // Ajouter les exercices s'ils existent - if (text.questions) convertedText.questions = text.questions; - if (text.fillInBlanks) convertedText.fillInBlanks = text.fillInBlanks; - - return convertedText; - }); - } - - // ======================================== - // DIALOGUES - Conversion fidĂšle - // ======================================== - if (jsModule.dialogues && Array.isArray(jsModule.dialogues)) { - ultraModular.dialogues = jsModule.dialogues.map((dialogue, idx) => ({ - id: `dialogue_${idx + 1}`, - title: dialogue.title, - conversation: dialogue.conversation.map((line, lineIdx) => ({ - id: `line_${lineIdx + 1}`, - speaker: line.speaker, - original_language: line.english, - user_language: line.french - })) - })); - } - - // ======================================== - // AUDIO - Conversion complĂšte - // ======================================== - if (jsModule.audio && Array.isArray(jsModule.audio)) { - ultraModular.audio = jsModule.audio; - } - - // ======================================== - // CORRECTIONS - Exercices de correction - // ======================================== - if (jsModule.corrections && Array.isArray(jsModule.corrections)) { - ultraModular.corrections = jsModule.corrections; - } - - // ======================================== - // FILL-IN-BLANKS - Exercices fill-in-blanks - // ======================================== - if (jsModule.fillInBlanks && Array.isArray(jsModule.fillInBlanks)) { - ultraModular.fillInBlanks = jsModule.fillInBlanks; - } - - // ======================================== - // CULTURAL - Contenu culturel complet - // ======================================== - if (jsModule.cultural) { - ultraModular.cultural = jsModule.cultural; - } - - // ======================================== - // MATCHING - Exercices de matching - // ======================================== - if (jsModule.matching && Array.isArray(jsModule.matching)) { - ultraModular.matching = jsModule.matching; - } - - // ======================================== - // TAGS basĂ©s sur le contenu RÉEL - // ======================================== - if (Object.keys(ultraModular.vocabulary).length > 0) ultraModular.tags.push("vocabulary"); - if (ultraModular.sentences.length > 0) ultraModular.tags.push("sentences"); - if (ultraModular.texts.length > 0) ultraModular.tags.push("texts"); - if (ultraModular.dialogues.length > 0) ultraModular.tags.push("dialogues"); - if (ultraModular.grammar && Object.keys(ultraModular.grammar).length > 0) ultraModular.tags.push("grammar"); - if (ultraModular.audio && ultraModular.audio.length > 0) ultraModular.tags.push("audio"); - if (ultraModular.corrections && ultraModular.corrections.length > 0) ultraModular.tags.push("corrections"); - if (ultraModular.fillInBlanks && ultraModular.fillInBlanks.length > 0) ultraModular.tags.push("fillInBlanks"); - if (ultraModular.cultural && Object.keys(ultraModular.cultural).length > 0) ultraModular.tags.push("cultural"); - if (ultraModular.matching && ultraModular.matching.length > 0) ultraModular.tags.push("matching"); - ultraModular.tags.push("converted_from_js"); - - // ======================================== - // STATS COMPLÈTES de conversion - // ======================================== - ultraModular.conversion_metadata.stats = { - vocabulary_count: Object.keys(ultraModular.vocabulary).length, - sentence_count: ultraModular.sentences.length, - text_count: ultraModular.texts.length, - dialogue_count: ultraModular.dialogues.length, - grammar_count: ultraModular.grammar ? Object.keys(ultraModular.grammar).length : 0, - audio_count: ultraModular.audio ? ultraModular.audio.length : 0, - corrections_count: ultraModular.corrections ? ultraModular.corrections.length : 0, - fillInBlanks_count: ultraModular.fillInBlanks ? ultraModular.fillInBlanks.length : 0, - cultural_sections_count: ultraModular.cultural ? Object.keys(ultraModular.cultural).length : 0, - matching_count: ultraModular.matching ? ultraModular.matching.length : 0, - skills_covered_count: ultraModular.skills_covered ? ultraModular.skills_covered.length : 0 - }; - - return ultraModular; -} - -// Effectuer la conversion -console.log('🔄 Conversion en cours...'); -const ultraModularJSON = convertToUltraModular(englishModule); - -console.log('✅ Conversion COMPLÈTE terminĂ©e!'); -console.log(` - ${Object.keys(ultraModularJSON.vocabulary).length} mots convertis`); -console.log(` - ${ultraModularJSON.sentences.length} phrases converties`); -console.log(` - ${ultraModularJSON.texts.length} textes convertis`); -console.log(` - ${ultraModularJSON.dialogues.length} dialogues convertis`); -console.log(` - ${ultraModularJSON.conversion_metadata.stats.grammar_count} leçons de grammaire`); -console.log(` - ${ultraModularJSON.conversion_metadata.stats.audio_count} contenus audio`); -console.log(` - ${ultraModularJSON.conversion_metadata.stats.corrections_count} exercices de correction`); -console.log(` - ${ultraModularJSON.conversion_metadata.stats.fillInBlanks_count} exercices fill-in-blanks`); -console.log(` - ${ultraModularJSON.conversion_metadata.stats.cultural_sections_count} sections culturelles`); -console.log(` - ${ultraModularJSON.conversion_metadata.stats.matching_count} exercices de matching`); -console.log(` - ${ultraModularJSON.conversion_metadata.stats.skills_covered_count} compĂ©tences couvertes`); -console.log(''); - -// Sauvegarder le fichier JSON -const fs = require('fs'); -const outputFile = 'english-exemple-commented-GENERATED.json'; -const jsonContent = JSON.stringify(ultraModularJSON, null, 2); - -try { - fs.writeFileSync(outputFile, jsonContent, 'utf8'); - console.log(`📁 Fichier JSON gĂ©nĂ©rĂ©: ${outputFile}`); - console.log(`📏 Taille: ${(jsonContent.length / 1024).toFixed(1)} KB`); - console.log(`📄 Lignes: ${jsonContent.split('\n').length}`); - console.log(''); - - // Validation finale - const reloaded = JSON.parse(jsonContent); - console.log('✅ VALIDATION:'); - console.log(` - JSON valide: ✅`); - console.log(` - ID: ${reloaded.id}`); - console.log(` - Nom: ${reloaded.name}`); - console.log(` - Tags: ${reloaded.tags.join(', ')}`); - console.log(` - Conversion honnĂȘte: ✅ (pas de donnĂ©es inventĂ©es)`); - -} catch (error) { - console.error('❌ Erreur:', error.message); - process.exit(1); -} - -console.log('================================================================'); -console.log('🎉 Conversion JS → JSON Ultra-Modulaire RÉUSSIE (honnĂȘte)!'); \ No newline at end of file diff --git a/test-conversion.js b/test-conversion.js deleted file mode 100644 index b9cfe06..0000000 --- a/test-conversion.js +++ /dev/null @@ -1,368 +0,0 @@ -#!/usr/bin/env node - -// Test de conversion JS → JSON Ultra-Modulaire -// Prouve que notre systĂšme fonctionne en mĂ©moire - -console.log('🚀 DĂ©marrage du test de conversion JS → JSON Ultra-Modulaire'); -console.log('========================================================'); - -// Simuler l'environnement browser avec les logs -global.logSh = function(message, level = 'INFO') { - console.log(`[${level}] ${message}`); -}; - -// Simuler window.ContentModules -global.window = { - ContentModules: {} -}; - -// Charger le contenu JavaScript (simulation du module SBS) -const sbsContent = { - name: "SBS Level 7-8", - difficulty: "intermediate", - vocabulary: { - // Housing and Places - central: "äž­ćżƒçš„ïŒ›äž­ć€źçš„", - avenue: "ć€§èĄ—ïŒ›æž—è«é“", - refrigerator: "憰矱", - closet: "èĄŁæŸœïŒ›ćŁæ©±", - elevator: "ç””æąŻ", - building: "ć»șç­‘ç‰©ïŒ›ć€§æ„Œ", - "air conditioner": "ç©ș调", - superintendent: "äž»çźĄïŒ›èŽŸèŽŁäșș", - "bus stop": "慬äș€èœŠç«™", - jacuzzi: "按摩攎猞", - - // Clothing and Accessories - shirt: "èĄŹèĄ«", - coat: "ć€–ć„—ă€ć€§èĄŁ", - dress: "èżžèĄŁèŁ™", - skirt: "çŸ­èŁ™", - blouse: "ć„łćŒèĄŹèĄ«", - jacket: "ć€čć…‹ă€çŸ­ć€–ć„—", - sweater: "æŻ›èĄŁă€é’ˆç»‡èĄ«", - suit: "ć„—èŁ…ă€è„żèŁ…", - tie: "鱆澩", - pants: "èŁ€ć­", - jeans: "ç‰›ä»”èŁ€", - belt: "è…°ćžŠă€çšźćžŠ", - hat: "ćžœć­", - glove: "æ‰‹ć„—", - glasses: "県镜", - pajamas: "çĄèĄŁ", - shoes: "鞋歐" - }, - - sentences: [ - { - english: "Amy's apartment building is in the center of town.", - chinese: "è‰Ÿç±łçš„ć…ŹćŻ“æ„ŒćœšćŸŽé•‡äž­ćżƒă€‚" - }, - { - english: "There's a lot of noise near Amy's apartment building.", - chinese: "è‰Ÿç±łçš„ć…ŹćŻ“æ„Œé™„èż‘ćŸˆć”ă€‚" - }, - { - english: "The superintendent is very helpful.", - chinese: "缡理摘非澾äčäșŽćŠ©äșș。" - }, - { - english: "I need to buy new clothes for winter.", - chinese: "我需芁äžș憏怩äč°æ–°èĄŁæœă€‚" - } - ] -}; - -// Ajouter aux modules globaux -global.window.ContentModules.SBSLevel78New = sbsContent; - -console.log('✅ Module JavaScript chargĂ© en mĂ©moire:'); -console.log(` - ${Object.keys(sbsContent.vocabulary).length} mots de vocabulaire`); -console.log(` - ${sbsContent.sentences.length} phrases d'exemple`); -console.log(''); - -// ======================================== -// ANALYSEUR DE CAPACITÉS SIMPLIFIÉ -// ======================================== - -class SimpleContentAnalyzer { - analyzeCapabilities(module) { - const vocab = module.vocabulary || {}; - const sentences = module.sentences || []; - - return { - hasVocabulary: Object.keys(vocab).length > 0, - hasSentences: sentences.length > 0, - hasGrammar: false, - hasAudio: false, - hasDialogues: false, - hasExercises: false, - hasMatching: false, - hasCulture: false, - - vocabularyDepth: this.analyzeVocabularyDepth(vocab), - contentRichness: Object.keys(vocab).length / 10, - - // Stats - vocabularyCount: Object.keys(vocab).length, - sentenceCount: sentences.length, - complexPhrases: Object.keys(vocab).filter(word => word.includes(' ')).length - }; - } - - analyzeVocabularyDepth(vocabulary) { - let maxDepth = 1; // Simple strings - - for (const [word, translation] of Object.entries(vocabulary)) { - if (typeof translation === 'string') { - maxDepth = Math.max(maxDepth, 1); - } else if (typeof translation === 'object') { - maxDepth = Math.max(maxDepth, 2); - // Pourrait analyser plus profondĂ©ment ici - } - } - - return maxDepth; - } - - calculateGameCompatibility(capabilities) { - return { - 'whack-a-mole': { - compatible: capabilities.hasVocabulary, - score: capabilities.vocabularyCount * 2, - reason: 'NĂ©cessite vocabulaire' - }, - 'memory-match': { - compatible: capabilities.hasVocabulary, - score: capabilities.vocabularyCount * 1.5, - reason: 'Optimal pour vocabulaire visuel' - }, - 'quiz-game': { - compatible: capabilities.hasVocabulary || capabilities.hasSentences, - score: (capabilities.vocabularyCount + capabilities.sentenceCount * 2) * 1.2, - reason: 'Fonctionne avec tout contenu' - }, - 'text-reader': { - compatible: capabilities.hasSentences, - score: capabilities.sentenceCount * 10, - reason: 'NĂ©cessite phrases Ă  lire' - } - }; - } -} - -// ======================================== -// CONVERTISSEUR VERS ULTRA-MODULAIRE -// ======================================== - -class JSToUltraModularConverter { - convert(jsModule) { - const analyzer = new SimpleContentAnalyzer(); - const capabilities = analyzer.analyzeCapabilities(jsModule); - const compatibility = analyzer.calculateGameCompatibility(capabilities); - - console.log('🔍 Analyse des capacitĂ©s:'); - console.log(` - Vocabulaire: ${capabilities.vocabularyCount} mots`); - console.log(` - Phrases: ${capabilities.sentenceCount}`); - console.log(` - Profondeur vocab: ${capabilities.vocabularyDepth}/6`); - console.log(` - Richesse: ${capabilities.contentRichness.toFixed(1)}/10`); - console.log(''); - - const ultraModularSpec = { - // ======================================================================================================== - // CORE METADATA SECTION - GENERATED FROM JS MODULE - // ======================================================================================================== - id: "sbs_level_7_8_converted_from_js", - name: "SBS Level 7-8 (Converted from JavaScript)", - description: "English learning content covering housing and clothing vocabulary - automatically converted from legacy JavaScript format to ultra-modular JSON specification", - - // CORRECTION: InfĂ©rence raisonnable basĂ©e sur les donnĂ©es existantes - // Difficulty: on peut l'infĂ©rer du nom "Level 7-8" - difficulty_level: 7, // BasĂ© sur "SBS Level 7-8" - - // Langues: on peut les dĂ©tecter des donnĂ©es (english → chinese) - original_lang: "english", // DĂ©tectĂ© des clĂ©s du vocabulaire - user_lang: "chinese", // DĂ©tectĂ© des valeurs du vocabulaire - - // Icon: on peut faire une infĂ©rence basĂ©e sur le contenu dĂ©tectĂ© - icon: "🏠", // BasĂ© sur la prĂ©dominance du vocabulaire housing - - // CORRECTION: On peut extraire les tags du contenu existant (ça c'est de l'analyse, pas de l'invention) - tags: this.extractTags(jsModule.vocabulary), - - // SUPPRIMÉ: skills_covered, target_audience, estimated_duration - // On n'a PAS ces infos dans le JS original, donc on n'invente pas ! - - // ======================================================================================================== - // VOCABULARY SECTION - ENHANCED FROM ORIGINAL - // ======================================================================================================== - vocabulary: this.enhanceVocabulary(jsModule.vocabulary || {}), - - // ======================================================================================================== - // SENTENCES SECTION - ENHANCED FROM ORIGINAL - // ======================================================================================================== - sentences: this.enhanceSentences(jsModule.sentences || []), - - // ======================================================================================================== - // CONVERSION METADATA - PROOF OF SYSTEM FUNCTIONALITY - // ======================================================================================================== - conversion_metadata: { - converted_from: "legacy_javascript_module", - conversion_timestamp: new Date().toISOString(), - conversion_system: "ultra_modular_converter_v1.0", - original_format: "js_content_module", - target_format: "ultra_modular_json_v2.0", - - // Original module stats - original_stats: { - vocabulary_count: capabilities.vocabularyCount, - sentence_count: capabilities.sentenceCount, - has_complex_phrases: capabilities.complexPhrases > 0 - }, - - // Detected capabilities - detected_capabilities: capabilities, - - // Game compatibility analysis - game_compatibility: compatibility, - - // Quality metrics - quality_score: this.calculateQualityScore(capabilities, compatibility) - }, - - // ======================================================================================================== - // SYSTEM VALIDATION - PROVES THE SYSTEM WORKS - // ======================================================================================================== - system_validation: { - format_version: "2.0", - specification: "ultra_modular", - backwards_compatible: true, - memory_stored: true, - conversion_verified: true, - ready_for_games: Object.values(compatibility).some(game => game.compatible) - } - }; - - return ultraModularSpec; - } - - extractTags(vocabulary) { - const tags = new Set(['vocabulary', 'intermediate']); - - for (const word of Object.keys(vocabulary)) { - if (word.match(/shirt|coat|dress|pants|jacket|shoes|clothing/)) { - tags.add('clothing'); - } - if (word.match(/building|apartment|house|room|elevator|housing/)) { - tags.add('housing'); - } - if (word.match(/street|town|center|avenue|places/)) { - tags.add('places'); - } - } - - return Array.from(tags); - } - - enhanceVocabulary(originalVocab) { - const enhanced = {}; - - for (const [word, translation] of Object.entries(originalVocab)) { - // CORRECTION: Ne pas inventer de donnĂ©es inexistantes! - // Conversion minimaliste: garder SEULEMENT ce qu'on a - enhanced[word] = { - user_language: translation, - original_language: word - // FINI. Pas d'invention de type, difficultĂ©, catĂ©gorie, etc. - }; - } - - return enhanced; - } - - enhanceSentences(originalSentences) { - return originalSentences.map((sentence, index) => ({ - id: `sentence_${index + 1}`, - original_language: sentence.english, - user_language: sentence.chinese - // FINI. Pas d'invention de grammatical_focus, topic, etc. - })); - } - - // CORRECTION: Helper methods - SEULEMENT pour l'analyse des donnĂ©es existantes, pas l'invention - - calculateQualityScore(capabilities, compatibility) { - let score = 0; - - // Base content score - if (capabilities.hasVocabulary) score += 30; - if (capabilities.hasSentences) score += 20; - - // Volume bonus - score += Math.min(25, capabilities.vocabularyCount); - score += Math.min(15, capabilities.sentenceCount * 2); - - // Compatibility bonus - const compatibleGames = Object.values(compatibility).filter(g => g.compatible).length; - score += compatibleGames * 2; - - return Math.min(100, score); - } -} - -// ======================================== -// EXÉCUTION DU TEST -// ======================================== - -console.log('🔄 Conversion en cours...'); - -const converter = new JSToUltraModularConverter(); -const ultraModularJSON = converter.convert(sbsContent); - -console.log('✅ Conversion terminĂ©e avec succĂšs!'); -console.log(`📊 Score de qualitĂ©: ${ultraModularJSON.conversion_metadata.quality_score}/100`); -console.log(`🎼 Jeux compatibles: ${Object.values(ultraModularJSON.conversion_metadata.game_compatibility).filter(g => g.compatible).length}/4`); -console.log(''); - -// ======================================== -// GÉNÉRATION DU FICHIER JSON -// ======================================== - -const fs = require('fs'); -const path = require('path'); - -const outputFile = 'sbs-level-7-8-GENERATED-from-js.json'; -const jsonContent = JSON.stringify(ultraModularJSON, null, 2); - -try { - fs.writeFileSync(outputFile, jsonContent, 'utf8'); - console.log(`📁 Fichier JSON gĂ©nĂ©rĂ©: ${outputFile}`); - console.log(`📏 Taille: ${(jsonContent.length / 1024).toFixed(1)} KB`); - console.log(`📄 Lignes: ${jsonContent.split('\n').length}`); - console.log(''); - - // Validation finale - const reloaded = JSON.parse(jsonContent); - console.log('✅ VALIDATION FINALE:'); - console.log(` - JSON valide: ✅`); - console.log(` - ID: ${reloaded.id}`); - console.log(` - Nom: ${reloaded.name}`); - console.log(` - Vocabulaire: ${Object.keys(reloaded.vocabulary).length} mots`); - console.log(` - Phrases: ${reloaded.sentences.length}`); - console.log(` - MĂ©tadonnĂ©es conversion: ✅`); - console.log(` - Score qualitĂ©: ${reloaded.conversion_metadata.quality_score}/100`); - console.log(''); - console.log('🎉 PREUVE ÉTABLIE: Le systĂšme fonctionne parfaitement!'); - console.log(' - DonnĂ©es JS chargĂ©es en mĂ©moire ✅'); - console.log(' - Analyse des capacitĂ©s ✅'); - console.log(' - Conversion ultra-modulaire ✅'); - console.log(' - GĂ©nĂ©ration JSON ✅'); - console.log(' - Validation finale ✅'); - -} catch (error) { - console.error('❌ Erreur lors de l\'Ă©criture du fichier:', error.message); - process.exit(1); -} - -console.log('========================================================'); -console.log('✅ Test de conversion JS → JSON Ultra-Modulaire RÉUSSI'); \ No newline at end of file diff --git a/test-curl.js b/test-curl.js deleted file mode 100644 index cd2b5c2..0000000 --- a/test-curl.js +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env node - -const crypto = require('crypto'); -const { spawn } = require('child_process'); - -// Configuration -const config = { - DO_ACCESS_KEY: 'DO801MU8BZBB89LLK4FN', - DO_SECRET_KEY: 'rfKPjampdpUCYhn02XrKg6IWKmqebjg9HQTGxNLzJQY', - DO_REGION: 'fra1' -}; - -function sha256(message) { - return crypto.createHash('sha256').update(message, 'utf8').digest('hex'); -} - -function hmacSha256(key, message) { - return crypto.createHmac('sha256', key).update(message, 'utf8').digest(); -} - -async function generateSignatureAndTest() { - const testUrl = 'https://autocollant.fra1.digitaloceanspaces.com/Class_generator/ContentMe/greetings-basic.json'; - const method = 'GET'; - - // Timestamp actuel - const now = new Date(); - const dateStamp = now.toISOString().slice(0, 10).replace(/-/g, ''); - const timeStamp = now.toISOString().slice(0, 19).replace(/[-:]/g, '') + 'Z'; - - console.log(`🕐 GĂ©nĂ©ration signature pour: ${timeStamp}`); - - // Parse URL - const urlObj = new URL(testUrl); - const host = urlObj.hostname; - const canonicalUri = urlObj.pathname; - - // Headers canoniques - const canonicalHeaders = `host:${host}\nx-amz-date:${timeStamp}\n`; - const signedHeaders = 'host;x-amz-date'; - - // RequĂȘte canonique - const payloadHash = sha256(''); - const canonicalRequest = [ - method, - canonicalUri, - '', // query string - canonicalHeaders, - signedHeaders, - payloadHash - ].join('\n'); - - // String to sign - const algorithm = 'AWS4-HMAC-SHA256'; - const credentialScope = `${dateStamp}/${config.DO_REGION}/s3/aws4_request`; - const canonicalRequestHash = sha256(canonicalRequest); - const stringToSign = [ - algorithm, - timeStamp, - credentialScope, - canonicalRequestHash - ].join('\n'); - - // Signature - const kDate = hmacSha256('AWS4' + config.DO_SECRET_KEY, dateStamp); - const kRegion = hmacSha256(kDate, config.DO_REGION); - const kService = hmacSha256(kRegion, 's3'); - const kSigning = hmacSha256(kService, 'aws4_request'); - const signature = hmacSha256(kSigning, stringToSign).toString('hex'); - - const authorization = `${algorithm} Credential=${config.DO_ACCESS_KEY}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signature}`; - - console.log(`🔑 Authorization: ${authorization}`); - - // Test avec curl - const curlArgs = [ - '-X', 'GET', - testUrl, - '-H', `Authorization: ${authorization}`, - '-H', `X-Amz-Date: ${timeStamp}`, - '-H', `X-Amz-Content-Sha256: ${payloadHash}`, - '-H', 'User-Agent: test-client', - '-i' - ]; - - console.log('🌐 Test curl...'); - - const curl = spawn('curl', curlArgs); - - curl.stdout.on('data', (data) => { - console.log(data.toString()); - }); - - curl.stderr.on('data', (data) => { - console.error(data.toString()); - }); - - curl.on('close', (code) => { - console.log(`✅ Curl terminĂ© avec code: ${code}`); - }); -} - -generateSignatureAndTest(); \ No newline at end of file diff --git a/test-digitalocean.html b/test-digitalocean.html deleted file mode 100644 index d09b0bc..0000000 --- a/test-digitalocean.html +++ /dev/null @@ -1,374 +0,0 @@ - - - - - - Test DigitalOcean Spaces Connection - - - -
-

🔧 Test de Connexion DigitalOcean Spaces

- -
-

📋 Configuration Actuelle

-
Chargement...
-
- -
-

đŸ§Ș Tests de Connexion

-
- - - - - -
-
- -
- -
-

📊 RĂ©sultats DĂ©taillĂ©s

-
-
- -
-

💡 Recommandations

-
- Les recommandations apparaĂźtront aprĂšs les tests... -
-
-
- - - - - - \ No newline at end of file diff --git a/test-do-auth.html b/test-do-auth.html deleted file mode 100644 index 5b998fc..0000000 --- a/test-do-auth.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - Test DigitalOcean Auth - - - -

🔧 Test Authentification DigitalOcean

- - -
- - - - - \ No newline at end of file diff --git a/test-dragon-pearl.js b/test-dragon-pearl.js deleted file mode 100644 index b935722..0000000 --- a/test-dragon-pearl.js +++ /dev/null @@ -1,59 +0,0 @@ -// === TEST AVEC DRAGON'S PEARL === - -// Simuler l'environnement browser -global.window = {}; -global.document = {}; -global.logSh = (msg, level) => console.log(`[${level}] ${msg}`); - -// Charger les modules -const fs = require('fs'); -const path = require('path'); - -// Charger le systĂšme de compatibilitĂ© -const compatibilityCode = fs.readFileSync(path.join(__dirname, 'js/core/content-game-compatibility.js'), 'utf8'); -eval(compatibilityCode); - -// Charger le contenu Dragon's Pearl -const dragonPearlCode = fs.readFileSync(path.join(__dirname, 'js/content/chinese-long-story.js'), 'utf8'); -eval(dragonPearlCode); - -console.log('🐉 Test avec Dragon\'s Pearl\n'); - -try { - const checker = new window.ContentGameCompatibility(); - const dragonPearlContent = window.ContentModules.ChineseLongStory; - - console.log('📩 Contenu Dragon\'s Pearl:'); - console.log(` Nom: ${dragonPearlContent.name}`); - console.log(` Description: ${dragonPearlContent.description}`); - console.log(` DifficultĂ©: ${dragonPearlContent.difficulty}`); - console.log(` Vocabulaire: ${Object.keys(dragonPearlContent.vocabulary || {}).length} mots`); - console.log(` Story: ${dragonPearlContent.story ? 'Oui' : 'Non'}`); - - console.log('\n🎼 Tests de compatibilitĂ©:'); - const games = ['whack-a-mole', 'memory-match', 'quiz-game', 'fill-the-blank', 'text-reader', 'adventure-reader']; - - games.forEach(game => { - const result = checker.checkCompatibility(dragonPearlContent, game); - const status = result.compatible ? '✅' : '❌'; - console.log(` ${status} ${game}: ${result.score}% - ${result.reason}`); - }); - - console.log('\n💡 Suggestions pour jeux incompatibles:'); - games.forEach(game => { - const result = checker.checkCompatibility(dragonPearlContent, game); - if (!result.compatible) { - const suggestions = checker.getImprovementSuggestions(dragonPearlContent, game); - if (suggestions.length > 0) { - console.log(` 📝 ${game}:`); - suggestions.forEach(suggestion => { - console.log(` 💡 ${suggestion}`); - }); - } - } - }); - -} catch (error) { - console.error('❌ Erreur:', error.message); - console.error(error.stack); -} \ No newline at end of file diff --git a/test-extraction-direct.js b/test-extraction-direct.js deleted file mode 100644 index 498e20d..0000000 --- a/test-extraction-direct.js +++ /dev/null @@ -1,87 +0,0 @@ -// === TEST EXTRACTION DIRECT === - -// Script pour tester l'extraction des phrases de Dragon's Pearl -// À copier-coller dans la console - -function testExtractionDirect() { - console.log('🔬 Test extraction direct Dragon\\'s Pearl'); - - // 1. RĂ©cupĂ©rer le module - const dragonModule = window.ContentModules?.ChineseLongStory; - console.log('\\n📩 Module Dragon\\'s Pearl:', !!dragonModule); - - if (!dragonModule) { - console.error('❌ Module non trouvĂ© !'); - return; - } - - // 2. Tester la structure - console.log('\\n🔍 Structure du module:'); - console.log(' story:', !!dragonModule.story); - console.log(' story.chapters:', !!dragonModule.story?.chapters); - console.log(' Nombre de chapitres:', dragonModule.story?.chapters?.length || 0); - - if (dragonModule.story?.chapters?.[0]) { - const firstChapter = dragonModule.story.chapters[0]; - console.log('\\n📖 Premier chapitre:'); - console.log(' Titre:', firstChapter.title); - console.log(' Sentences:', !!firstChapter.sentences); - console.log(' Nombre phrases:', firstChapter.sentences?.length || 0); - - if (firstChapter.sentences?.[0]) { - const firstSentence = firstChapter.sentences[0]; - console.log('\\n💬 PremiĂšre phrase:'); - console.log(' original:', firstSentence.original); - console.log(' translation:', firstSentence.translation); - console.log(' id:', firstSentence.id); - } - } - - // 3. Tester l'extraction manuellement - console.log('\\nđŸ§Ș Test extraction manuelle:'); - - const sentences = []; - - if (dragonModule.story && dragonModule.story.chapters && Array.isArray(dragonModule.story.chapters)) { - dragonModule.story.chapters.forEach(chapter => { - console.log(` Traitement chapitre: ${chapter.title}`); - - if (chapter.sentences && Array.isArray(chapter.sentences)) { - console.log(` ${chapter.sentences.length} phrases dans ce chapitre`); - - chapter.sentences.forEach(sentence => { - if (sentence.original && sentence.translation) { - sentences.push({ - original_language: sentence.original, - user_language: sentence.translation, - pronunciation: sentence.pronunciation || '', - chapter: chapter.title || '', - id: sentence.id || sentences.length - }); - } else { - console.warn(' ⚠ Phrase ignorĂ©e:', sentence); - } - }); - } else { - console.warn(` ⚠ Pas de sentences dans ${chapter.title}`); - } - }); - } else { - console.error(' ❌ Structure story.chapters introuvable'); - } - - console.log('\\n📊 RĂ©sultat extraction:'); - console.log(' Phrases extraites:', sentences.length); - - if (sentences.length > 0) { - console.log(' PremiĂšre phrase extraite:', sentences[0]); - console.log(' DerniĂšre phrase extraite:', sentences[sentences.length - 1]); - } else { - console.error(' ❌ Aucune phrase extraite !'); - } - - return sentences; -} - -// Auto-exĂ©cution -const results = testExtractionDirect(); \ No newline at end of file diff --git a/test-final-compatibility.html b/test-final-compatibility.html deleted file mode 100644 index aecb8df..0000000 --- a/test-final-compatibility.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - Test Final - SystĂšme de CompatibilitĂ© - - - -

🎯 Test Final - SystĂšme de CompatibilitĂ© Content-Game

- -
-

📊 Vue d'ensemble

-
- -
- - -
- -
-

📩 Contenus DĂ©tectĂ©s

-
-
- -
-

🎼 Matrice de CompatibilitĂ©

-
-
- -
-

📋 Log d'ExĂ©cution

-
-
- - - - - - - - - - - \ No newline at end of file diff --git a/test-flux-bouton-back.md b/test-flux-bouton-back.md deleted file mode 100644 index c1c4042..0000000 --- a/test-flux-bouton-back.md +++ /dev/null @@ -1,60 +0,0 @@ -# 🔄 TEST DU FLUX BOUTON BACK - -## ✅ Ancienne Interface SupprimĂ©e - -La fonction `showGamesPageFallback()` a Ă©tĂ© **complĂštement supprimĂ©e** de `navigation.js`. - -## 🎯 Nouveau Flux Unique - -### 1. Depuis Niveau → Jeux ✅ -``` -Levels → Clic Dragon's Pearl → showGamesPage(content) → Interface avec compatibilitĂ© -``` - -### 2. Depuis Bouton Back ✅ -``` -Jeux → Bouton Back → goBack() → RĂ©cupĂšre content depuis URL → showGamesPage(content) → Interface avec compatibilitĂ© -``` - -### 3. Si Pas de Content (Fallback) ✅ -``` -Jeux → Bouton Back → goBack() → Pas de content → Retour aux Levels -``` - -## 🔧 Modifications ApportĂ©es - -### 1. SupprimĂ© `showGamesPageFallback()` -- ❌ **SUPPRIMÉ** : L'ancienne interface sans compatibilitĂ© -- ✅ **GARDÉ** : `showGamesPage()` + `renderGamesGrid()` avec compatibilitĂ© - -### 2. ModifiĂ© `navigateTo()` case 'games' -```javascript -case 'games': - if (!content) { - // Retour aux levels si pas de content - this.showLevelsPage(); - } else { - // Interface avec compatibilitĂ© - this.showGamesPage(content) - } -``` - -### 3. ModifiĂ© `goBack()` pour games -```javascript -} else if (previousPage === 'games') { - const urlContent = params.content; - if (urlContent) { - this.navigateTo('games', null, urlContent); // ✅ Avec content - } else { - this.navigateTo('levels'); // ✅ Fallback vers levels - } -``` - -## 🎯 RĂ©sultat - -Maintenant il n'y a plus qu'**UNE SEULE interface** pour choisir les jeux : -- ✅ **Toujours** avec analyse de compatibilitĂ© -- ✅ **Toujours** avec badges et sections -- ✅ **Toujours** avec le scan dynamique - -**Peu importe** comment tu arrives sur la page des jeux (depuis niveau ou bouton back), c'est **toujours la mĂȘme interface** avec compatibilitĂ© ! 🚀 \ No newline at end of file diff --git a/test-logs-interface.html b/test-logs-interface.html deleted file mode 100644 index 222fb4e..0000000 --- a/test-logs-interface.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - Test Logs Interface Direct - - - -

Test Direct Interface de Logs

-
En attente...
-
- - - - \ No newline at end of file diff --git a/test-node-compatibility.js b/test-node-compatibility.js deleted file mode 100644 index fde87a9..0000000 --- a/test-node-compatibility.js +++ /dev/null @@ -1,107 +0,0 @@ -// === TEST NODE.JS DU SYSTÈME DE COMPATIBILITÉ === - -// Simuler l'environnement browser -global.window = {}; -global.document = {}; -global.logSh = (msg, level) => console.log(`[${level}] ${msg}`); - -// Charger les modules -const fs = require('fs'); -const path = require('path'); - -// Charger le systĂšme de compatibilitĂ© -const compatibilityCode = fs.readFileSync(path.join(__dirname, 'js/core/content-game-compatibility.js'), 'utf8'); -eval(compatibilityCode); - -// CrĂ©er les contenus de test -const testMinimalContent = { - id: "test-minimal", - name: "Test Minimal", - vocabulary: { - "hello": "bonjour", - "world": "monde" - } -}; - -const testRichContent = { - id: "test-rich", - name: "Test Riche", - vocabulary: { - "apple": { - translation: "pomme", - prononciation: "apple", - type: "noun" - }, - "book": { - translation: "livre", - prononciation: "book", - type: "noun" - }, - "car": { - translation: "voiture", - prononciation: "car", - type: "noun" - }, - "dog": { - translation: "chien", - prononciation: "dog", - type: "noun" - }, - "eat": { - translation: "manger", - prononciation: "eat", - type: "verb" - } - }, - sentences: [ - { english: "I have an apple", french: "J'ai une pomme" }, - { english: "The dog is good", french: "Le chien est bon" }, - { english: "I like books", french: "J'aime les livres" } - ], - dialogues: [ - { - title: "Test dialogue", - conversation: [ - { speaker: "A", english: "Hello", french: "Bonjour" }, - { speaker: "B", english: "Hi there", french: "Salut" } - ] - } - ] -}; - -// Tester le systĂšme -console.log('đŸ§Ș Test du systĂšme de compatibilitĂ© Content-Game\n'); - -try { - const checker = new window.ContentGameCompatibility(); - console.log('✅ ContentGameCompatibility initialisĂ©\n'); - - const games = ['whack-a-mole', 'memory-match', 'quiz-game', 'fill-the-blank', 'text-reader', 'adventure-reader']; - - console.log('📩 Test avec contenu minimal (2 mots):'); - games.forEach(game => { - const result = checker.checkCompatibility(testMinimalContent, game); - const status = result.compatible ? '✅' : '❌'; - console.log(` ${status} ${game}: ${result.score}% - ${result.reason}`); - }); - - console.log('\n📩 Test avec contenu riche:'); - games.forEach(game => { - const result = checker.checkCompatibility(testRichContent, game); - const status = result.compatible ? '✅' : '❌'; - console.log(` ${status} ${game}: ${result.score}% - ${result.reason}`); - }); - - console.log('\nđŸ§Ș Test des suggestions d\'amĂ©lioration:'); - const suggestions = checker.getImprovementSuggestions(testMinimalContent, 'whack-a-mole'); - console.log(` Suggestions pour "whack-a-mole":`); - suggestions.forEach(suggestion => { - console.log(` 💡 ${suggestion}`); - }); - - console.log('\n🎉 Tous les tests rĂ©ussis!'); - -} catch (error) { - console.error('❌ Erreur:', error.message); - console.error(error.stack); -} \ No newline at end of file diff --git a/test-real-flow.js b/test-real-flow.js deleted file mode 100644 index 6dceec1..0000000 --- a/test-real-flow.js +++ /dev/null @@ -1,116 +0,0 @@ -// === TEST DU FLUX COMPLET === - -// Test qui simule exactement le flux rĂ©el de l'application -async function testRealFlow() { - console.log('🔄 Test du flux complet de l\'application\n'); - - // Simuler l'environnement browser - global.window = {}; - global.document = {}; - global.logSh = (msg, level) => console.log(`[${level}] ${msg}`); - - // Charger tous les modules - const fs = require('fs'); - const path = require('path'); - - // 1. Charger ContentScanner - const scannerCode = fs.readFileSync(path.join(__dirname, 'js/core/content-scanner.js'), 'utf8'); - eval(scannerCode); - - // 2. Charger ContentGameCompatibility - const compatibilityCode = fs.readFileSync(path.join(__dirname, 'js/core/content-game-compatibility.js'), 'utf8'); - eval(compatibilityCode); - - // 3. Charger le contenu Dragon's Pearl - const dragonPearlCode = fs.readFileSync(path.join(__dirname, 'js/content/chinese-long-story.js'), 'utf8'); - eval(dragonPearlCode); - - try { - console.log('🚀 1. Initialisation du systĂšme...'); - const scanner = new window.ContentScanner(); - const checker = new window.ContentGameCompatibility(); - - console.log('📩 2. Scan du contenu...'); - const results = await scanner.scanAllContent(); - console.log(` TrouvĂ©: ${results.found.length} modules`); - - // 3. Rechercher Dragon's Pearl dans les rĂ©sultats - console.log('🐉 3. Recherche Dragon\'s Pearl...'); - const dragonPearl = results.found.find(content => - content.name.includes('Dragon') || content.id.includes('chinese-long-story') - ); - - if (dragonPearl) { - console.log(` ✅ TrouvĂ©: ${dragonPearl.name} (ID: ${dragonPearl.id})`); - - // 4. Test de compatibilitĂ© comme dans l'interface - console.log('🎼 4. Test de compatibilitĂ© des jeux...'); - const games = ['whack-a-mole', 'memory-match', 'quiz-game', 'fill-the-blank', 'text-reader', 'adventure-reader']; - - const compatibleGames = []; - const incompatibleGames = []; - - games.forEach(game => { - const compatibility = checker.checkCompatibility(dragonPearl, game); - const gameData = { game, compatibility }; - - if (compatibility.compatible) { - compatibleGames.push(gameData); - } else { - incompatibleGames.push(gameData); - } - - console.log(` ${compatibility.compatible ? '✅' : '❌'} ${game}: ${compatibility.score}%`); - }); - - console.log(`\n📊 RĂ©sultat final:`); - console.log(` 🎯 Jeux compatibles: ${compatibleGames.length}`); - console.log(` ⚠ Jeux incompatibles: ${incompatibleGames.length}`); - - if (compatibleGames.length > 0) { - console.log(`\n🎉 SUCCESS: Dragon's Pearl devrait maintenant afficher ${compatibleGames.length} jeux compatibles`); - - // Simuler l'affichage comme dans l'interface - console.log('\n🎯 Jeux recommandĂ©s:'); - compatibleGames - .sort((a, b) => b.compatibility.score - a.compatibility.score) - .forEach(({ game, compatibility }) => { - const badge = compatibility.score >= 80 ? '🎯 Excellent' : - compatibility.score >= 60 ? '✅ RecommandĂ©' : '👍 Compatible'; - console.log(` ${badge} ${game} (${compatibility.score}%)`); - }); - - if (incompatibleGames.length > 0) { - console.log('\n⚠ Jeux avec limitations:'); - incompatibleGames.forEach(({ game, compatibility }) => { - console.log(` ⚠ LimitĂ© ${game} (${compatibility.score}%) - ${compatibility.reason}`); - }); - } - } else { - console.log('❌ PROBLÈME: Aucun jeu compatible dĂ©tectĂ©'); - } - - } else { - console.log('❌ Dragon\'s Pearl non trouvĂ© dans les rĂ©sultats'); - console.log(' Contenus trouvĂ©s:'); - results.found.forEach(content => { - console.log(` - ${content.name} (ID: ${content.id})`); - }); - } - - } catch (error) { - console.error('❌ Erreur:', error.message); - console.error(error.stack); - } -} - -// Utils pour le scanner -global.window = global.window || {}; -global.window.Utils = { - storage: { - get: (key, defaultValue) => defaultValue, - set: (key, value) => {} - } -}; - -testRealFlow(); \ No newline at end of file diff --git a/test-reverse-conversion.html b/test-reverse-conversion.html deleted file mode 100644 index c93628e..0000000 --- a/test-reverse-conversion.html +++ /dev/null @@ -1,457 +0,0 @@ - - - - - - 🔄 Test: JS → JSON Ultra-Modulaire - - - -

🔄 Test: Conversion JS → JSON Ultra-Modulaire

-

Démonstration complÚte du systÚme : partir d'un module JS existant et générer un JSON ultra-modulaire

- -
- - - - - - - - - - - - - \ No newline at end of file diff --git a/test-ultra-modular.html b/test-ultra-modular.html deleted file mode 100644 index f445277..0000000 --- a/test-ultra-modular.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - Test Ultra-Modular JSON System - - - -

đŸ§Ș Test du SystĂšme Ultra-Modulaire

-

Test de compatibilité avec les nouvelles spécifications JSON

- -
- - - - - - - - - - - \ No newline at end of file diff --git a/test-websocket-simple.html b/test-websocket-simple.html deleted file mode 100644 index 7219e42..0000000 --- a/test-websocket-simple.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - Test WebSocket Simple - - - -

Test WebSocket Simple

-
En attente...
-
- - - - \ No newline at end of file diff --git a/todotemp.md b/todotemp.md deleted file mode 100644 index 362a10f..0000000 --- a/todotemp.md +++ /dev/null @@ -1,158 +0,0 @@ -# TODO List - DĂ©veloppement Technique - -## 🚹 URGENT - DEMAIN - -### Core Navigation System -- [ ] Create index.html with 3-level navigation -- [ ] Implement URL routing with params (?page=games&game=whack&content=sbs8) -- [ ] Build game-selector.html with clickable cards -- [ ] Build level-selector.html with dynamic content loading -- [ ] Create game.html generic page with dynamic module loading - -### Game Modules -- [ ] Refactor existing whack-a-mole.js into proper module format -- [ ] Refactor existing fill-the-blank.js into proper module format -- [ ] Implement game loader system (js/core/game-loader.js) -- [ ] Create base GameEngine class for inheritance - -### Content System -- [ ] Convert sbs-level-8.js to new unified format -- [ ] Implement content loader system -- [ ] Create content validation functions -- [ ] Add error handling for missing content - -### New Games (Pick 3-4) -- [ ] simon-says.js - digital "Touch the X" game -- [ ] speed-categories.js - rapid category clicking -- [ ] true-false.js - rapid true/false with images -- [ ] memory-pairs.js - classic memory game -- [ ] sound-match.js - audio to image matching -- [ ] catch-words.js - flying words to catch - ---- - -## 📚 CONTENT EXPANSION - -### Lesson Introduction Module -- [ ] Create lesson-intro.js for vocabulary presentation -- [ ] Add context presentation before games -- [ ] Implement guided repetition system -- [ ] Add audio playback for pronunciation - -### Additional Content Modules -- [ ] animals.js vocabulary set -- [ ] colors.js vocabulary set -- [ ] family-extended.js more family vocabulary -- [ ] actions.js verbs and actions - ---- - -## 🔧 TECHNICAL IMPROVEMENTS - -### Core System -- [ ] navigation.js - handle URL routing and back buttons -- [ ] utils.js - shared utility functions -- [ ] audio-manager.js - handle sound loading/playing -- [ ] progress-tracker.js - basic score tracking - -### Game Engine Enhancements -- [ ] Standardize game initialization pattern -- [ ] Add game state management (start/pause/stop/reset) -- [ ] Implement scoring system interface -- [ ] Add game configuration loading - -### Performance & UX -- [ ] Lazy loading for game modules -- [ ] Preload critical assets -- [ ] Add loading states and spinners -- [ ] Implement keyboard shortcuts (ESC = back) - ---- - -## 🎯 MODULAR ARCHITECTURE - -### File Structure Implementation -``` -├── index.html -├── css/ -│ ├── main.css -│ ├── games.css -│ └── navigation.css -├── js/ -│ ├── core/ -│ │ ├── navigation.js -│ │ ├── game-loader.js -│ │ ├── content-loader.js -│ │ └── utils.js -│ ├── games/ -│ │ ├── base-game.js -│ │ ├── whack-a-mole.js -│ │ ├── fill-blank.js -│ │ ├── simon-says.js -│ │ ├── speed-categories.js -│ │ └── temp-games.js -│ └── content/ -│ ├── sbs-level-8.js -│ ├── animals.js -│ └── colors.js -``` - -### Module Standards -- [ ] Define base game class interface -- [ ] Standardize content module format -- [ ] Create module registration system -- [ ] Implement dependency loading - ---- - -## 🌟 FUTURE TECHNICAL FEATURES - -### Advanced Game Types -- [ ] drag-drop.js - sentence building -- [ ] story-builder.js - narrative construction -- [ ] voice-game.js - speech recognition -- [ ] drawing-game.js - character tracing - -### Content Management -- [ ] JSON-based content configuration -- [ ] Content validation schemas -- [ ] Dynamic content generation helpers -- [ ] Content import/export utilities - -### System Extensions -- [ ] Plugin architecture for third-party games -- [ ] API for external content sources -- [ ] Offline caching system -- [ ] Multi-language UI support - ---- - -## 🚀 CHINESE VERSION PREP - -### Architecture Adaptation -- [ ] Extend content format for Chinese specifics -- [ ] Add tone support in audio system -- [ ] Implement character stroke order -- [ ] Add pinyin display system - -### Chinese-Specific Games -- [ ] stroke-order.js - character writing -- [ ] tone-practice.js - tone recognition -- [ ] radical-builder.js - character composition -- [ ] pinyin-typing.js - romanization practice - ---- - -## đŸ€– AI INTEGRATION PREP - -### API Integration Points -- [ ] content-generator.js - AI content creation -- [ ] response-validator.js - AI answer checking -- [ ] difficulty-adapter.js - AI difficulty adjustment -- [ ] feedback-generator.js - AI personalized feedback - -### Data Collection -- [ ] User interaction logging -- [ ] Performance metrics collection -- [ ] Error pattern tracking -- [ ] Learning progress data structure \ No newline at end of file diff --git a/validate-compatibility-system.js b/validate-compatibility-system.js deleted file mode 100644 index e94a8e6..0000000 --- a/validate-compatibility-system.js +++ /dev/null @@ -1,75 +0,0 @@ -// === SCRIPT DE VALIDATION DU SYSTÈME DE COMPATIBILITÉ === - -// Fonction pour tester le chargement des modules -async function validateCompatibilitySystem() { - console.log('đŸ§Ș Validation du systĂšme de compatibilitĂ©...'); - - // Test 1: VĂ©rifier que les classes globales existent - console.log('\n1ïžâƒŁ Test des classes globales:'); - const requiredClasses = [ - 'ContentScanner', - 'ContentGameCompatibility' - ]; - - requiredClasses.forEach(className => { - if (window[className]) { - console.log(`✅ ${className} est disponible`); - } else { - console.error(`❌ ${className} manquant!`); - } - }); - - // Test 2: Initialiser les systĂšmes - console.log('\n2ïžâƒŁ Test d\'initialisation:'); - try { - const scanner = new window.ContentScanner(); - console.log('✅ ContentScanner initialisĂ©'); - - const checker = new window.ContentGameCompatibility(); - console.log('✅ ContentGameCompatibility initialisĂ©'); - - // Test 3: Scanner le contenu - console.log('\n3ïžâƒŁ Test du scan de contenu:'); - const results = await scanner.scanAllContent(); - console.log(`✅ Scan terminĂ©: ${results.found.length} modules trouvĂ©s`); - - // Test 4: Test de compatibilitĂ© - console.log('\n4ïžâƒŁ Test de compatibilitĂ©:'); - if (results.found.length > 0) { - const testContent = results.found[0]; - const compatibility = checker.checkCompatibility(testContent, 'whack-a-mole'); - console.log(`✅ Test compatibilitĂ©: ${testContent.name} → whack-a-mole = ${compatibility.compatible ? 'Compatible' : 'Incompatible'} (${compatibility.score}%)`); - } - - // Test 5: VĂ©rifier AppNavigation - console.log('\n5ïžâƒŁ Test de l\'intĂ©gration navigation:'); - if (window.AppNavigation && window.AppNavigation.compatibilityChecker) { - console.log('✅ AppNavigation a le systĂšme de compatibilitĂ© intĂ©grĂ©'); - } else { - console.log('⚠ AppNavigation n\'a pas le systĂšme de compatibilitĂ©'); - } - - console.log('\n🎉 Tous les tests passĂ©s!'); - return true; - - } catch (error) { - console.error(`❌ Erreur pendant les tests: ${error.message}`); - console.error(error.stack); - return false; - } -} - -// Auto-exĂ©cution si ce script est chargĂ© directement -if (typeof window !== 'undefined') { - // Attendre que tous les scripts soient chargĂ©s - if (document.readyState === 'loading') { - document.addEventListener('DOMContentLoaded', () => { - setTimeout(validateCompatibilitySystem, 1000); - }); - } else { - setTimeout(validateCompatibilitySystem, 1000); - } -} - -// Export pour utilisation manuelle -window.validateCompatibilitySystem = validateCompatibilitySystem; \ No newline at end of file diff --git a/verify-real-app.js b/verify-real-app.js deleted file mode 100644 index 46492d1..0000000 --- a/verify-real-app.js +++ /dev/null @@ -1,148 +0,0 @@ -// === SCRIPT DE VÉRIFICATION APPLICATION RÉELLE === - -// Test que tous les composants fonctionnent ensemble dans l'app rĂ©elle -async function verifyRealApplication() { - console.log('🔍 VĂ©rification de l\'application rĂ©elle...\n'); - - const tests = []; - - // Test 1: VĂ©rifier que AppNavigation existe et est initialisĂ© - tests.push({ - name: 'AppNavigation disponible', - test: () => window.AppNavigation && typeof window.AppNavigation.init === 'function', - critical: true - }); - - // Test 2: VĂ©rifier que le systĂšme de compatibilitĂ© est intĂ©grĂ© - tests.push({ - name: 'SystĂšme de compatibilitĂ© intĂ©grĂ©', - test: () => window.AppNavigation && window.AppNavigation.compatibilityChecker, - critical: true - }); - - // Test 3: VĂ©rifier que ContentScanner est opĂ©rationnel - tests.push({ - name: 'ContentScanner opĂ©rationnel', - test: () => window.AppNavigation && window.AppNavigation.contentScanner, - critical: true - }); - - // Test 4: VĂ©rifier que GameLoader existe - tests.push({ - name: 'GameLoader disponible', - test: () => window.GameLoader && typeof window.GameLoader.loadGame === 'function', - critical: true - }); - - // Test 5: VĂ©rifier que les modules de jeu sont chargĂ©s - tests.push({ - name: 'Modules de jeu chargĂ©s', - test: () => window.GameModules && Object.keys(window.GameModules).length > 0, - critical: false - }); - - // Test 6: VĂ©rifier que les modules de contenu sont chargĂ©s - tests.push({ - name: 'Modules de contenu chargĂ©s', - test: () => window.ContentModules && Object.keys(window.ContentModules).length > 0, - critical: false - }); - - // Test 7: VĂ©rifier que showGamesPage est async - tests.push({ - name: 'showGamesPage est async', - test: () => { - const fn = window.AppNavigation.showGamesPage; - return fn && fn.constructor.name === 'AsyncFunction'; - }, - critical: true - }); - - // Test 8: VĂ©rifier les CSS de compatibilitĂ© - tests.push({ - name: 'CSS de compatibilitĂ© chargĂ©', - test: () => { - const sheets = Array.from(document.styleSheets); - return sheets.some(sheet => { - try { - const rules = Array.from(sheet.cssRules || []); - return rules.some(rule => rule.selectorText && rule.selectorText.includes('compatibility-badge')); - } catch (e) { - return false; - } - }); - }, - critical: false - }); - - // ExĂ©cuter tous les tests - let passedTests = 0; - let criticalFailed = 0; - - console.log('📋 RĂ©sultats des tests:\n'); - - for (const test of tests) { - try { - const result = test.test(); - if (result) { - console.log(`✅ ${test.name}`); - passedTests++; - } else { - const level = test.critical ? 'CRITIQUE' : 'OPTIONNEL'; - console.log(`❌ ${test.name} (${level})`); - if (test.critical) criticalFailed++; - } - } catch (error) { - const level = test.critical ? 'CRITIQUE' : 'OPTIONNEL'; - console.log(`🚹 ${test.name} - ERREUR: ${error.message} (${level})`); - if (test.critical) criticalFailed++; - } - } - - console.log(`\n📊 RĂ©sultat: ${passedTests}/${tests.length} tests rĂ©ussis`); - - if (criticalFailed === 0) { - console.log('🎉 Tous les tests critiques passent! L\'application est prĂȘte.'); - - // Test bonus: essayer de charger du contenu - if (window.AppNavigation && window.AppNavigation.contentScanner) { - console.log('\n🔍 Test bonus: chargement du contenu...'); - try { - const results = await window.AppNavigation.contentScanner.scanAllContent(); - console.log(`✅ ${results.found.length} modules de contenu dĂ©tectĂ©s`); - - // Test de compatibilitĂ© sur contenu rĂ©el - if (results.found.length > 0 && window.AppNavigation.compatibilityChecker) { - const testContent = results.found[0]; - const compatibility = window.AppNavigation.compatibilityChecker.checkCompatibility(testContent, 'whack-a-mole'); - console.log(`✅ Test compatibilitĂ©: ${compatibility.compatible ? 'COMPATIBLE' : 'INCOMPATIBLE'} (${compatibility.score}%)`); - } - } catch (error) { - console.log(`⚠ Erreur lors du test bonus: ${error.message}`); - } - } - - return true; - } else { - console.log(`❌ ${criticalFailed} tests critiques ont Ă©chouĂ©. VĂ©rification nĂ©cessaire.`); - return false; - } -} - -// Fonction d'auto-test -function autoVerify() { - // Attendre que l'app soit complĂštement chargĂ©e - if (document.readyState !== 'complete') { - window.addEventListener('load', () => setTimeout(verifyRealApplication, 2000)); - } else { - setTimeout(verifyRealApplication, 2000); - } -} - -// Export pour utilisation manuelle -window.verifyRealApplication = verifyRealApplication; - -// Auto-vĂ©rification si ce script est chargĂ© dans l'app rĂ©elle -if (typeof window !== 'undefined' && window.location.pathname === '/') { - autoVerify(); -} \ No newline at end of file