getConnection(); $id_evaluation = isset($_GET['id']) ? (int)$_GET['id'] : 0; $id_tentative = isset($_GET['tentative']) ? (int)$_GET['tentative'] : 0; $nouvelle_soumission = isset($_GET['new']) && $_GET['new'] == 1; if ($id_evaluation <= 0) { die("Évaluation invalide"); } // Récupérer l'évaluation $stmt = $db->prepare("SELECT * FROM evaluations WHERE id_evaluation = ?"); $stmt->execute([$id_evaluation]); $evaluation = $stmt->fetch(PDO::FETCH_ASSOC); if (!$evaluation) { die("Évaluation introuvable"); } // Récupérer les tentatives de l'élève $stmt = $db->prepare(" SELECT * FROM tentatives_eleves WHERE id_evaluation = ? AND id_eleve = ? ORDER BY numero_tentative DESC "); $stmt->execute([$id_evaluation, $user['id']]); $tentatives = $stmt->fetchAll(PDO::FETCH_ASSOC); if (empty($tentatives)) { die("Aucune tentative trouvée"); } // Si tentative spécifique demandée if ($id_tentative > 0) { $tentative_affichee = null; foreach ($tentatives as $t) { if ($t['id_tentative'] == $id_tentative) { $tentative_affichee = $t; break; } } if (!$tentative_affichee) { die("Tentative introuvable"); } } else { // Afficher la dernière tentative terminée $tentative_affichee = null; foreach ($tentatives as $t) { if ($t['statut'] == 'terminee') { $tentative_affichee = $t; break; } } if (!$tentative_affichee) { $tentative_affichee = $tentatives[0]; } } // Récupérer les questions $stmt = $db->prepare(" SELECT * FROM questions WHERE id_evaluation = ? ORDER BY ordre "); $stmt->execute([$id_evaluation]); $questions = $stmt->fetchAll(PDO::FETCH_ASSOC); $reponses_eleve = json_decode($tentative_affichee['reponses_json'], true) ?: []; // Calculer statistiques $nb_questions_repondues = count($reponses_eleve); $note_sur_20 = ($tentative_affichee['note'] / $evaluation['note_totale']) * 20; ?> Résultats - <?= htmlspecialchars($evaluation['titre']) ?>
← Retour au tableau de bord

✓ Évaluation soumise avec succès !

Voici vos résultats

Tentative n° -

Votre note

/20
Points obtenus
/
Questions répondues
/
Durée
diff($fin); echo $duree->i . ' min ' . $duree->s . ' s'; } else { echo 'En cours'; } ?>
1): ?>

Historique de vos tentatives

Tentative n°
Voir

📝 Correction détaillée

$q): ?>
🔄 Refaire l'évaluation (Tentative /)

Vous avez utilisé toutes vos tentatives ()