Teacher guide
This comprehensive guide covers all teacher features in the QR Attendance System.Getting started
Registration
Navigate to registration
From the login page, click Register, then select the Teacher Registration tab.
Fill in your details
- Teacher ID: Must follow format
Tfollowed by 4 digits (e.g.,T1234) - Full Name: Your complete name
- Email: Valid email address
- Password: Minimum 8 characters
- Confirm Password: Must match password
Teacher ID must match the pattern
T\d{4} (T followed by exactly 4 digits). Examples: T1001, T5432, T0001.Teacher dashboard
Your dashboard is the central hub for managing classes and tracking attendance.Dashboard sections
Header- Welcome message with your name
- Teacher ID and email display
- Logout button
- Profile actions: Change Password and Update Email
- Open Scanner: Launch QR code scanner for marking attendance
- Manage Classes: Create classes and manage student rosters
- Manage Schedule: Configure class times and grace periods
- Dropdown to select which class to view
- Displays “Create a class first” message if you have no classes
- Total Students: Number enrolled in selected class
- Present Today: Students with attendance marked today
- Attendance Rate: Percentage of students present today
- Shows all students in the class (including absent students via LEFT JOIN)
- Displays student ID, name, time marked, and status
- Status dropdown for manual adjustments (on-time, late, absent)
- Changes save automatically when status is changed
Managing classes
Creating a class
Enter class name
In the “Create New Class” section, enter a descriptive name (e.g., “Computer Science 101”).
Adding students to a class
You can add students individually or import them in bulk from Excel.Individual student addition
Excel import
Prepare your Excel file
Create a spreadsheet with these columns:
- Column A: Student ID
- Column B: Full Name
- Column C: Email
New students created via import receive the default password
changeme123. Advise them to change it immediately upon first login.Exporting class roster
Removing students
Deleting a class
Scheduling classes
Setting class schedule
Add schedule
- Day of Week: Select from Sunday to Saturday
- Start Time: Set class start time (e.g., 09:00)
- Grace Period: Set minutes after start time before students are marked late (default: 15)
Modifying schedules
To change a schedule:- Select the same day in the form
- Enter new start time or grace period
- Click Update Schedule
ON DUPLICATE KEY UPDATE to modify existing schedules for the same day.
Deleting schedules
Marking attendance
Using the QR scanner
Allow camera access
Grant camera permissions when your browser requests them. HTTPS is required for camera access.
The scanner uses Instascan.js library and automatically selects the first available camera on your device.
Attendance processing logic
When a QR code is scanned:- Student verification: Checks if student is enrolled in any of your classes
- Schedule verification: Confirms today matches a scheduled class day using
DAYOFWEEK(CURRENT_DATE()) - Duplicate check: Prevents marking attendance twice on the same day
- Status calculation:
- Current time ≤ (start time + grace period) → on-time
- Current time > (start time + grace period) → late
- Record creation: Inserts attendance record with calculated status
Manual attendance adjustment
From your dashboard:Only students with existing attendance records show the status dropdown. Students marked absent have no record and display a static “Absent” badge.
Managing your profile
Changing password
Updating email
To implement email updates for teachers, create
update_email.php following the same pattern as the student dashboard’s inline email update functionality (see student_dashboard.php:39-53).Best practices
Set schedules before first class
Set schedules before first class
Configure your class schedule before the first session so the system can correctly calculate on-time vs late status.
Use reasonable grace periods
Use reasonable grace periods
The default 15-minute grace period works well for most classes. Adjust based on your institution’s policies.
Import large rosters via Excel
Import large rosters via Excel
For classes with 20+ students, use Excel import instead of adding students individually.
Review daily attendance
Review daily attendance
Check the attendance table at the end of each class to mark absent students or correct any errors.
Export rosters regularly
Export rosters regularly
Keep backup copies of your class rosters by exporting to Excel periodically.
Troubleshooting
Scanner won’t open
- Ensure you’re using HTTPS (required for camera access)
- Check browser permissions - camera must be allowed
- Try a different browser (Chrome and Firefox work best)
- Verify another app isn’t using the camera
Student not found when scanning
- Verify student is enrolled in your class via Manage Classes
- Check that today matches a scheduled class day
- Ensure student is using the correct QR code
Can’t add student to class
- Student must be registered first
- Check if student is already in another of your classes
- Verify student ID is correct (case-sensitive)
Excel import failures
- Ensure PhpSpreadsheet is installed via Composer
- Check file format (.xlsx, .xls, or .csv only)
- Verify column order: Student ID, Name, Email
- Check for duplicate student IDs in your file
Next steps
Class Management
Deep dive into class management features
Schedule Management
Learn more about scheduling options
Attendance Tracking
Understand attendance tracking in detail
QR Attendance
How QR code attendance works