Technology-Mediated Homeschooling Information System (TMHIS)
A Primary Education (P1–P7) Learning & Governance Platform for the Ugandan Syllabus
This system is designed and implemented as a Plan B Master's Research Project for the Degree of Master of Science in Information Systems (MIS) at Makerere University, Kampala, Uganda.
1. Core Research Problem & Objectives
Homeschooling and home-supported primary education across Uganda face systemic constraints:
- Curriculum Fragmentation: Need for strict alignment with the National Curriculum Development Centre (NCDC) and Ministry of Education and Sports (MoES) competency frameworks for P1 to P7.
- Parental Pedagogy Gap: Parents facilitating home learning require structured lesson guides, suggested weekly schedules, and teaching tips.
- Intermittent Connectivity: Rural and peri-urban areas require a robust Offline-First Progressive Web App (PWA) capable of functioning seamlessly during internet blackouts.
- Verification & Compliance: Curriculum officers and teachers need automated scoring, lesson tracking, and aggregate compliance analytics.
2. The Five System Stakeholders
🎒 Learner (P1–P7)
Accesses curriculum lessons, completes interactive quizzes online/offline, and views personal progress badges.
👨👩👧 Parent / Guardian
Registers learners, downloads daily lesson guides, customizes weekly schedules, and monitors child progress.
👩🏫 Supporting Teacher
Oversees assigned home cohorts, grades open-ended assignments, and enters qualitative lesson observations.
🏛️ Curriculum Officer (NCDC)
Sets up curriculum terms, approves learning materials, issues circulars, and tracks national compliance.
System Architecture
Decoupled API-First Layered Architecture with Offline-First Client Shell
Architectural Overview
┌─────────────────────────────────────────────────────────────────────────┐
│ CLIENT LAYER (PWA) │
│ │
│ ┌───────────────────────┐ ┌────────────────────────────────────────┐ │
│ │ Service Worker │ │ Application Shell │ │
│ │ (Cache Storage Assets)│ │ (Responsive Single Page App) │ │
│ └───────────────────────┘ └────────────────────────────────────────┘ │
│ │ │
│ ┌──────────────────────────────────────────────┴────────────────────┐ │
│ │ Client Storage & State Engine │ │
│ │ - IndexedDB: Cached lessons, syllabus metadata, quiz questions │ │
│ │ - Local Sync Queue: Pending offline mutations + UUID keys │ │
│ │ - Network State Monitor: Automatic reconnection & sync flush │ │
│ └──────────────────────────────────────┬────────────────────────────┘ │
└─────────────────────────────────────────┼───────────────────────────────┘
│ HTTPS JSON API (REST)
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ APPLICATION LAYER (PHP 8.2 MVC) │
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ Middleware Pipeline: Auth (Session/Bearer), RBAC, Rate Limiting │ │
│ └──────────────────────────────────┬────────────────────────────────┘ │
│ ▼ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ Controllers (Route dispatching, Input validation, JSON Responses) │ │
│ └──────────────────────────────────┬────────────────────────────────┘ │
│ ▼ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ Domain & Service Logic: │ │
│ │ - Server-Authoritative Auto-Scoring Engine │ │
│ │ - Idempotent Sync Processor (UUID de-duplication) │ │
│ │ - Parent-Child / Teacher-Learner Boundary Authorization │ │
│ │ - Curriculum Coverage & Compliance Computation │ │
│ │ - Comprehensive Audit Logger │ │
│ └──────────────────────────────────┬────────────────────────────────┘ │
│ ▼ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ Models & Data Layer (PDO Prepared Statements, ACID Transactions) │ │
│ └──────────────────────────────────┬────────────────────────────────┘ │
└─────────────────────────────────────┼───────────────────────────────────┘
▼
┌───────────────────────────────┐
│ MySQL 8.0 (InnoDB, JSON) │
└───────────────────────────────┘
Key Backend Design Patterns
- Front Controller & Dynamic Router: All requests route through
index.phpandRouter.phpwith parameter extraction. - Singleton Database Connection: Enforces strict PDO prepared statements, UTF-8 charset, and Kampala (+03:00) session timezone.
- Standard Response Formatter: Unified JSON envelopes with proper HTTP status codes.
- Layered Middleware: Enforces authentication, role barriers, and rate-limiting before requests reach business logic.
PWA Offline Mode & Sync Protocol
Ensuring uninterrupted home education during power and internet outages
1. Service Worker & Application Shell
The Service Worker (sw.js) intercepts all asset requests. It uses a Cache-First with Network Fallback strategy for UI assets (HTML, CSS, JS, fonts) and a Network-First with Offline JSON fallback for API endpoints.
2. IndexedDB Client Storage
While offline, the application stores:
- Downloaded P1–P7 lesson text, worksheets, and teacher notes.
- Assessment quizzes and questions.
- Learner answers and offline attempt progress.
- Local FIFO Synchronization Queue.
3. Idempotent Synchronization Algorithm
Every mutation performed offline receives a unique client UUID (client_transaction_uuid). If a network timeout occurs during sync and the client retries, the server recognizes the UUID and returns the previous acknowledgment without duplicate processing.
- Client detects internet restoration via
window.addEventListener('online'). - Sync lock is acquired to prevent concurrent sync races.
- Client sends oldest pending queue mutation to
/api/sync. - Server checks UUID in
sync_logtable:- If processed previously: returns stored ACK immediately.
- If new: validates payload, verifies authorization, recalculates scores, and commits in an ACID transaction.
- Client receives ACK and removes item from local IndexedDB queue.
Database Schema & Dictionary
MySQL 8.0 Relational Design with 40 Tables, Foreign Keys, and Views
| Category | Tables | Description |
|---|---|---|
| Identity & RBAC | users, roles, permissions, role_permissions, user_permissions, password_resets |
Authentication, role mappings, hashed tokens, lockout counters. |
| Stakeholders | parents, learners, teachers, curriculum_officers |
Actor profiles, phone numbers, districts, subject specialties. |
| Curriculum (P1–P7) | classes, subjects, curriculum_terms, lessons, learner_subjects |
Primary classes, subject definitions, lesson competencies. |
| Materials & Guides | learning_materials, material_versions, parental_guides, parental_guide_versions |
Educational assets, version approval workflows, parental walkthroughs. |
| Assessments | assessments, assessment_questions, assessment_options, assessment_attempts, assessment_answers, assessment_results |
Formative & summative tests, auto-scoring, rubrics, question banks. |
| Offline & Audit | devices, sync_queue, sync_log, learning_activities, notifications, messages, message_threads, audit_trail |
Sync tracking with UUID idempotency, activity logs, system audit. |
REST API Reference
Standardized JSON endpoints with role authorization
Standard Response Envelope
{
"success": true,
"data": { ... },
"message": "Operation completed successfully.",
"errors": []
}
Authentication Endpoints
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/auth/login |
Email/password sign-in with lockout protection | Public |
| POST | /api/auth/register-parent |
Parent self-registration and family initialization | Public |
| GET | /api/auth/me |
Retrieve current authenticated user and permissions | Bearer / Session |
| POST | /api/auth/logout |
Terminate session and invalidate tokens | Bearer / Session |
| POST | /api/auth/forgot-password |
Generate 1-hour single-use password reset token | Public |
| POST | /api/auth/reset-password |
Reset password using verified token | Public |
| POST | /api/auth/change-password |
Change password with old password verification | Bearer / Session |
| POST | /api/auth/update-avatar |
Upload image file (max 4MB) or set URL for user profile photo | Bearer / Session |
| POST | /api/auth/update-profile |
Update user full name and role-specific contact details | Bearer / Session |
Administration Endpoints
| Method | Endpoint | Description | Required Role |
|---|---|---|---|
| GET | /api/admin/users |
Paginated user list with full names, role badges, and status filters | administrator |
| POST | /api/admin/users |
Create teacher, officer, parent, or admin account with full name | administrator |
| GET | /api/admin/users/{id} |
Retrieve detailed user account and actor profile attributes | administrator |
| PUT | /api/admin/users/{id} |
Edit user information, status, and role profile details | administrator |
| PATCH | /api/admin/users/{id}/status |
Set user status (active, suspended, inactive) | administrator |
| POST | /api/admin/users/{id}/reset-password |
Immediately override and reset user password with audit log | administrator |
| POST | /api/admin/users/{id}/unlock |
Unlock account locked from consecutive failed login attempts | administrator |
| GET | /api/parent/classes |
List primary school classes (P1–P7) with age guidelines & subject counts | parent, admin, officer |
| GET | /api/parent/learners |
List registered home learners with class, age, and active subject counts | parent, admin, teacher |
| POST | /api/parent/learners |
Register new child, enforce duplicate guard, and auto-allocate class subjects | parent, admin |
| GET | /api/parent/learners/{id} |
Retrieve complete learner profile, enrolled subjects & weekly hours | parent (owner), admin |
| PUT | /api/parent/learners/{id} |
Update child demographics, special needs, or promote class (auto re-align subjects) | parent (owner), admin |
| PATCH | /api/parent/learners/{id}/status |
Deactivate / activate learner preserving historical progress | parent (owner), admin |
| POST | /api/parent/learners/{id}/create-login |
Generate standalone student credentials for upper primary learners (P4–P7) | parent (owner), admin |
| GET | /api/parent/profile |
Fetch parent extended homeschooling family demographics (NIN, District, Experience) | parent |
| PUT | /api/parent/profile |
Update parent homeschooling demographics and household details | parent |
Module 01: Authentication, Users & RBAC
Status: Completed & Tested
Implementation Summary
- Multi-role Login & Routing: Authenticates all 5 roles (Administrator, Curriculum Officer, Teacher, Parent, Learner) and routes to their dedicated dashboards.
- Unified Full Name & Profile Management: Direct
full_namecolumn inuserstable synchronized with actor profile tables (parents, teachers, officers, learners) and editable live from the Profile view. - Administrative User Editing & Overrides: Full administrative privileges to inspect user profiles, edit full names, emails, contact details, reset passwords immediately, and unlock locked accounts.
- Avatar & Photo Uploads: Multi-part file upload (JPG, PNG, WEBP, GIF $\le 4$MB) with server-side MIME verification and fallback to dynamic UI avatars.
- Role Badge Styling: Color-coded visual tags for distinct role recognition across user pills, dropdown headers, and tables.
- Parent Self-Registration: Transaction-safe creation of user credentials and linked parent profile.
- Security Hardening:
- Bcrypt password hashing with salt generation.
- Account lockout after 5 consecutive failed attempts (15 minutes).
- IP Rate-limiting on authentication routes.
- Single-use, 1-hour time-expiring reset tokens.
- Client SPA Route Guards: Automatically redirects authenticated users to their dashboards and shields private screens.
- Audit Trail Logging: Logs every login, logout, password change, profile update, admin user edit, admin password reset, and status alteration.
Verification & Test Suite
Run the automated test runner to verify all 19 foundation, authentication, and administrative test assertions:
php tests/test_sprint0_sprint1.php
Module 02: Parent, Family & Learner Management
Status: Completed & Tested
1. Implementation Summary
- Ugandan Primary Curriculum (NCDC P1–P7) Subjects Seeding: All 53 national standard subjects for Primary 1 through Primary 7 seeded into database with weekly hours, instruction language, and subject codes.
- Automatic Subject Allocation: When a child is registered into any class (P1–P7), all active syllabus subjects for that class are automatically enrolled in
learner_subjectsin a single database transaction. - Religious Education Customization: Supports selecting Christian Religious Education (CRE) vs. Islamic Religious Education (IRE) tracks upon enrollment.
- Duplicate Learner Guard: Strict multi-column uniqueness check on
(parent_id, full_name, date_of_birth)preventing accidental duplicate registrations while permitting same names under different families. - Special Learning Needs Accommodations: Structured capture of accommodations (extra quiz time, high-contrast visual aids, dyscalculia support) to automatically feed downstream lesson delivery and assessment timers.
- Class Level Promotion & Realignment: Promoting a child from e.g. P3 to P4 seamlessly deactivates old subjects and auto-enrolls new class subjects while preserving historical records.
- Optional Standalone Student Login: Parents can provision independent login credentials (role:
learner) for upper primary children (P4–P7) to complete quizzes and read lessons independently. - Multi-Tenant Data Isolation: Parents are strictly restricted to their own children; teachers access assigned cohorts; administrators maintain global audit oversight.
- Parent Extended Profile: Management of Ugandan National ID (NIN), District, Household Size, and Homeschooling Experience level.
- Offline Caching (PWA): Service worker shell updated to
tmhis-shell-v11ensuring learner profiles and timetables remain accessible offline.
2. Verification & Automated Test Suite
Run the Module 02 automated test runner (14/14 tests passing):
php tests/test_sprint2_learners.php
Sprint & Module Roadmap (01 – 13)
Master Development Plan sequence for TMHIS
| Sprint | Module Title | Status |
|---|---|---|
| Sprint 0 | Foundation, Architecture, PWA Shell & Error Handling | Completed |
| Sprint 1 | Module 01: Authentication, Users and RBAC | Completed |
| Sprint 2 | Module 02: Parent, Family and Learner Management | Completed |
| Sprint 3 | Module 03: Curriculum Management (P1–P7) | Upcoming |
| Sprint 4 | Module 04: Learning Materials & Digital Delivery | Upcoming |
| Sprint 5 | Module 05: Parental Guides & Flexible Scheduling | Upcoming |
| Sprint 6 | Module 06: Online & Offline Assessments & Scoring | Upcoming |
| Sprint 7 | Module 07: PWA Offline Architecture & Synchronisation | Upcoming |
| Sprint 8 | Module 08: Progress Tracking & Dashboards | Upcoming |
| Sprint 9 | Module 09: Reporting & Compliance Analytics | Upcoming |
| Sprint 10 | Module 10: In-App Notifications Engine | Upcoming |
| Sprint 11 | Module 11: Messaging & Curriculum Circulars | Upcoming |
| Sprint 12 | Module 12: Audit Trail & Technical Administration | Upcoming |
| Sprint 13 | Module 13: Testing, Validation & Dissertation Evidence | Upcoming |
Demo & Administrative Credentials
Seeded accounts for system evaluation and testing
| Role | Full Name | Password | Access Scope | |
|---|---|---|---|---|
| Administrator | System Administrator | admin@tmhis.org |
Admin@2026! |
Technical Administration, User Management, Audit Logs |
| Curriculum Officer | Dr. Grace Kiconco | officer.ncdc@tmhis.org |
Officer@2026! |
Curriculum Setup (P1–P7), Materials Review, National Compliance |
| Teacher | David Mukasa | teacher.mukasa@tmhis.org |
Teacher@2026! |
Learner Progress Oversight, Subjective Grading, Feedback |
| Parent | Sarah Namubiru | parent.namubiru@tmhis.org |
Parent@2026! |
Home Learner Management, Teaching Guides, Quiz Tracking |