Technology-Mediated Homeschooling Information System (TMHIS)

A Primary Education (P1–P7) Learning & Governance Platform for the Ugandan Syllabus

🎓 Academic Project Context

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:

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

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:

3. Idempotent Synchronization Algorithm

🔒 Idempotency Guarantee

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.

  1. Client detects internet restoration via window.addEventListener('online').
  2. Sync lock is acquired to prevent concurrent sync races.
  3. Client sends oldest pending queue mutation to /api/sync.
  4. Server checks UUID in sync_log table:
    • If processed previously: returns stored ACK immediately.
    • If new: validates payload, verifies authorization, recalculates scores, and commits in an ACID transaction.
  5. 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

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

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 0Foundation, Architecture, PWA Shell & Error HandlingCompleted
Sprint 1Module 01: Authentication, Users and RBACCompleted
Sprint 2Module 02: Parent, Family and Learner ManagementCompleted
Sprint 3Module 03: Curriculum Management (P1–P7)Upcoming
Sprint 4Module 04: Learning Materials & Digital DeliveryUpcoming
Sprint 5Module 05: Parental Guides & Flexible SchedulingUpcoming
Sprint 6Module 06: Online & Offline Assessments & ScoringUpcoming
Sprint 7Module 07: PWA Offline Architecture & SynchronisationUpcoming
Sprint 8Module 08: Progress Tracking & DashboardsUpcoming
Sprint 9Module 09: Reporting & Compliance AnalyticsUpcoming
Sprint 10Module 10: In-App Notifications EngineUpcoming
Sprint 11Module 11: Messaging & Curriculum CircularsUpcoming
Sprint 12Module 12: Audit Trail & Technical AdministrationUpcoming
Sprint 13Module 13: Testing, Validation & Dissertation EvidenceUpcoming

Demo & Administrative Credentials

Seeded accounts for system evaluation and testing

Role Full Name Email 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