# 1. LMS Integration

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*

---

## 1. LMS Integration

### 1.1 Single Sign-On (SSO) Configuration
**What it does:** Configures SSO so users can sign in to the platform through their LMS identity provider.
**Sub-features:**
- SSO protocol (SAML 2.0, OIDC) per provider.
- Identity provider (IdP) metadata and entity ID.
- Attribute mapping (LMS user attributes to platform roles).
- SSO scope (all users, specific institutions, specific plans).
- available on web
- event logging (action performed)
- Audit logging of SSO configuration
**Super Admin User Journey:**
1. Open Integrations & APIs → LMS Integration → SSO.
2. Select the provider and protocol.
3. Upload the IdP metadata and map attributes.
4. Set the SSO scope.
5. Test the SSO flow and activate.
**Rules & Edge Cases:**
- An invalid IdP metadata file is rejected with the reason.
- An unmapped required attribute blocks activation until mapped.
- SSO failures fall back to the configured fallback (password login or blocked).
- A provider with SSO disabled uses password login only.

### 1.2 Grade Passback
**What it does:** Pushes assessment scores from the platform to the connected LMS gradebook.
**Sub-features:**
- Grade passback scope (assessments, quizzes, mock tests).
- Grade mapping (platform score to LMS grade scale).
- Passback trigger (on completion, on publish, scheduled).
- Passback log (what was pushed, when, result).
- available on web
- event logging (action performed)
- Audit logging of grade passback
**Super Admin User Journey:**
1. Open LMS Integration → Grade Passback.
2. Set the passback scope and grade mapping.
3. Choose the passback trigger.
4. Run a test passback and review the log.
5. Activate passback.
**Rules & Edge Cases:**
- A score with no LMS grade mapping is not pushed and is flagged.
- A passback failure is retried per the retry policy and logged.
- A grade for a student not in the LMS roster is held and flagged.
- A re-published score overwrites the previously pushed grade.

### 1.3 Roster Synchronization
**What it does:** Synchronizes enrollment (students and teachers) from the LMS to the platform.
**Sub-features:**
- Roster sync direction (LMS → platform, bidirectional).
- Sync scope (institutions, courses, sections).
- Sync frequency (real-time, scheduled, manual).
- New/changed/removed handling (add, update, deactivate).
- available on web
- event logging (action performed)
- Audit logging of roster synchronization
**Super Admin User Journey:**
1. Open LMS Integration → Roster Sync.
2. Set the sync direction, scope, and frequency.
3. Configure the new/changed/removed handling.
4. Run a test sync and review the results.
5. Activate the sync.
**Rules & Edge Cases:**
- A removed student is deactivated, not hard-deleted.
- A roster conflict (same student, different data) is resolved by the LMS as source of truth.
- A sync failure leaves the last good roster intact and is logged.
- A partial sync (some courses failed) reports per-course results.

### 1.4 Assignment Passback
**What it does:** Pushes assignments and tasks from the platform to the connected LMS.
**Sub-features:**
- Assignment passback scope (assignments, tasks, study plans).
- Assignment mapping (platform assignment to LMS assignment).
- Due-date and points mapping.
- Passback log and status.
- available on web
- event logging (action performed)
- Audit logging of assignment passback
**Super Admin User Journey:**
1. Open LMS Integration → Assignment Passback.
2. Set the passback scope and mapping.
3. Map due dates and points.
4. Run a test passback and review the log.
5. Activate passback.
**Rules & Edge Cases:**
- An assignment with no LMS mapping is not pushed and is flagged.
- A due-date conflict (platform vs LMS) is resolved by the configured source.
- A passback failure is retried and logged.
- A deleted platform assignment is removed from the LMS per the handling rule.

### 1.5 Supported LMS Providers
**What it does:** Manages the list of supported LMS providers and their connection settings.
**Sub-features:**
- Provider list (Canvas, Moodle, Blackboard, Google Classroom, custom).
- Per-provider connection settings (credentials, endpoints, scopes).
- Provider enable/disable.
- Connection test and status.
- available on web
- event logging (action performed)
- Audit logging of supported LMS providers
**Super Admin User Journey:**
1. Open LMS Integration → Providers.
2. Select a provider and enter the connection settings.
3. Run a connection test.
4. Enable the provider.
5. Verify the connection status.
**Rules & Edge Cases:**
- A provider with invalid credentials fails the connection test and stays disabled.
- A disabled provider's integrations (SSO, passback, sync) are suspended.
- A credential change requires a re-test before re-activation.
- A custom provider requires all required endpoints to be defined.
