diff --git a/html/kidsai/script-new.js b/html/kidsai/script-new.js index 6afc393..0b36801 100644 --- a/html/kidsai/script-new.js +++ b/html/kidsai/script-new.js @@ -237,12 +237,13 @@ class KidsAIExplorer { // Show thinking section this.thinkingSection.classList.remove('hidden'); - // Clear previous content + // Clear previous content completely this.thinkingSteps.innerHTML = ''; - // Initialize conversation state + // Reset conversation state this.currentStep = 0; this.userAnswers = []; + this.currentQuestionIndex = 0; // Create conversation container const conversationContainer = document.createElement('div'); @@ -254,9 +255,9 @@ class KidsAIExplorer { welcomeStep.className = 'conversation-step visible'; // Get translations before creating HTML to avoid context issues - const encouragementText = guidance.encouragement || this.getTranslation('default-encouragement') || "Great question! Let's explore this together step by step! 🚀"; - const detectiveHelpText = this.getTranslation('detective-help') || "Instead of giving you the answer right away, I'll help you think through this like a detective! 🕵️"; - const aiTeacherText = this.getTranslation('ai-teacher') || "AI Teacher"; + const encouragementText = guidance.encouragement || this.getTranslation('default-encouragement') || (this.currentLanguage === 'de' ? "Fantastische Frage! Lass uns das gemeinsam Schritt für Schritt erforschen! 🚀" : "Great question! Let's explore this together step by step! 🚀"); + const detectiveHelpText = this.getTranslation('detective-help') || (this.currentLanguage === 'de' ? "Anstatt dir die Antwort gleich zu geben, helfe ich dir dabei, wie ein Detektiv zu denken! 🕵️" : "Instead of giving you the answer right away, I'll help you think through this like a detective! 🕵️"); + const aiTeacherText = this.getTranslation('ai-teacher') || (this.currentLanguage === 'de' ? "KI-Lehrer" : "AI Teacher"); welcomeStep.innerHTML = `