# 2. Sync Management — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: sync_management.md — every feature, sub-feature, and rule covered

## Test Execution Policy

- Zero tolerance: any deviation from the documented behavior is a defect.
- Every failed test is logged with a Bug ID, the feature, the sub-feature, the expected vs actual result, and the severity; 100% of bugs are fixed before the group passes.
- 100% pass rate is required for the group to be marked complete.

## Coverage Matrix

| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 2.1 Progress Sync Configuration | Sync trigger | TC-SA-OFF-02-001 |
| 2.1 Progress Sync Configuration | Sync scope | TC-SA-OFF-02-002 |
| 2.1 Progress Sync Configuration | Sync frequency | TC-SA-OFF-02-003 |
| 2.1 Progress Sync Configuration | Sync conflict policy | TC-SA-OFF-02-004 |
| 2.1 Progress Sync Configuration | Sync priority | TC-SA-OFF-02-005 |
| 2.1 Progress Sync Configuration | Rule: auto-on-connect sync runs immediately | TC-SA-OFF-02-006 |
| 2.1 Progress Sync Configuration | Rule: a sync scope excludes unselected types | TC-SA-OFF-02-007 |
| 2.1 Progress Sync Configuration | Rule: a failed sync is retried up to the retry count | TC-SA-OFF-02-008 |
| 2.1 Progress Sync Configuration | Rule: configuration changes are audit-logged | TC-SA-OFF-02-009 |
| 2.2 Sync Queue Management | Queue visibility | TC-SA-OFF-02-010 |
| 2.2 Sync Queue Management | Queue ordering | TC-SA-OFF-02-011 |
| 2.2 Sync Queue Management | Queue retry | TC-SA-OFF-02-012 |
| 2.2 Sync Queue Management | Queue purge | TC-SA-OFF-02-013 |
| 2.2 Sync Queue Management | Queue status | TC-SA-OFF-02-014 |
| 2.2 Sync Queue Management | Queue limit | TC-SA-OFF-02-015 |
| 2.2 Sync Queue Management | Rule: an item beyond retry count is marked failed | TC-SA-OFF-02-016 |
| 2.2 Sync Queue Management | Rule: a stale item is purged | TC-SA-OFF-02-017 |
| 2.2 Sync Queue Management | Rule: a queue at the limit blocks new items | TC-SA-OFF-02-018 |
| 2.2 Sync Queue Management | Rule: a purge removes only synced or failed items | TC-SA-OFF-02-019 |
| 2.2 Sync Queue Management | Rule: queue management actions are audit-logged | TC-SA-OFF-02-020 |
| 2.3 Conflict Resolution Rules | Conflict detection | TC-SA-OFF-02-021 |
| 2.3 Conflict Resolution Rules | Resolution strategy | TC-SA-OFF-02-022 |
| 2.3 Conflict Resolution Rules | Conflict log | TC-SA-OFF-02-023 |
| 2.3 Conflict Resolution Rules | Conflict threshold | TC-SA-OFF-02-024 |
| 2.3 Conflict Resolution Rules | Manual review queue | TC-SA-OFF-02-025 |
| 2.3 Conflict Resolution Rules | Rule: a conflict is detected beyond the threshold | TC-SA-OFF-02-026 |
| 2.3 Conflict Resolution Rules | Rule: last-write-wins keeps the latest record | TC-SA-OFF-02-027 |
| 2.3 Conflict Resolution Rules | Rule: a manual review strategy holds the conflict | TC-SA-OFF-02-028 |
| 2.3 Conflict Resolution Rules | Rule: a conflict with no strategy defaults to manual review | TC-SA-OFF-02-029 |
| 2.3 Conflict Resolution Rules | Rule: rule changes apply to new conflicts only | TC-SA-OFF-02-030 |
| 2.3 Conflict Resolution Rules | Rule: rule changes are audit-logged | TC-SA-OFF-02-031 |
| 2.4 Sync Status Monitoring | Sync health dashboard | TC-SA-OFF-02-032 |
| 2.4 Sync Status Monitoring | Sync failure list | TC-SA-OFF-02-033 |
| 2.4 Sync Status Monitoring | Sync delay metrics | TC-SA-OFF-02-034 |
| 2.4 Sync Status Monitoring | Sync success rate | TC-SA-OFF-02-035 |
| 2.4 Sync Status Monitoring | Sync alerting | TC-SA-OFF-02-036 |
| 2.4 Sync Status Monitoring | Sync detail | TC-SA-OFF-02-037 |
| 2.4 Sync Status Monitoring | Rule: a success rate below threshold raises an alert | TC-SA-OFF-02-038 |
| 2.4 Sync Status Monitoring | Rule: a sync alert is raised once per breach | TC-SA-OFF-02-039 |
| 2.4 Sync Status Monitoring | Rule: monitoring data is retained for the configured window | TC-SA-OFF-02-040 |
| 2.4 Sync Status Monitoring | Rule: alerting configuration changes are audit-logged | TC-SA-OFF-02-041 |
| 2.5 Offline Quiz Sync | Offline quiz enablement | TC-SA-OFF-02-042 |
| 2.5 Offline Quiz Sync | Answer sync | TC-SA-OFF-02-043 |
| 2.5 Offline Quiz Sync | Result computation | TC-SA-OFF-02-044 |
| 2.5 Offline Quiz Sync | Anti-cheat on sync | TC-SA-OFF-02-045 |
| 2.5 Offline Quiz Sync | Quiz sync status | TC-SA-OFF-02-046 |
| 2.5 Offline Quiz Sync | Rule: an offline quiz is enabled only for toggled courses | TC-SA-OFF-02-047 |
| 2.5 Offline Quiz Sync | Rule: a result is computed after sync, not before | TC-SA-OFF-02-048 |
| 2.5 Offline Quiz Sync | Rule: a quiz failing anti-cheat is marked invalid | TC-SA-OFF-02-049 |
| 2.5 Offline Quiz Sync | Rule: a re-sync does not double-count | TC-SA-OFF-02-050 |
| 2.5 Offline Quiz Sync | Rule: configuration changes are audit-logged | TC-SA-OFF-02-051 |

