You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Code2C/result.php

33 lines
918 B

<?php
session_start();
$score = isset($_SESSION['score']) ? $_SESSION['score'] : 0;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quiz result</title>
<link rel="stylesheet" href="quiz.css">
</head>
<body>
<div class="result-container">
<h1>Your Quiz result</h1>
<p>Your score is: <?php echo $score; ?> / 5</p>
<?php
// Optionally, you can add some comments based on the score
if ($score == 5) {
echo "<p>Excellent! You got all answers right!</p>";
} elseif ($score >= 3) {
echo "<p>Good job! You have a solid understanding.</p>";
} else {
echo "<p>Better luck next time! Keep practicing!</p>";
}
?>
<a href="quiz.php" class="retry-button">Retry Quiz</a>
</div>
</body>
</html>