Skip to main content

BYTEGrader - JupyterHub assignment grading service

Project description

BYTEGrader

BYTE Grader is an autograding service designed for educational environments. It integrates with JupyterHub and Learning Management Systems through LTI 1.3, providing automated grading capabilities for Jupyter notebooks with support for custom test cases and modular execution environments. It's inspired of nbgrader which is great but lacks support of LMS synchronization and isolated execution environments for the autograding.

Overview

BYTEGrader consists of two main components:

  • Backend Service: A Tornado application that provides RESTful APIs for managing courses, assignments, and submissions with automated grading capabilities
  • JupyterLab Extension: A TypeScript/React frontend that extends JupyterLab with an interface for instructors and students

The system supports LTI 1.3 integration with platforms like Moodle, allowing grade synchronization and user provisioning through LTI Advantage services (Assignment and Grade Services, Names and Role Provisioning Service).

Showcase

Courses

Courses

Assignments

Assignments

Create Assignment (Step 1)

Create assignment step 1

Create Assignment (Step 2)

Create assignment step 2

Create Assignment (Step 3)

Create assignment step 3

Graded Submission

Graded submission

Key Features

Assignment Management

  • Create and manage programming assignments with multiple notebook files
  • Configure automated tests and grading criteria
  • Set due dates, late submission policies, and point allocations
  • Allow students to fetch solutions for an assignment with conditions.

Automated Grading

  • Execute student submissions in isolated environments
  • Run automated test suites with timeout and resource limits
  • Aggregate scores across multiple notebooks and test cases

LTI 1.3 Integration

  • Secure authentication via LTI launch from LMS platforms
  • Automatic course and user synchronization through NRPS
  • Grade passback to LMS via Assignment and Grade Service (AGS)
  • Support for deep linking and resource selection

Installation

Prerequisites

  • Python 3.11 or higher
  • Node.js 18 or higher
  • Database (SQLite, PostgreSQL, etc.)
  • JupyterHub

Setup

  1. Install the package
uv sync
uv pip install -e .
  1. Set up BYTEGrader configuration Please see example/bytegrader_config.py for an example configuration.

  2. Add the service to JupyterHub (managed or external)

c.JupyterHub.services = [
    {
        "name": "bytegrader",
        "api_token": "1442555d6d82d96fc8a69776f19978e442873859c6a003f7be15e61d669e2e1c", # generate via `openssl rand -hex 32`
        "url": "http://127.0.0.1:10101",
    }
]
  1. Start the service
export JUPYTERHUB_SERVICE_PREFIX="/services/bytegrader/"
export JUPYTERHUB_API_TOKEN="1442555d6d82d96fc8a69776f19978e442873859c6a003f7be15e61d669e2e1c"
export JUPYTERHUB_API_URL="http://127.0.0.1:8000/hub/api"
export JUPYTERHUB_SERVICE_NAME="bytegrader"
export JUPYTERHUB_SERVICE_URL="http://0.0.0.0:10101"
export BYTEGRADER_LOG_LEVEL="DEBUG"
bytegrader serve --config bytegrader_config.py

Docker Deployment

WIP, currently broken.

Usage

For Instructors

  1. Create a Course: Navigate to the Courses panel in JupyterLab
  2. Create Assignment Notebooks:: Notebooks must be created via the nbgrader extension. BYTE Grader is compatible with nbgrader's notebooks format.
  3. Create an Assignment: Use the assignment wizard to configure:
    • Notebook and asset files to include
    • Due dates and late policies
    • Solution policies
  4. Distribute to Students: Assignment notebooks are automatically preprocessed and distributed
  5. Review Submissions: View automated grades and provide manual feedback

For Students

  1. Access Assignments: Launch JupyterLab via LTI from your LMS
  2. Fetch Assignment: Open the assignment and get the starter notebook
  3. Complete Work: Write code in designated solution cells
  4. Submit: Click submit to send for automated grading
  5. View Results: See test results after autograding

Development

Building the Extension

jlpm build

Project Structure

bytegrader/
├── bytegrader/              # Python backend
│   ├── autograde/          # Grading queue and workers
│   ├── cli/                # Command-line interface
│   ├── config/             # Configuration system
│   ├── core/               # Core models, auth, database
│   ├── extensions/         # JupyterLab server extension
│   ├── handlers/           # Tornado request handlers
│   ├── preprocessors/      # Notebook preprocessors
│   ├── repositories/       # Data access layer
│   ├── schemas/            # Pydantic request/response schemas
│   ├── services/           # Business logic
│   └── tasks/              # Background tasks
├── src/                    # TypeScript frontend
│   ├── components/         # React components
│   ├── hooks/              # Custom React hooks
│   ├── services/           # API client
│   ├── stores/             # State management
│   └── widgets/            # JupyterLab widgets
├── docker/                 # Docker configurations
├── tests/                  # Test suite (TBD)
└── docs/                   # Documentation (TBD)

License

This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.

Acknowledgments

Developed as part of the BYTE Challenge initiative to enhance computer science education for students.

BYTE Grader builds upon the work of the nbgrader project. The core project architecture, notebook format, preprocessor patterns, and notebook manipulation strategies were inspired by nbgrader's approach. I am grateful to the nbgrader team for providing their software as open source. Without them this project would have never existed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bytegrader-0.0.4.tar.gz (3.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bytegrader-0.0.4-py3-none-any.whl (7.4 MB view details)

Uploaded Python 3

File details

Details for the file bytegrader-0.0.4.tar.gz.

File metadata

  • Download URL: bytegrader-0.0.4.tar.gz
  • Upload date:
  • Size: 3.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bytegrader-0.0.4.tar.gz
Algorithm Hash digest
SHA256 dec257a2175b4b651d5224c491b7ea1aa252f693fea48942846d294ce8364f4d
MD5 abaf84a271deae3ca8e88385ba1c051a
BLAKE2b-256 d79d020d11a2623df0c7647a9c43654ef51c619f37185d0bcb30d76f6dd7619b

See more details on using hashes here.

Provenance

The following attestation bundles were made for bytegrader-0.0.4.tar.gz:

Publisher: publish-pypi.yml on Kamuyin/bytegrader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bytegrader-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: bytegrader-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bytegrader-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6cc48c3969da23152d90ad2ef3cdf141286cbdab5449bc510df3223bf116e767
MD5 fc782081f2a513fc1458738aa76c0a69
BLAKE2b-256 3216a2911d3d9d16f309efb7da10b2058351b2fc730be2b5d7844ed9c5de652e

See more details on using hashes here.

Provenance

The following attestation bundles were made for bytegrader-0.0.4-py3-none-any.whl:

Publisher: publish-pypi.yml on Kamuyin/bytegrader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page