🔧 CRITICAL FIX: Question progression not working

PROBLEM: Same question being asked twice instead of progressing
- Question 1 answered → AI responds → Question 1 asked again (not Question 2)

ROOT CAUSE: currentQuestionIndex not being incremented after answer
- askNextQuestion() was using same index repeatedly

SOLUTION:
- Added currentQuestionIndex++ before askNextQuestion() calls
- Fixed both success and fallback code paths
- Now properly progresses: Q1 → Answer → AI Response → Q2

FLOW NOW:
1) Fish live where? → 'in water' → AI validates → 2) Next question
NOT: 1) Fish live where? → 'in water' → AI validates → 1) Fish live where?
This commit is contained in:
root
2025-06-29 17:49:28 +02:00
parent 6a26fb7db4
commit 16bd2bc6ec
2 changed files with 5 additions and 3 deletions

View File

@@ -176,9 +176,9 @@
}, 100);
</script>
<script src="translations.js?v=20250629174500"></script>
<script src="ai-responses.js?v=20250629174500"></script>
<script src="script-new.js?v=20250629174500"></script>
<script src="translations.js?v=20250629175000"></script>
<script src="ai-responses.js?v=20250629175000"></script>
<script src="script-new.js?v=20250629175000"></script>
<!-- Inline debugging script -->
<script>

View File

@@ -507,6 +507,7 @@ class KidsAIExplorer {
// Ask next question
setTimeout(() => {
this.currentQuestionIndex++; // Move to next question
this.askNextQuestion();
}, 2000);
} else {
@@ -537,6 +538,7 @@ class KidsAIExplorer {
}, 100);
setTimeout(() => {
this.currentQuestionIndex++; // Move to next question
this.askNextQuestion();
}, 2000);
}