🔧 FIX: Remove duplicate questions from AI responses
PROBLEM: AI was generating follow-up questions AND system was asking pre-programmed questions RESULT: Confusing double questions like 'Now, can you think about...' + '1) Do you know...' SOLUTION: - Modified AI prompt to NOT include follow-up questions - AI now only provides encouragement and validation - System handles question flow with pre-programmed sequence - Cleaner, less cluttered conversation experience BEFORE: 'Great thinking! Now, what do you think happens next? 🤖 1) Do you know...' AFTER: 'Great thinking! You understand the concept perfectly! 🤖 1) Do you know...'
This commit is contained in:
@@ -176,9 +176,9 @@
|
|||||||
}, 100);
|
}, 100);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="translations.js?v=20250629173500"></script>
|
<script src="translations.js?v=20250629174500"></script>
|
||||||
<script src="ai-responses.js?v=20250629173500"></script>
|
<script src="ai-responses.js?v=20250629174500"></script>
|
||||||
<script src="script-new.js?v=20250629173500"></script>
|
<script src="script-new.js?v=20250629174500"></script>
|
||||||
|
|
||||||
<!-- Inline debugging script -->
|
<!-- Inline debugging script -->
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -569,11 +569,10 @@ ANTWORT DES KINDES: "${answer}"
|
|||||||
Deine Aufgabe ist es, eine ermutigende, pädagogische Antwort zu geben, die:
|
Deine Aufgabe ist es, eine ermutigende, pädagogische Antwort zu geben, die:
|
||||||
1. Das Kind für seine Antwort ermutigt (egal ob richtig oder falsch)
|
1. Das Kind für seine Antwort ermutigt (egal ob richtig oder falsch)
|
||||||
2. Auf ihrer spezifischen Antwort aufbaut
|
2. Auf ihrer spezifischen Antwort aufbaut
|
||||||
3. Ihr Denken erweitert, ohne die Antwort direkt zu verraten
|
3. Ihr Denken würdigt und erweitert
|
||||||
4. Eine weitere durchdachte Frage stellt, um ihr Denken zu vertiefen
|
4. Verwende Emojis sparsam und altersgerecht
|
||||||
5. Verwende Emojis sparsam und altersgerecht
|
|
||||||
|
|
||||||
Antworte in 2-3 Sätzen mit einer Folgefrage.` :
|
WICHTIG: Stelle KEINE Folgefragen - antworte nur mit Ermutigung und Bestätigung in 1-2 Sätzen.` :
|
||||||
`You are an educational AI assistant for children. A child just answered a question.
|
`You are an educational AI assistant for children. A child just answered a question.
|
||||||
|
|
||||||
QUESTION: "${question}"
|
QUESTION: "${question}"
|
||||||
@@ -582,11 +581,10 @@ CHILD'S ANSWER: "${answer}"
|
|||||||
Your task is to provide an encouraging, educational response that:
|
Your task is to provide an encouraging, educational response that:
|
||||||
1. Encourages the child for their answer (regardless of right or wrong)
|
1. Encourages the child for their answer (regardless of right or wrong)
|
||||||
2. Builds on their specific answer
|
2. Builds on their specific answer
|
||||||
3. Expands their thinking without giving away the answer directly
|
3. Acknowledges and expands their thinking
|
||||||
4. Asks a thoughtful follow-up question to deepen their thinking
|
4. Use emojis sparingly and age-appropriately
|
||||||
5. Use emojis sparingly and age-appropriately
|
|
||||||
|
|
||||||
Respond in 2-3 sentences with a follow-up question.`;
|
IMPORTANT: Do NOT ask follow-up questions - only respond with encouragement and validation in 1-2 sentences.`;
|
||||||
|
|
||||||
// Try OpenAI first
|
// Try OpenAI first
|
||||||
if (process.env.OPENAI_API_KEY) {
|
if (process.env.OPENAI_API_KEY) {
|
||||||
@@ -624,16 +622,16 @@ Respond in 2-3 sentences with a follow-up question.`;
|
|||||||
|
|
||||||
if (answerLower.includes("don't know") || answerLower.includes("no idea") || answer.trim().length < 3) {
|
if (answerLower.includes("don't know") || answerLower.includes("no idea") || answer.trim().length < 3) {
|
||||||
fallbackResponse = isGerman ?
|
fallbackResponse = isGerman ?
|
||||||
"🌟 Das ist völlig in Ordnung! Nicht zu wissen bedeutet, dass wir zusammen etwas Neues entdecken können. Wenn du raten müsstest, was denkst du könnte wichtig sein?" :
|
"🌟 Das ist völlig in Ordnung! Nicht zu wissen bedeutet, dass wir zusammen etwas Neues entdecken können." :
|
||||||
"🌟 That's completely okay! Not knowing means we get to discover something new together. If you had to guess, what do you think might be important?";
|
"🌟 That's completely okay! Not knowing means we get to discover something new together.";
|
||||||
} else if (answer.length < 15) {
|
} else if (answer.length < 15) {
|
||||||
fallbackResponse = isGerman ?
|
fallbackResponse = isGerman ?
|
||||||
`💡 Interessante Überlegung zu "${answer}"! Du denkst in die richtige Richtung. Kannst du mir mehr darüber erzählen, wie das funktionieren könnte?` :
|
`💡 Interessante Überlegung zu "${answer}"! Du denkst in die richtige Richtung.` :
|
||||||
`💡 Interesting thinking about "${answer}"! You're on the right track. Can you tell me more about how that might work?`;
|
`💡 Interesting thinking about "${answer}"! You're on the right track.`;
|
||||||
} else {
|
} else {
|
||||||
fallbackResponse = isGerman ?
|
fallbackResponse = isGerman ?
|
||||||
`🎯 Ausgezeichnete Antwort! Du denkst wirklich gut über "${answer}" nach. Das zeigt, dass du das Konzept verstehst. Was denkst du passiert als nächstes?` :
|
`🎯 Ausgezeichnete Antwort! Du denkst wirklich gut über "${answer}" nach. Das zeigt, dass du das Konzept verstehst.` :
|
||||||
`🎯 Excellent answer! You're really thinking well about "${answer}". This shows you understand the concept. What do you think happens next?`;
|
`🎯 Excellent answer! You're really thinking well about "${answer}". This shows you understand the concept.`;
|
||||||
}
|
}
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
|
|||||||
Reference in New Issue
Block a user