Skip to content

feat(lti): add LTI 1.3 provider support for LMS integration#61

Open
nymulinfoinlet wants to merge 3 commits intomainfrom
feat/lti-provider
Open

feat(lti): add LTI 1.3 provider support for LMS integration#61
nymulinfoinlet wants to merge 3 commits intomainfrom
feat/lti-provider

Conversation

@nymulinfoinlet
Copy link
Copy Markdown
Contributor

Summary

  • Implements LTI 1.3 (Learning Tools Interoperability) provider so Studyield can be embedded inside Canvas, Moodle, Blackboard, and other LMS platforms
  • Uses manual OAuth2 + JWT implementation (via jsonwebtoken and jwks-rsa, both already in the project) for clean NestJS integration rather than the Express-based ltijs library
  • Includes Assignment and Grade Services (AGS) for posting quiz/exam scores back to the LMS gradebook

What's included

LTI Module (backend/src/modules/lti/)

  • lti.service.ts — Core LTI 1.3 protocol: OIDC login initiation, launch JWT verification via platform JWKS, user mapping (find-or-create by email), session token generation, AGS grade passback with client_credentials token caching
  • lti-config.service.ts — Admin platform registration: CRUD for LMS platforms, LTI context upsert linking LTI users to Studyield accounts
  • lti.controller.ts — Endpoints: POST /lti/login (OIDC initiation), POST /lti/launch (launch callback), GET /lti/keys (JWKS), POST /lti/grade (grade passback), plus admin CRUD for platforms
  • DTOsRegisterPlatformDto, PostGradeDto with class-validator decorators

Database Migration

  • lti_platforms table: stores registered LMS platform credentials (client_id, auth/token/jwks endpoints)
  • lti_contexts table: links LTI users to Studyield users with course/resource context for grade passback

Other changes

  • Registered LtiModule in app.module.ts
  • Added LTI Swagger tag in main.ts
  • Added LTI_ENABLED, LTI_KEY, LTI_SECRET to .env.example

Verification

  • npx tsc --noEmit passes with 0 errors

Test plan

  • Register a test platform via POST /api/v1/lti/platforms with Canvas/Moodle credentials
  • Verify JWKS endpoint at GET /api/v1/lti/keys returns valid JWK set
  • Test OIDC login flow from an LMS sandbox (Canvas Free-for-Teacher or Moodle sandbox)
  • Verify user is created/mapped on first LTI launch
  • Test grade passback via POST /api/v1/lti/grade after a quiz completion
  • Verify admin-only access on platform management endpoints

Closes #48

🤖 Generated with Claude Code

nymulinfoinlet and others added 3 commits April 12, 2026 17:02
Expand the quiz system from 4 to 8 question types to support deeper
assessments. New types include partial credit scoring (matching, ordering),
auto-graded code execution via code-sandbox service (coding), and
AI-evaluated long-form answers with rubric-based feedback (essay).

Closes #46

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add a new import-export module that enables students to bring in their
existing flashcard collections and export study sets for use in other tools.

- AnkiImportService: parses .apkg files (ZIP + SQLite), extracts notes
  with field separator parsing, strips HTML/media references, creates
  flashcards via existing FlashcardsService.createBulk
- AnkiExportService: generates minimal .apkg files with proper Anki
  schema (col, notes, cards tables), Basic model template, and media stub
- CsvImportService: handles CSV/TSV with auto-detected delimiters,
  quoted field parsing, header detection (Quizlet compatible)
- CsvExportService: exports study set as CSV with front, back, tags columns
- ImportExportController: four endpoints mounted on study-sets/:id
  (POST import/anki, POST import/csv, GET export/anki, GET export/csv)

Dependencies: adm-zip, better-sqlite3 (+ @types)

Closes #47

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Implement LTI 1.3 (Learning Tools Interoperability) so Studyield can be
embedded as a learning tool inside Canvas, Moodle, Blackboard, and other
LMS platforms. Uses manual OAuth2 + JWT implementation for clean NestJS
integration instead of ltijs.

- OIDC login initiation and launch callback endpoints
- JWT verification against platform JWKS
- User mapping (find-or-create by email on LTI launch)
- Assignment and Grade Services (AGS) for posting scores back to the LMS
- Admin API for registering/listing/deleting LMS platforms
- JWKS endpoint for platforms to verify tool signatures
- Database migration for lti_platforms and lti_contexts tables
- Environment variables for LTI configuration

Closes #48

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(lti): Add LTI 1.3 provider to integrate with Canvas, Moodle, and other LMS

1 participant