- Add intelligent content-game compatibility system with visual badges - Fix Adventure Reader to work with Dragon's Pearl content structure - Implement multi-column games grid for faster navigation - Add pronunciation display for Chinese vocabulary and sentences - Fix navigation breadcrumb to show proper hierarchy (Home > Levels > Content) - Add back buttons to all navigation pages - Improve JSONContentLoader to preserve story structure - Add comprehensive debugging and diagnostic tools 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
84 lines
3.5 KiB
JavaScript
84 lines
3.5 KiB
JavaScript
// === 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'); |