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

54 lines
1.4 KiB
PHP
Raw 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();
/* ---------- AUTH CHECK ---------- */
if (!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
}
/* ---------- REQUIRED SESSION DATA ---------- */
$username = $_SESSION['username'] ?? null;
$practice_score = $_SESSION['practice_score'] ?? 0;
/* ---------- SCORE VALIDATION ---------- */
if (!isset($_SESSION['practice_attempted'])) {
header("Location: practice_track.php");
exit();
}
/* ---------- MARK PRACTICE COMPLETED ---------- */
$_SESSION['practice_done'] = true;
?>
<?php require_once 'includes/header.php'; ?>
<div class="track-complete-wrapper">
<h2>🎉 Track Completed!</h2>
<h3>Python Basics Learning Badge</h3>
<p>
Well done, <strong><?php echo htmlspecialchars($username); ?></strong>!
You have successfully completed the practice challenges in this track.
</p>
<p>
This badge recognises your learning effort and consistency.
</p>
<!-- ✅ BADGE DOWNLOAD -->
<a href="generate_badge_pdf.php" class="btn-primary">
Download Learning Badge
</a>
<div class="actions">
<a href="practice_reinforcement.php" class="btn-secondary">
Proceed to Practice Reinforcement Test
</a>
<br><br>
<a href="tracks.php">← Back to Tracks</a> |
<a href="dashboard.php">Go to Dashboard</a>
</div>
</div>