Skip to content

D2L Brightspace Integration ​

Connect the Gradescope Submitter to D2L Brightspace using LTI 1.3.

Prerequisites ​

  • D2L Administrator access (or work with your admin)
  • Your server running with HTTPS
  • Server domain name

Step 1: Register LTI Tool in D2L ​

INFO

This requires D2L Administrator access. Contact your institution's D2L admin if needed.

  1. In D2L, go to Admin Tools → Manage Extensibility
  2. Click LTI Advantage → Register Tool
  3. Enter the following configuration:
FieldValue
NameGradescope Code Submitter
Domainyour-server-domain.com
Redirect URLshttps://your-server-domain.com/lti/launch
Target Link URIhttps://your-server-domain.com/codemirror-demo.html
OpenID Connect Login URLhttps://your-server-domain.com/lti/login
Keyset URLhttps://your-server-domain.com/.well-known/jwks.json
  1. After registration, copy:
    • Client ID → Put in .env as LTI_CLIENT_ID
    • Deployment ID → Put in .env as LTI_DEPLOYMENT_ID
  1. In your D2L course, go to Content
  2. Create a new External Learning Tool link
  3. Select your registered LTI tool
  4. Add custom parameters for the assignment:
asg_id=YOUR_GRADESCOPE_ASSIGNMENT_ID
file_name=program.py

Step 3: Add to Quiz ​

Option A: Iframe Embed ​

  1. Create or edit a Quiz in D2L
  2. Add a Written Response question
  3. In the question text, switch to HTML mode and add:
html
<iframe 
  src="https://your-server-domain.com/codemirror-demo.html?asg_id=ASSIGNMENT_ID&file_name=program.py" 
  width="100%" 
  height="600px" 
  frameborder="0"
  allow="clipboard-read; clipboard-write">
</iframe>

Replace:

  • your-server-domain.com with your actual server URL
  • ASSIGNMENT_ID with the Gradescope assignment ID
  1. In the quiz, add an External Tool question type
  2. Select your registered LTI tool
  3. Configure custom parameters

LTI Data Flow ​

D2L Quiz → LTI Launch Request → /lti/launch endpoint
    ↓
Validate LTI payload (signature, claims)
    ↓
Extract student info (email, name, ID)
    ↓
Check for existing Gradescope session
    ↓
Redirect to code editor with context

Custom Parameters ​

Pass assignment-specific data via LTI custom parameters:

ParameterDescription
asg_idGradescope assignment ID
file_nameSubmission filename (default: program.py)
starterStarter code template file

Troubleshooting ​

"Invalid LTI launch" ​

  • Verify LTI_CLIENT_ID and LTI_DEPLOYMENT_ID match D2L registration
  • Check server logs for specific validation errors
  • Ensure HTTPS is properly configured

Iframe not loading ​

  • D2L requires HTTPS for iframe embedding
  • Check X-Frame-Options headers on your server
  • Verify D2L whitelist includes your domain

Student not recognized ​

  • LTI passes student email from D2L
  • Ensure student is enrolled in Gradescope course
  • Check that emails match between systems

Security Considerations ​

  1. LTI signatures — All launches are cryptographically signed
  2. State tokens — Prevent CSRF attacks in auth flow
  3. Session isolation — Each student has separate credentials
  4. HTTPS required — All communication is encrypted

Next Steps ​

Released under the MIT License.