diff --git a/html/kidsai/index.html b/html/kidsai/index.html index 941a895..2514bf4 100755 --- a/html/kidsai/index.html +++ b/html/kidsai/index.html @@ -162,6 +162,9 @@ }, 100); + + + diff --git a/html/kidsai/script.js b/html/kidsai/script.js index cf43c4c..fd01863 100644 --- a/html/kidsai/script.js +++ b/html/kidsai/script.js @@ -238,10 +238,39 @@ class KidsAIExplorer { }, index * 800); }); - // Add answer reveal button only for exploratory questions - if (guidance.showAnswerReveal === true) { + // For exploratory questions, set up conversation if AI asked a question + if (guidance.questionType === 'exploratory') { setTimeout(() => { - this.addAnswerRevealSection(); + // Get the full AI response text from guidance + const aiResponseText = guidance.steps.map(step => step.text).join(' '); + const isAIQuestion = aiResponseText.includes('?'); + + if (isAIQuestion) { + // Add conversation interface + const conversationDiv = document.createElement('div'); + conversationDiv.className = 'ai-conversation'; + conversationDiv.innerHTML = ` +
+
🤖
+
${aiResponseText}
+
+
+
+ + +
+
+ `; + + this.thinkingSteps.appendChild(conversationDiv); + this.setupAIConversation(conversationDiv); + } else { + // No question from AI, just show completion + this.addAnswerRevealSection(); + } }, guidance.steps.length * 800 + 1000); } else { // For mathematical/factual questions, add "Check My Work" button @@ -1061,8 +1090,6 @@ class KidsAIExplorer { // Check if AI is asking a question (contains question mark) const isAIQuestion = feedback.response.includes('?'); - console.log('AI Response:', feedback.response); - console.log('Contains question?', isAIQuestion); feedbackDiv.innerHTML = `
diff --git a/html/kidsai/test-conversation.html b/html/kidsai/test-conversation.html new file mode 100644 index 0000000..03f63cf --- /dev/null +++ b/html/kidsai/test-conversation.html @@ -0,0 +1,59 @@ + + + + + + Test Conversation Feature + + + +

Test Conversation Feature

+ +
Debug info will appear here...
+ + + +
+ +
+ + + +