Gradescope Setup
Configure your Gradescope course to work with the submitter.
Step 1: Create a Gradescope Course
- Log into Gradescope
- Click "Create Course"
- Fill in course details:
- Course name
- School
- Term
- Note your Course ID from the URL:
https://www.gradescope.com/courses/1106756
^^^^^^^
This is your COURSE_IDStep 2: Create Programming Assignments
For each assignment students will submit:
- Go to Assignments → Create Assignment
- Select "Programming Assignment"
- Configure the autograder:
- Upload your autograder zip file
- Set the programming language to Python
- Configure test cases
- Note the Assignment ID from the URL:
https://www.gradescope.com/courses/1106756/assignments/6617143
^^^^^^^
This is your asg_idAutograder Setup
Basic Autograder Structure
Your autograder zip should contain:
autograder/
├── setup.sh # Install dependencies
├── run_autograder # Main grading script
└── tests/ # Test filesExample run_autograder
bash
#!/usr/bin/env bash
cd /autograder/source
# Run tests and output results
python3 -m pytest tests/ --json-report --json-report-file=/autograder/results/results.json
# Or use the Gradescope Python library
python3 run_tests.pyExample Python Test
python
import unittest
from gradescope_utils.autograder_utils.decorators import weight
class TestCalculateTotal(unittest.TestCase):
@weight(10)
def test_basic(self):
"""Test with simple list"""
from submission import calculate_total
result = calculate_total([10.0, 5.0, 3.0])
self.assertEqual(result, 18.0)
@weight(10)
def test_empty(self):
"""Test with empty list"""
from submission import calculate_total
result = calculate_total([])
self.assertEqual(result, 0)Step 3: Get Your Credentials
You need two values from Gradescope:
Authenticity Token
- Go to any assignment submission page
- Open Developer Tools (F12)
- Look for
authenticity_tokenin the page source or form data
Session Cookie
- In Developer Tools, go to Application → Cookies
- Find cookies for
gradescope.com - Copy the entire cookie string, or specifically:
_gradescope_sessionsigned_token(if present)
Step 4: Add Students
Manual Enrollment
- Go to Roster in your course
- Click Add Students
- Enter student emails
CSV Import
Upload a CSV with columns:
emailname(optional)student_id(optional)
LTI Sync
If using D2L integration, students are automatically enrolled when they first access an assignment.
Assignment URL Parameters
When embedding the code editor, use these URL parameters:
| Parameter | Required | Description | Example |
|---|---|---|---|
asg_id | Yes | Gradescope assignment ID | 6617143 |
file_name | No | Filename for submission | program.py |
starter | No | Starter code template file | lab1_starter.py |
email | No | Pre-fill student email | student@school.edu |
stud_id | No | Student ID | 900123456 |
Example Embed URL
https://your-server.com/codemirror-demo.html?asg_id=6617143&file_name=lab1.py&starter=lab1_starter.pyNext Steps
- D2L Integration — Connect to D2L Brightspace
- Creating Assignments — Detailed assignment setup