modif passer!evaluation pour chatbot
This commit is contained in:
@ -589,6 +589,8 @@ $reponses_sauvegardees = json_decode($tentative['reponses_json'] ?? '{}', true)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<!-- Chatbot IA Styles -->
|
||||||
|
<link rel="stylesheet" href="assets/css/chatbot.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<?php if ($apercu_mode): ?>
|
<?php if ($apercu_mode): ?>
|
||||||
@ -965,5 +967,46 @@ $reponses_sauvegardees = json_decode($tentative['reponses_json'] ?? '{}', true)
|
|||||||
|
|
||||||
window.addEventListener('beforeunload', handleBeforeUnload);
|
window.addEventListener('beforeunload', handleBeforeUnload);
|
||||||
</script>
|
</script>
|
||||||
|
<!-- Chatbot IA Widget -->
|
||||||
|
<div class="chat-bubble">
|
||||||
|
<button onclick="chatbot?.ouvrirChat()" class="btn-chat" id="btn-open-chat">
|
||||||
|
💬 Besoin d'aide ? <span class="help-badge"><span id="help-remaining">3</span>/3</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="modal-chat">
|
||||||
|
<div class="chat-container">
|
||||||
|
<div class="chat-header">
|
||||||
|
<h3>🤖 Assistant Mathématiques</h3>
|
||||||
|
<button class="btn-close-chat" id="btn-close-chat">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="chat-messages" id="chat-messages">
|
||||||
|
<div class="message message-assistant">
|
||||||
|
Bonjour ! 👋 Je suis là pour t'aider sur cette question.
|
||||||
|
<br><br>
|
||||||
|
Pose-moi une question et je te guiderai étape par étape, sans te donner la réponse directement. Tu as droit à <strong>3 aides</strong> par question.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="chat-input-zone">
|
||||||
|
<textarea id="chat-input" placeholder="Pose ta question ici..." rows="3"></textarea>
|
||||||
|
<button id="btn-send">📤 Envoyer</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Chatbot IA Scripts -->
|
||||||
|
<script>
|
||||||
|
// Passer les données PHP à JavaScript
|
||||||
|
const tentativeId = <?= $id_tentative ?? 'null' ?>;
|
||||||
|
const currentQuestionId = <?= isset($questions) && isset($question_actuelle) ? $questions[$question_actuelle - 1]['id_question'] : 'null' ?>;
|
||||||
|
</script>
|
||||||
|
<script src="assets/js/chatbot.js"></script>
|
||||||
|
<script>
|
||||||
|
// Initialiser le chatbot
|
||||||
|
if (tentativeId && currentQuestionId) {
|
||||||
|
window.chatbot = new ChatbotIA(tentativeId);
|
||||||
|
chatbot.currentQuestionId = currentQuestionId;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user