36459-vm/tracks/practice_submit.php
2026-05-27 14:29:58 +05:30

67 lines
1.1 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
session_start();
$selected = $_POST['answer'] ?? '';
$correct = $_POST['correct'] ?? '';
$hint = $_POST['hint'] ?? 'Try again! 💡';
$isCorrect = ($selected === $correct);
if ($isCorrect) {
$_SESSION['practice_index']++;
}
?>
<!DOCTYPE html>
<html>
<head>
<style>
body{
background:linear-gradient(135deg,#0b1020,#1e293b);
color:#fff;
font-family:sans-serif;
text-align:center;
}
.box{
margin-top:120px;
}
.btn{
margin-top:25px;
padding:12px 25px;
border:none;
border-radius:25px;
background:linear-gradient(135deg,#22c55e,#06b6d4);
cursor:pointer;
font-weight:bold;
}
</style>
</head>
<body>
<div class="box">
<?php if($isCorrect): ?>
<h2>✅ Correct! Super da 🔥</h2>
<p>Youre improving fast 🚀 Keep going!</p>
<a href="practice_track.php" class="btn">Next Question →</a>
<?php else: ?>
<h2>👍 Almost there!</h2>
<p>Small mistake... but you're learning 💡</p>
<p><b>Hint:</b> <?= htmlspecialchars($hint) ?></p>
<a href="practice_track.php" class="btn">Try Again 🔁</a>
<?php endif; ?>
</div>
</body>
</html>