### TC-SA-OFF-02-001 — Sync trigger
**Type:** Positive
**Covers:** 2.1 → Sync trigger: the condition that triggers a sync
**Preconditions:** A Super Admin account is active; the sync trigger is set to auto on connect.
**Steps:**
1. As a Super Admin, set the sync trigger to auto on connect and save.
2. As a learner, go offline, record progress, then reconnect.
3. Observe the result and verify the full behavior: the sync runs automatically on reconnect.
**Expected Result:** The sync trigger works — the sync runs on reconnect, delivered exactly as documented.
**Priority:** Critical

### TC-SA-OFF-02-002 — Sync scope
**Type:** Positive
**Covers:** 2.1 → Sync scope: the progress types synced
**Preconditions:** A Super Admin account is active; the sync scope includes video watch time and quiz results.
**Steps:**
1. As a Super Admin, set the sync scope to video watch time and quiz results and save.
2. As a learner, record video watch time and worksheet completion offline.
3. Reconnect and check what was synced.
4. Observe the result and verify the full behavior: video watch time and quiz results are synced; worksheet completion is not.
**Expected Result:** The sync scope is applied — only selected types are synced, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-003 — Sync frequency
**Type:** Positive
**Covers:** 2.1 → Sync frequency: the interval for scheduled syncs
**Preconditions:** A Super Admin account is active; the sync frequency is set to every 30 minutes.
**Steps:**
1. As a Super Admin, set the sync frequency to 30 minutes and save.
2. As a learner, record progress offline and remain online.
3. Observe the result and verify the full behavior: the sync runs at 30-minute intervals.
**Expected Result:** The sync frequency is applied — the sync runs at the configured interval, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-004 — Sync conflict policy
**Type:** Positive
**Covers:** 2.1 → Sync conflict policy: the policy for conflicting progress records
**Preconditions:** A Super Admin account is active; the conflict policy is set to last-write-wins.
**Steps:**
1. As a Super Admin, set the conflict policy to last-write-wins and save.
2. Create a conflict scenario and sync.
3. Observe the result and verify the full behavior: the most recent record is kept.
**Expected Result:** The conflict policy is applied — the last write wins, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-005 — Sync priority
**Type:** Positive
**Covers:** 2.1 → Sync priority: the priority order for syncing queued items
**Preconditions:** A Super Admin account is active; the priority order is quiz results, then video watch time.
**Steps:**
1. As a Super Admin, set the sync priority order and save.
2. Queue both a quiz result and a video watch time item.
3. Observe the result and verify the full behavior: the quiz result is synced before the video watch time.
**Expected Result:** The priority order is applied — items are synced in the configured order, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-006 — Rule: auto-on-connect sync runs immediately
**Type:** Positive
**Covers:** 2.1 → Rule: an auto-on-connect sync runs immediately when the device regains connectivity
**Preconditions:** A Super Admin account is active; the trigger is auto on connect; a learner has offline progress.
**Steps:**
1. As a learner, go offline, record progress, and reconnect.
2. Observe the result and verify the full behavior: the sync begins immediately on reconnect.
**Expected Result:** The sync is immediate — it begins as soon as connectivity is restored, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-007 — Rule: a sync scope excludes unselected types
**Type:** Negative
**Covers:** 2.1 → Rule: a sync scope excludes progress types not selected; excluded types are not synced
**Preconditions:** A Super Admin account is active; worksheet completion is not in the sync scope.
**Steps:**
1. As a learner, complete a worksheet offline.
2. Reconnect and check the sync.
3. Observe the result and verify the full behavior: the worksheet completion is not synced.
**Expected Result:** The excluded type is not synced — the scope is enforced, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-008 — Rule: a failed sync is retried up to the retry count
**Type:** Positive
**Covers:** 2.1 → Rule: a sync that fails is retried up to the configured retry count before being marked failed
**Preconditions:** A Super Admin account is active; the retry count is 3; a sync fails.
**Steps:**
1. As a learner, trigger a sync that fails.
2. Observe the result and verify the full behavior: the sync is retried up to 3 times before being marked failed.
**Expected Result:** The retry works — the sync is retried 3 times, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-009 — Rule: configuration changes are audit-logged
**Type:** Positive
**Covers:** 2.1 → Audit logging of progress sync configuration
**Preconditions:** A Super Admin account is active; the audit log is accessible.
**Steps:**
1. As a Super Admin, change the sync trigger and save.
2. Open the audit log.
3. Observe the result and verify the full behavior: the change is recorded with the actor and timestamp.
**Expected Result:** The configuration change is audit-logged — the actor and timestamp are recorded, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-010 — Queue visibility
**Type:** Positive
**Covers:** 2.2 → Queue visibility: the pending sync items visible per learner
**Preconditions:** A Super Admin account is active; a learner has pending sync items.
**Steps:**
1. As a Super Admin, open the sync queue for the learner.
2. Observe the result and verify the full behavior: the pending items are visible.
**Expected Result:** The queue is visible — the pending items are shown, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-011 — Queue ordering
**Type:** Positive
**Covers:** 2.2 → Queue ordering: the order in which queued items are processed
**Preconditions:** A Super Admin account is active; multiple items are queued.
**Steps:**
1. As a Super Admin, open the sync queue.
2. Observe the result and verify the full behavior: the items are shown in processing order.
**Expected Result:** The ordering is shown — the items are in the correct sequence, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-012 — Queue retry
**Type:** Positive
**Covers:** 2.2 → Queue retry: the retry behavior for failed sync items
**Preconditions:** A Super Admin account is active; a sync item fails.
**Steps:**
1. As a Super Admin, check the failed item's retry state.
2. Observe the result and verify the full behavior: the item is retried per the configured policy.
**Expected Result:** The retry works — the item is retried, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-013 — Queue purge
**Type:** Positive
**Covers:** 2.2 → Queue purge: the purge of stale or obsolete sync items
**Preconditions:** A Super Admin account is active; stale items exist in the queue.
**Steps:**
1. As a Super Admin, trigger a queue purge.
2. Observe the result and verify the full behavior: the stale items are removed.
**Expected Result:** The purge works — the stale items are removed, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-014 — Queue status
**Type:** Positive
**Covers:** 2.2 → Queue status: the state per queued item
**Preconditions:** A Super Admin account is active; items have various states.
**Steps:**
1. As a Super Admin, open the sync queue.
2. Observe the result and verify the full behavior: the status (pending, syncing, synced, failed) is shown per item.
**Expected Result:** The status is shown — the state per item is visible, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-015 — Queue limit
**Type:** Positive
**Covers:** 2.2 → Queue limit: the maximum number of items held in the queue
**Preconditions:** A Super Admin account is active; the queue limit is 100.
**Steps:**
1. As a Super Admin, set the queue limit to 100 and save.
2. Queue 105 items.
3. Observe the result and verify the full behavior: only 100 items are held; the excess is handled.
**Expected Result:** The queue limit is enforced — the maximum is respected, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-016 — Rule: an item beyond retry count is marked failed
**Type:** Positive
**Covers:** 2.2 → Rule: a queue item beyond the retry count is marked failed and held for review
**Preconditions:** A Super Admin account is active; an item has exceeded the retry count.
**Steps:**
1. As a Super Admin, open the sync queue.
2. Observe the result and verify the full behavior: the item is marked failed and held for review.
**Expected Result:** The item is marked failed — it is held for review, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-017 — Rule: a stale item is purged
**Type:** Positive
**Covers:** 2.2 → Rule: a queue item older than the staleness window is purged
**Preconditions:** A Super Admin account is active; an item is older than the staleness window.
**Steps:**
1. As a Super Admin, trigger a queue purge.
2. Observe the result and verify the full behavior: the stale item is purged.
**Expected Result:** The stale item is purged — it is removed from the queue, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-018 — Rule: a queue at the limit blocks new items
**Type:** Negative
**Covers:** 2.2 → Rule: a queue at the limit blocks new items from being queued
**Preconditions:** A Super Admin account is active; the queue is at the limit.
**Steps:**
1. As a learner, generate a new offline progress item.
2. Observe the result and verify the full behavior: the new item is not queued; the oldest synced items are cleared first.
**Expected Result:** The queue is managed — new items are blocked until space is freed, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-019 — Rule: a purge removes only synced or failed items
**Type:** Positive
**Covers:** 2.2 → Rule: a purge removes only items that are synced or failed; pending items are not purged
**Preconditions:** A Super Admin account is active; the queue has pending, synced, and failed items.
**Steps:**
1. As a Super Admin, trigger a queue purge.
2. Observe the result and verify the full behavior: the synced and failed items are removed; pending items remain.
**Expected Result:** The purge is selective — only synced and failed items are removed, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-020 — Rule: queue management actions are audit-logged
**Type:** Positive
**Covers:** 2.2 → Audit logging of sync queue management
**Preconditions:** A Super Admin account is active; the audit log is accessible.
**Steps:**
1. As a Super Admin, trigger a queue purge.
2. Open the audit log.
3. Observe the result and verify the full behavior: the action is recorded with the actor and timestamp.
**Expected Result:** The action is audit-logged — the actor and timestamp are recorded, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-021 — Conflict detection
**Type:** Positive
**Covers:** 2.3 → Conflict detection: the detection of conflicting progress records
**Preconditions:** A Super Admin account is active; two conflicting records exist.
**Steps:**
1. As a Super Admin, trigger a sync with conflicting records.
2. Observe the result and verify the full behavior: the conflict is detected.
**Expected Result:** The conflict is detected — it is identified, delivered exactly as documented.
**Priority:** Critical

