🔧 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:
@@ -176,9 +176,9 @@
|
|||||||
}, 100);
|
}, 100);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="translations.js?v=20250629174500"></script>
|
<script src="translations.js?v=20250629175000"></script>
|
||||||
<script src="ai-responses.js?v=20250629174500"></script>
|
<script src="ai-responses.js?v=20250629175000"></script>
|
||||||
<script src="script-new.js?v=20250629174500"></script>
|
<script src="script-new.js?v=20250629175000"></script>
|
||||||
|
|
||||||
<!-- Inline debugging script -->
|
<!-- Inline debugging script -->
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -507,6 +507,7 @@ class KidsAIExplorer {
|
|||||||
|
|
||||||
// Ask next question
|
// Ask next question
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
this.currentQuestionIndex++; // Move to next question
|
||||||
this.askNextQuestion();
|
this.askNextQuestion();
|
||||||
}, 2000);
|
}, 2000);
|
||||||
} else {
|
} else {
|
||||||
@@ -537,6 +538,7 @@ class KidsAIExplorer {
|
|||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
this.currentQuestionIndex++; // Move to next question
|
||||||
this.askNextQuestion();
|
this.askNextQuestion();
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user