Student Registration
Endpoint:register.php
Method: POST
Description: Creates a new student account and generates a unique QR code for attendance tracking.
Request Parameters
Must be set to
studentUnique student identifier. Can be any numeric format.
Student’s full name
Valid email address for account recovery
Account password (minimum 8 characters)
Password confirmation (must match password)
Registration Process
-
Validation:
- Verify passwords match
- Check if student_id already exists
-
Database Insertion:
-
QR Code Generation:
- QR data contains the student_id
- Generated using QRCode.js library
- Displayed immediately after successful registration
Response Examples
Success:- “Passwords do not match”
- “Student ID already exists”
- “Registration failed: [database error]”
The QR code contains only the student_id and is stored in the database for reference. Students use this QR code to mark their attendance.
Student Profile Management
Page:student_dashboard.php
Authentication: Required (student session)
Students can view and update their profile information through the dashboard.
View Profile Information
Database Query:Response Fields
Unique student identifier
Student’s full name
Registered email address
QR code data (typically the student_id)
Update Email Address
Endpoint:student_dashboard.php
Method: POST
Authentication: Student session required
Request Parameters
Action identifier (set to any value)
New email address
Process Flow
-
Validation:
- Check if email is already in use by another student
-
Update Database:
Response Messages
Success:Change Password
Endpoint:student_dashboard.php
Method: POST
Authentication: Student session required
Request Parameters
Action identifier (set to any value)
Current account password for verification
New password (minimum 6 characters)
Must match new_password
Validation Steps
- Password Match: Verify new_password === confirm_password
-
Current Password Verification:
-
Update Password:
Response Messages
Success:- “New passwords do not match”
- “Current password is incorrect”
QR Code Display
Page:student_dashboard.php
Section: Dashboard tab
QR Code Generation
The QR code is dynamically generated on the student dashboard using JavaScript:QR Code Data Format
Contains the student_id (e.g., “12345”)
QR code width in pixels (default: 128)
QR code height in pixels (default: 128)
Usage
- Student displays QR code on screen
- Teacher scans QR code using scanner interface
- System processes attendance based on scanned student_id
The QR code is displayed prominently in the student dashboard and can be shown to teachers during class for attendance marking.
View Class Enrollment
Query: Get student’s enrolled classResponse Fields
Unique class identifier
Name of the enrolled class
Name of the class teacher
Students can only be enrolled in one class per teacher, but can be in multiple classes from different teachers.
View Class Schedule
Query: Get schedule for enrolled classResponse Fields
Day number (1=Sunday, 7=Saturday)
Human-readable day name
Class start time (HH:MM:SS format)
Minutes after start_time before student is marked late
Displayed Information
- Class Name: From enrolled class
- Start Time: Formatted as “h:i A” (e.g., 09:00 AM)
- Late After: Calculated as start_time + grace_period minutes
View Attendance Statistics
Query: Calculate student attendance metricsResponse Fields
Total number of attendance records (check-ins)
Number of unique days with attendance
Most recent attendance date
View Attendance History
Query: Get recent attendance recordsResponse Fields
Attendance date
Check-in time
Attendance status:
on-time, late, or absentName of the class
Name of the teacher who recorded attendance