### TC-SA-OFF-02-022 — Resolution strategy
**Type:** Positive
**Covers:** 2.3 → Resolution strategy: the strategy applied
**Preconditions:** A Super Admin account is active; the strategy is last-write-wins.
**Steps:**
1. As a Super Admin, set the resolution strategy to last-write-wins and save.
2. Trigger a conflict and sync.
3. Observe the result and verify the full behavior: the latest record is kept.
**Expected Result:** The strategy is applied — the latest record is kept, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-023 — Conflict log
**Type:** Positive
**Covers:** 2.3 → Conflict log: the log of detected conflicts and their resolution
**Preconditions:** A Super Admin account is active; conflicts have been resolved.
**Steps:**
1. As a Super Admin, open the conflict log.
2. Observe the result and verify the full behavior: the conflicts and their resolutions are listed.
**Expected Result:** The conflict log is shown — the conflicts and resolutions are visible, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-024 — Conflict threshold
**Type:** Positive
**Covers:** 2.3 → Conflict threshold: the threshold that triggers a conflict
**Preconditions:** A Super Admin account is active; the threshold is set to a 5-minute time delta.
**Steps:**
1. As a Super Admin, set the conflict threshold to 5 minutes and save.
2. Create records with a 10-minute delta and sync.
3. Observe the result and verify the full behavior: a conflict is triggered.
**Expected Result:** The threshold is applied — the conflict is triggered beyond the threshold, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-025 — Manual review queue
**Type:** Positive
**Covers:** 2.3 → Manual review queue: the queue of conflicts requiring manual resolution
**Preconditions:** A Super Admin account is active; a conflict requires manual review.
**Steps:**
1. As a Super Admin, open the manual review queue.
2. Observe the result and verify the full behavior: the conflict is listed for manual resolution.
**Expected Result:** The review queue is shown — the conflict is listed, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-026 — Rule: a conflict is detected beyond the threshold
**Type:** Positive
**Covers:** 2.3 → Rule: a conflict is detected when two records differ beyond the threshold
**Preconditions:** A Super Admin account is active; the threshold is 5 minutes; records differ by 10 minutes.
**Steps:**
1. As a Super Admin, trigger a sync.
2. Observe the result and verify the full behavior: the conflict is detected.
**Expected Result:** The conflict is detected — the threshold is exceeded, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-027 — Rule: last-write-wins keeps the latest record
**Type:** Positive
**Covers:** 2.3 → Rule: a last-write-wins resolution keeps the record with the latest timestamp
**Preconditions:** A Super Admin account is active; two records exist with different timestamps.
**Steps:**
1. As a Super Admin, resolve the conflict with last-write-wins.
2. Observe the result and verify the full behavior: the record with the latest timestamp is kept.
**Expected Result:** The latest record is kept — the strategy is applied, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-028 — Rule: a manual review strategy holds the conflict
**Type:** Positive
**Covers:** 2.3 → Rule: a manual review strategy holds the conflict in the review queue until resolved
**Preconditions:** A Super Admin account is active; the strategy is manual review.
**Steps:**
1. As a Super Admin, trigger a conflict with the manual review strategy.
2. Observe the result and verify the full behavior: the conflict is held in the review queue.
**Expected Result:** The conflict is held — it is in the review queue, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-029 — Rule: a conflict with no strategy defaults to manual review
**Type:** Positive
**Covers:** 2.3 → Rule: a conflict with no resolvable strategy defaults to manual review
**Preconditions:** A Super Admin account is active; a conflict has no configured strategy.
**Steps:**
1. As a Super Admin, trigger the conflict.
2. Observe the result and verify the full behavior: the conflict is routed to manual review.
**Expected Result:** The conflict is routed to manual review — the default is applied, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-030 — Rule: rule changes apply to new conflicts only
**Type:** Positive
**Covers:** 2.3 → Rule: rule changes apply to new conflicts; already-resolved conflicts are not re-evaluated
**Preconditions:** A Super Admin account is active; a conflict is resolved; the rule is then changed.
**Steps:**
1. As a Super Admin, change the resolution strategy.
2. Check the already-resolved conflict.
3. Observe the result and verify the full behavior: the resolved conflict is unchanged.
**Expected Result:** The resolved conflict is unchanged — the rule change is not retroactive, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-031 — Rule: rule changes are audit-logged
**Type:** Positive
**Covers:** 2.3 → Audit logging of conflict resolution rules
**Preconditions:** A Super Admin account is active; the audit log is accessible.
**Steps:**
1. As a Super Admin, change the conflict threshold and save.
2. Open the audit log.
3. Observe the result and verify the full behavior: the change is recorded with the actor and timestamp.
**Expected Result:** The rule change is audit-logged — the actor and timestamp are recorded, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-032 — Sync health dashboard
**Type:** Positive
**Covers:** 2.4 → Sync health dashboard: the overall sync health across learners
**Preconditions:** A Super Admin account is active; sync data exists.
**Steps:**
1. As a Super Admin, open the sync health dashboard.
2. Observe the result and verify the full behavior: the overall sync health is shown.
**Expected Result:** The dashboard is shown — the sync health is visible, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-033 — Sync failure list
**Type:** Positive
**Covers:** 2.4 → Sync failure list: the learners with failed syncs
**Preconditions:** A Super Admin account is active; some learners have failed syncs.
**Steps:**
1. As a Super Admin, open the sync failure list.
2. Observe the result and verify the full behavior: the learners with failed syncs are listed.
**Expected Result:** The failure list is shown — the learners are listed, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-034 — Sync delay metrics
**Type:** Positive
**Covers:** 2.4 → Sync delay metrics: the time from offline action to synced state
**Preconditions:** A Super Admin account is active; sync data exists.
**Steps:**
1. As a Super Admin, open the sync delay metrics.
2. Observe the result and verify the full behavior: the delay from offline action to synced state is shown.
**Expected Result:** The delay metrics are shown — the time is visible, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-035 — Sync success rate
**Type:** Positive
**Covers:** 2.4 → Sync success rate: the share of syncs that succeed
**Preconditions:** A Super Admin account is active; sync data exists.
**Steps:**
1. As a Super Admin, open the sync success rate view.
2. Observe the result and verify the full behavior: the success rate is shown.
**Expected Result:** The success rate is shown — the percentage is visible, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-036 — Sync alerting
**Type:** Positive
**Covers:** 2.4 → Sync alerting: alerts on sync failure spikes
**Preconditions:** A Super Admin account is active; the alert threshold is set.
**Steps:**
1. As a Super Admin, configure the sync alerting threshold and save.
2. Trigger a sync failure spike.
3. Observe the result and verify the full behavior: an alert is raised.
**Expected Result:** The alerting works — the alert is raised on the spike, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-037 — Sync detail
**Type:** Positive
**Covers:** 2.4 → Sync detail: the sync state per learner and device
**Preconditions:** A Super Admin account is active; a learner has sync data.
**Steps:**
1. As a Super Admin, open a learner's sync detail.
2. Observe the result and verify the full behavior: the per-item sync state is shown.
**Expected Result:** The sync detail is shown — the per-item state is visible, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-038 — Rule: a success rate below threshold raises an alert
**Type:** Positive
**Covers:** 2.4 → Rule: a sync success rate below the alert threshold raises an alert
**Preconditions:** A Super Admin account is active; the threshold is 95%; the success rate drops to 90%.
**Steps:**
1. As a Super Admin, check the alert state.
2. Observe the result and verify the full behavior: an alert is raised.
**Expected Result:** The alert is raised — the threshold breach is detected, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-039 — Rule: a sync alert is raised once per breach
**Type:** Positive
**Covers:** 2.4 → Rule: a sync alert is raised once per threshold breach, not repeatedly per item
**Preconditions:** A Super Admin account is active; a threshold breach occurs.
**Steps:**
1. As a Super Admin, observe the alerts during the breach.
2. Observe the result and verify the full behavior: a single alert is raised for the breach.
**Expected Result:** The alert is single — it is not repeated per item, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-040 — Rule: monitoring data is retained for the configured window
**Type:** Positive
**Covers:** 2.4 → Rule: monitoring data is retained for the configured retention window
**Preconditions:** A Super Admin account is active; the retention window is 30 days.
**Steps:**
1. As a Super Admin, check monitoring data older than 30 days.
2. Observe the result and verify the full behavior: data older than 30 days is not available.
**Expected Result:** The retention is enforced — old data is not available, delivered exactly as documented.
**Priority:** Low

