Fsdss-703 Si Culun Belajar Ngent0d Malah Ketagi... ❲iPhone❳

| FR | Description | |----|-------------| | FR‑1 | Detect off‑topic navigation using a combination of URL pattern matching, keyword analysis, and machine‑learning classification (confidence threshold ≥ 0.85). | | FR‑2 | Classify content into three buckets: Allowed / Potentially Disallowed / Explicitly Disallowed (the latter block automatically). | | FR‑3 | When a “Potentially Disallowed” event occurs, display a non‑intrusive modal:
• Message: “Hey, looks like you’re heading away from the lesson. Want a quick recap or a related resource?”
• Two buttons: Refocus (takes user back to the current lesson) / Continue Anyway (records the event but lets the user proceed). | | FR‑4 | If an “Explicitly Disallowed” URL is accessed, block the navigation, show a warning, and log the attempt. | | FR‑5 | Store every guard‑trigger event in a new learning_guard_events table (user_id, session_id, timestamp, url, category, action_taken). | | FR‑6 | Provide an admin‑only analytics page with filters (date range, user group, category) and export capability (CSV). | | FR‑7 | Expose an API endpoint (GET /api/v1/guard-events) for mentors to retrieve events for their assigned learners (OAuth‑protected). | | FR‑8 | Include an opt‑out toggle in the user profile (default ON) for users who prefer no interruptions (still block explicit content). |


CREATE TABLE learning_guard_events (
    id               BIGSERIAL PRIMARY KEY,
    user_id          UUID NOT NULL REFERENCES users(id),
    session_id       UUID NOT NULL,
    occurred_at      TIMESTAMPTZ NOT NULL DEFAULT now(),
    url              TEXT NOT NULL,
    category         VARCHAR(20) NOT NULL CHECK (category IN ('potential', 'explicit')),
    action_taken     VARCHAR(20) NOT NULL CHECK (action_taken IN ('refocus', 'continue', 'blocked')),
    metadata         JSONB,
    signature        BYTEA NOT NULL
);

Signature is generated using the platform’s HMAC secret to guarantee immutability. FSDSS-703 Si Culun Belajar Ngent0d Malah Ketagi...


| Goal | Success Metric | |------|----------------| | Reduce off‑topic navigation during study sessions | < 5 % of sessions contain a “guard‑trigger” event after 30 days (down from ~15 % baseline) | | Improve completion rate of learning modules | + 7 % module‑completion rate within the first 2 months | | Enhance perceived safety and professionalism of the platform | ≥ 4.5 / 5 average rating on the “learning environment” survey question | | FR | Description | |----|-------------| | FR‑1


| # | Criteria | Pass/Fail Test | |---|----------|----------------| | AC‑1 | The guard correctly identifies a “Potentially Disallowed” URL (e.g., a social‑media site unrelated to the lesson). | Open a lesson, navigate to the URL → modal appears within 200 ms. | | AC‑2 | The guard blocks an “Explicitly Disallowed” URL (e.g., adult content domain). | Attempt navigation → page blocked, warning displayed, no external request sent. | | AC‑3 | The modal offers Refocus and Continue Anyway actions; each action logs the correct action_taken value. | Click each button in separate runs → verify DB entries. | | AC‑4 | Mentor API returns only events for learners they are assigned to and respects OAuth scopes. | Call API with mentor token → response contains only permitted rows. | | AC‑5 | Opt‑out toggle disables the modal but keeps explicit‑content blocking active. | Turn toggle off → navigate to a “Potentially Disallowed” URL → no modal, navigation proceeds; explicit URL still blocked. | | AC‑6 | Analytics page loads within 2 seconds for a 30‑day data set and correctly exports CSV. | Load page, apply date filter, export → verify file content matches UI. | | AC‑7 | All UI components meet WCAG AA contrast ratios and are keyboard‑navigable. | Run accessibility audit (axe, Lighthouse) → no violations. | | AC‑8 | System logs are immutable and can be verified via signature check. | Attempt to edit a log entry → signature validation fails. | Signature is generated using the platform’s HMAC secret