Teacher Registration
Endpoint:register.php
Method: POST
Description: Creates a new teacher account with a unique teacher ID.
Request Parameters
Must be set to
teacherTeacher identifier in format
T\d{4} (e.g., T1234, T5678)Teacher’s full name
Valid email address for account management
Account password (minimum 8 characters)
Password confirmation (must match password)
Teacher ID Format
Pattern:^T\d{4}$
Valid Examples:
- T0001
- T1234
- T9999
- 1234 (missing ‘T’ prefix)
- T123 (only 3 digits)
- T12345 (too many digits)
- t1234 (lowercase)
Validation Process
-
Password Match:
-
Teacher ID Format:
-
Uniqueness Check:
Database Insertion
Response Messages
Success:- “Passwords do not match”
- “Teacher ID must be in format T followed by 4 digits (e.g., T1234)”
- “Teacher ID already exists”
- “Registration failed: [database error]”
Teacher Profile Management
Page:teacher_dashboard.php
Authentication: Required (teacher session)
View Profile Information
Session Data:Response Fields
Unique teacher identifier (format: T\d)
Teacher’s full name
Registered email address
Update Email Address
Intended Endpoint:update_email.php (not implemented)
Method: POST
Authentication: Teacher session required
Expected Implementation
To implement this feature, createupdate_email.php with the following functionality:
Request Parameters:
New email address
Current password for verification
-
Password Verification:
-
Email Uniqueness Check:
-
Update Database:
Students can update their email through
student_dashboard.php (inline processing). Reference that implementation for consistency.Change Password
Endpoint:update_password.php
Method: POST
Authentication: Teacher session required
Request Parameters
Current account password
New password (minimum 8 characters)
Must match new_password
Validation Steps
-
Password Match:
-
Current Password Verification:
-
Update Password:
Response Messages
Success:- “Passwords do not match”
- “Current password is incorrect”
- “Password must be at least 8 characters long”
Password changes require verification of the current password to prevent unauthorized modifications.
View Teacher’s Classes
Query: Retrieve all classes owned by the teacherResponse Fields
Unique class identifier
Owner teacher’s ID
Class name
Usage
Displayed in teacher dashboard for class selection:Class Ownership Verification
Purpose: Ensure teachers can only access their own classesVerification Query
?- Class ID being accessed?- Logged-in teacher’s ID
Implementation
View Class Statistics
Queries: Get attendance metrics for a specific classTotal Students in Class
Present Today
Attendance Rate Calculation
Response Fields
Total number of students enrolled in the class
Number of students present today
Percentage of students present (0-100)
View Today’s Attendance
Query: Get attendance records for all students in classResponse Fields
Student identifier
Student’s full name
Attendance record ID (null if absent)
Check-in time (null if absent)
Attendance status:
on-time, late, or absentUpdate Attendance Status
Endpoint:teacher_dashboard.php
Method: POST
Description: Allows teachers to manually modify attendance status
Request Parameters
Action identifier (set to “1”)
ID of the attendance record to update
New status:
on-time, late, or absentVerification Process
-
Ownership Check:
-
Update Status:
Response Messages
Success:Teachers can only modify attendance records for classes they own. The system verifies ownership before allowing any updates.