erreur chatbot
This commit is contained in:
@ -47,9 +47,17 @@ class ChatbotIA {
|
||||
});
|
||||
}
|
||||
|
||||
ouvrirChat() {
|
||||
// Récupérer l'ID de la question ACTUELLE dynamiquement
|
||||
this.currentQuestionId = this.detectCurrentQuestion();
|
||||
ouvrirChat() {
|
||||
// Utiliser la variable globale currentQuestion du formulaire
|
||||
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) {
|
||||
alert('Erreur : impossible de déterminer la question actuelle');
|
||||
|
||||
Reference in New Issue
Block a user