### TC-SA-OFF-02-041 — Rule: alerting configuration changes are audit-logged
**Type:** Positive
**Covers:** 2.4 → Audit logging of sync status monitoring
**Preconditions:** A Super Admin account is active; the audit log is accessible.
**Steps:**
1. As a Super Admin, change the alerting threshold and save.
2. Open the audit log.
3. Observe the result and verify the full behavior: the change is recorded with the actor and timestamp.
**Expected Result:** The change is audit-logged — the actor and timestamp are recorded, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-042 — Offline quiz enablement
**Type:** Positive
**Covers:** 2.5 → Offline quiz enablement: offline quiz taking toggled on or off per course
**Preconditions:** A Super Admin account is active; a course exists.
**Steps:**
1. As a Super Admin, enable offline quiz taking for the course and save.
2. As a learner, check the quiz options offline.
3. Observe the result and verify the full behavior: the quiz is available offline.
**Expected Result:** The enablement works — the quiz is available offline, delivered exactly as documented.
**Priority:** Critical

### TC-SA-OFF-02-043 — Answer sync
**Type:** Positive
**Covers:** 2.5 → Answer sync: the sync of quiz answers on reconnect
**Preconditions:** A Super Admin account is active; a learner completes a quiz offline.
**Steps:**
1. As a learner, complete a quiz offline and reconnect.
2. Observe the result and verify the full behavior: the quiz answers are synced.
**Expected Result:** The answer sync works — the answers are synced on reconnect, delivered exactly as documented.
**Priority:** Critical

