Overview
Schedule Management allows teachers to define when their classes meet, including start times, grace periods for late arrivals, and specific days of the week. These schedules determine whether students are marked as on-time or late when scanning their QR codes.Setting Class Times
Each class can have multiple schedules for different days of the week. Teachers specify the start time and grace period for each scheduled session.Schedule Creation
manage_schedule.php:40-56
The
ON DUPLICATE KEY UPDATE clause allows you to update existing schedules without creating duplicates. If a schedule already exists for that day, it will be updated instead of creating a new entry.Schedule Components
Day of Week
Which day the class meets (1=Sunday to 7=Saturday)
Start Time
When the class begins (HH:MM format)
Grace Period
Minutes after start time before marking late
Grace Periods
Grace periods define how many minutes after the start time a student can arrive and still be marked as on-time. After the grace period expires, students are automatically marked as late.Grace Period Configuration
manage_schedule.php:147-149
Grace Period Logic
When attendance is processed, the system compares the current time against the start time plus grace period:process_attendance.php:56-63
Grace Period Examples
| Start Time | Grace Period | On-Time Until | Late After |
|---|---|---|---|
| 9:00 AM | 5 minutes | 9:05 AM | 9:05 AM |
| 9:00 AM | 15 minutes | 9:15 AM | 9:15 AM |
| 9:00 AM | 30 minutes | 9:30 AM | 9:30 AM |
| 2:00 PM | 10 minutes | 2:10 PM | 2:10 PM |
Day-of-Week Configuration
Classes can meet on any combination of days. Each day can have its own start time and grace period, allowing flexibility for classes that meet at different times throughout the week.Day Selection
manage_schedule.php:132-140
The system uses MySQL’s
DAYOFWEEK() function which returns 1 for Sunday, 2 for Monday, etc. This matches the values in the day selection dropdown.Multiple Days Per Class
You can create multiple schedule entries for the same class: Example: MWF Class- Monday: 9:00 AM, 15-minute grace period
- Wednesday: 9:00 AM, 15-minute grace period
- Friday: 9:00 AM, 15-minute grace period
- Tuesday: 10:00 AM, 10-minute grace period
- Thursday: 2:00 PM, 10-minute grace period
Current Schedule Display
manage_schedule.php:162-179
Schedule Validation
The system validates schedules to ensure only authorized teachers can modify their class schedules.Class Ownership Check
manage_schedule.php:13-20
Schedule Retrieval Security
manage_schedule.php:66-80
Deleting Schedules
Individual schedule entries can be deleted without affecting other schedules for the same class.Schedule Deletion
manage_schedule.php:22-36
Deleting a schedule entry only removes that specific day/time combination. Other schedules for the class remain intact, and no attendance data is deleted.
Schedule and Attendance Integration
When a QR code is scanned, the system automatically checks if there’s a schedule for today to determine if attendance should be recorded.Today’s Schedule Check
process_attendance.php:30-44
Schedule-Based Status
The schedule’s start time and grace period directly control the attendance status:Before Grace Period
Current Time ≤ Start Time + Grace Period = On-Time
After Grace Period
Current Time > Start Time + Grace Period = Late
Student Schedule View
Students can view their class schedules from their dashboard, including when classes meet and the late cutoff times.Student Schedule Display
student_dashboard.php:250-259
Students see the “Late After” time, which is the start time plus grace period. This helps them understand the deadline for on-time attendance.
Best Practices
Consistent Times
Use the same start times throughout the semester to avoid confusion
Reasonable Grace
Set grace periods between 5-15 minutes to balance punctuality and flexibility
Multiple Sessions
Create separate schedules if your class meets at different times on different days
Early Setup
Configure schedules before the semester starts so students can view them
Common Schedule Patterns
Monday-Wednesday-Friday (MWF)
Create three identical schedules:- Day: 2 (Monday), Start: 9:00 AM, Grace: 15 min
- Day: 4 (Wednesday), Start: 9:00 AM, Grace: 15 min
- Day: 6 (Friday), Start: 9:00 AM, Grace: 15 min
Tuesday-Thursday (TR)
Create two identical schedules:- Day: 3 (Tuesday), Start: 10:30 AM, Grace: 10 min
- Day: 5 (Thursday), Start: 10:30 AM, Grace: 10 min
Daily Classes
Create schedules for days 2-6 (Monday through Friday):- All with the same start time and grace period
Lab Sessions
Different times for lecture vs lab:- Day: 2 (Monday), Start: 10:00 AM, Grace: 15 min (Lecture)
- Day: 4 (Wednesday), Start: 2:00 PM, Grace: 10 min (Lab)