erreur chatbot
This commit is contained in:
@ -47,9 +47,17 @@ class ChatbotIA {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ouvrirChat() {
|
ouvrirChat() {
|
||||||
// Récupérer l'ID de la question ACTUELLE dynamiquement
|
// Utiliser la variable globale currentQuestion du formulaire
|
||||||
this.currentQuestionId = this.detectCurrentQuestion();
|
if (typeof window.currentQuestion !== 'undefined' && window.questionsIds) {
|
||||||
|
// currentQuestion est l'index (1-80), on récupère l'ID réel
|
||||||
|
const questionIndex = window.currentQuestion - 1;
|
||||||
|
this.currentQuestionId = window.questionsIds[questionIndex];
|
||||||
|
console.log('💬 Question détectée via currentQuestion:', window.currentQuestion, '→ ID:', this.currentQuestionId);
|
||||||
|
} else {
|
||||||
|
// Fallback sur la détection par classe active
|
||||||
|
this.currentQuestionId = this.detectCurrentQuestion();
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.currentQuestionId) {
|
if (!this.currentQuestionId) {
|
||||||
alert('Erreur : impossible de déterminer la question actuelle');
|
alert('Erreur : impossible de déterminer la question actuelle');
|
||||||
|
|||||||
Reference in New Issue
Block a user