diff --git a/html/kidsai/index.html b/html/kidsai/index.html index 9a9d98e..071bcf9 100755 --- a/html/kidsai/index.html +++ b/html/kidsai/index.html @@ -1,5 +1,8 @@ - + + + + ang="en"> diff --git a/html/kidsai/script.js b/html/kidsai/script.js index 563f603..5af2ed3 100644 --- a/html/kidsai/script.js +++ b/html/kidsai/script.js @@ -184,6 +184,14 @@ class KidsAIExplorer { `; this.thinkingSteps.appendChild(encouragementDiv); + // Handle exploratory questions with conversational response + if (guidance.questionType === 'exploratory' && guidance.conversationalResponse) { + setTimeout(() => { + this.displayConversationalResponse(guidance.conversationalResponse); + }, 500); + return; + } + // Handle exploratory questions with conversational response if (guidance.questionType === 'exploratory' && guidance.conversationalResponse) { // Create conversational interface directly @@ -287,6 +295,44 @@ class KidsAIExplorer { }, 500); } + displayConversationalResponse(aiResponse) { + // Create conversation interface + const conversationDiv = document.createElement('div'); + conversationDiv.className = 'ai-conversation'; + + // Check if AI response contains a question + const hasQuestion = aiResponse.includes('?'); + + conversationDiv.innerHTML = ` +
+
🤖
+
${aiResponse}
+
+ + AI Teacher +
+
+ ${hasQuestion ? ` +
+
+ + +
+
+ ` : ''} + `; + + this.thinkingSteps.appendChild(conversationDiv); + + // Set up conversation interaction if there's a question + if (hasQuestion) { + this.setupAIConversation(conversationDiv); + } + } + addCompletionMessage(questionType) { const completionSection = document.createElement('div'); completionSection.className = 'completion-message';