connect_error) die("DB Connection failed"); /* STATUS LOGIC: Active -> last practice <= 7 days Slowing -> 8–10 days Stalled -> >10 days OR never practiced */ $sql = " SELECT lp.roll_no, MAX(pa.last_attempt_at) AS last_practice, DATEDIFF(CURDATE(), MAX(pa.last_attempt_at)) AS days_gap FROM learning_profiles lp LEFT JOIN practice_attempts pa ON pa.roll_no = lp.roll_no GROUP BY lp.roll_no ORDER BY days_gap DESC "; $result = $conn->query($sql); ?> Students | RS Learning Lab
← Back to Dashboard

Students

Learning behaviour overview (focus on consistency, not scores)
fetch_assoc()): $days = $row['days_gap']; if ($row['last_practice'] === null) { $status = "stalled"; $statusLabel = "Stalled"; } elseif ($days <= 7) { $status = "active"; $statusLabel = "Active"; } elseif ($days <= 10) { $status = "slowing"; $statusLabel = "Slowing"; } else { $status = "stalled"; $statusLabel = "Stalled"; } ?>
Roll No Last Practice Days Since Last Practice Status
close(); ?>