### TC-SA-OFF-02-044 — Result computation
**Type:** Positive
**Covers:** 2.5 → Result computation: the computation of quiz results after sync
**Preconditions:** A Super Admin account is active; a quiz is synced.
**Steps:**
1. As a learner, sync a completed quiz.
2. Check the quiz result.
3. Observe the result and verify the full behavior: the result is computed after the sync.
**Expected Result:** The result is computed — it is available after sync, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-045 — Anti-cheat on sync
**Type:** Positive
**Covers:** 2.5 → Anti-cheat on sync: the validation of offline quiz integrity on sync
**Preconditions:** A Super Admin account is active; anti-cheat is enabled; a quiz has integrity issues.
**Steps:**
1. As a learner, sync a quiz with integrity issues.
2. Observe the result and verify the full behavior: the quiz is flagged for anti-cheat failure.
**Expected Result:** The anti-cheat works — the integrity issue is detected, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-046 — Quiz sync status
**Type:** Positive
**Covers:** 2.5 → Quiz sync status: the sync state per offline quiz attempt
**Preconditions:** A Super Admin account is active; quiz attempts have various sync states.
**Steps:**
1. As a Super Admin, open the quiz sync status view.
2. Observe the result and verify the full behavior: the sync state is shown per attempt.
**Expected Result:** The status is shown — the state per attempt is visible, delivered exactly as documented.
**Priority:** Medium

### TC-SA-OFF-02-047 — Rule: an offline quiz is enabled only for toggled courses
**Type:** Negative
**Covers:** 2.5 → Rule: an offline quiz is enabled only for courses where it is toggled on
**Preconditions:** A Super Admin account is active; offline quiz is disabled for a course.
**Steps:**
1. As a learner, check the quiz options offline for that course.
2. Observe the result and verify the full behavior: no offline quiz option is shown.
**Expected Result:** No offline quiz is shown — the enablement is enforced, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-048 — Rule: a result is computed after sync, not before
**Type:** Positive
**Covers:** 2.5 → Rule: a quiz result is computed after the answers are synced, not before
**Preconditions:** A Super Admin account is active; a quiz is completed offline but not yet synced.
**Steps:**
1. As a learner, check the quiz result before syncing.
2. Observe the result and verify the full behavior: no result is available before sync.
**Expected Result:** No result is available — it is computed only after sync, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-049 — Rule: a quiz failing anti-cheat is marked invalid
**Type:** Negative
**Covers:** 2.5 → Rule: an offline quiz that fails anti-cheat validation on sync is marked invalid
**Preconditions:** A Super Admin account is active; a quiz fails anti-cheat on sync.
**Steps:**
1. As a Super Admin, check the quiz state after sync.
2. Observe the result and verify the full behavior: the quiz is marked invalid.
**Expected Result:** The quiz is marked invalid — the anti-cheat failure is enforced, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-050 — Rule: a re-sync does not double-count
**Type:** Positive
**Covers:** 2.5 → Rule: an offline quiz attempt has a single sync; a re-sync does not double-count
**Preconditions:** A Super Admin account is active; a quiz is synced successfully.
**Steps:**
1. As a learner, trigger a re-sync of the same quiz.
2. Check the quiz result.
3. Observe the result and verify the full behavior: the result is unchanged; no double-counting.
**Expected Result:** No double-counting — the result is unchanged, delivered exactly as documented.
**Priority:** High

### TC-SA-OFF-02-051 — Rule: configuration changes are audit-logged
**Type:** Positive
**Covers:** 2.5 → Audit logging of offline quiz sync
**Preconditions:** A Super Admin account is active; the audit log is accessible.
**Steps:**
1. As a Super Admin, enable offline quiz for a course and save.
2. Open the audit log.
3. Observe the result and verify the full behavior: the change is recorded with the actor and timestamp.
**Expected Result:** The change is audit-logged — the actor and timestamp are recorded, delivered exactly as documented.
**Priority:** High
