Skip to main content

ScriptMark

CI Crates.io License

Automated grading CLI for student programming assignments. Rust core, TOML test specifications, no pytest dependency.

Features

  • Custom test engine -- runs student code in subprocess, no pytest/unittest required
  • TOML-based specs -- declarative test cases with expected values, checkers, and parametrization
  • 8 built-in checkers -- exact, approx, sorted, set_eq, contains, regex, text, plus Rhai expressions and external Python checkers
  • Parallel execution -- tokio-based orchestrator grades all students concurrently
  • Sandboxed execution -- env isolation, import allowlist, resource limits (setrlimit), timeout with process kill
  • Parametrize + oracle -- auto-generate test cases with random inputs and teacher reference implementations
  • Canvas LMS integration -- pull rosters, push grades
  • Similarity detection -- style + structural code similarity scoring
  • Interactive TUI -- browse students, sessions, and similarity in the terminal
  • HTML reports -- standalone dashboard with per-student breakdowns
  • SQLite storage -- persist grading history across sessions

Installation

From source (recommended for now)

git clone https://github.com/Acture/scriptmark.git
cd scriptmark
cargo install --path crates/scriptmark-cli

From crates.io (once published)

cargo install scriptmark-cli

Requires python3 on PATH for running student Python code.

Quick Start

  1. Write a TOML test spec:
[meta]
name = "find_max"
file = "lab5.py"
function = "find_max"
language = "python"

[[cases]]
name = "basic"
args = [[3, 1, 5, 2]]
expect = 5

[[cases]]
name = "negative"
args = [[-3, -1, -5]]
expect = -1

[[cases]]
name = "random inputs"
[cases.parametrize]
count = 20
seed = 42
[cases.parametrize.args]
nums = "list(int(-100, 100), 5, 20)"
[cases.parametrize.oracle]
rhai = "nums.sort(); nums[nums.len() - 1]"
  1. Grade submissions:
scriptmark grade submissions/ -t tests/

TOML Spec Format

Each .toml file defines tests for one function/file:

Section Purpose
[meta] Target file, function, language, teacher imports
[vars] Constants injected as Python globals
[[setup]] Call functions, store results as $ref for later cases
[[cases]] Scored test cases with expect, check, or expect_error
[cases.parametrize] Auto-generate cases with random args + oracle
[lint] Optional style scoring via pylint/ruff

Checkers

Checker Usage
exact (default) expect = 42
approx expect = 3.14 with tolerance = 0.01
text Normalized multiline comparison (strips trailing whitespace + blank lines)
sorted Validates array is sorted
set_eq Unordered array comparison
contains Substring match
regex check = { regex = "^\\d+$" }
Rhai expression check = { rhai = "result > 0 && result < 100" }
Python script check = { python = "verifiers/check.py" }

CLI Commands

scriptmark grade      Run tests + summarize + display grades
scriptmark run        Run tests only, output JSON
scriptmark summarize  Re-analyze existing results
scriptmark similarity Detect code similarity between submissions
scriptmark report     Generate HTML report
scriptmark db         Database management (init, import-roster, sessions, history)
scriptmark tui        Interactive terminal UI
scriptmark roster-pull  Pull roster from Canvas LMS
scriptmark grades-push  Push grades to Canvas LMS

Architecture

8-crate Rust workspace:

scriptmark-core       Models, TOML parsing, discovery, grading, similarity
scriptmark-runner     PythonExecutor, Checker trait, orchestrator, parametrize, oracle
scriptmark-cli        clap CLI with 9 commands + HTML report template
scriptmark-db         SQLite persistence (rusqlite, bundled)
scriptmark-canvas     Canvas LMS API client (reqwest)
scriptmark-tui        ratatui terminal UI
scriptmark-py         PyO3 Python bindings (in development)

License

GPL-3.0-or-later

Release files for scriptmark 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for scriptmark 0.2.0
File
scriptmark-0.2.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
scriptmark-0.2.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
scriptmark-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details
scriptmark-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details

Total release size: 9.8 MB

Release files / scriptmark-0.2.0-cp312-cp312-win_amd64.whl

Download URL scriptmark-0.2.0-cp312-cp312-win_amd64.whl
Size 2.3 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
8422b8e8b294fd29728038753e876a6aa2d987c909f9cce3119a93e00e0d8b09
BLAKE2b-256 checksum
How to use checksums
21afc76bd369fc1428525841284ea5b0079cd959968bcaded7af0c38f11d9873
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.

Transparency log

Release files / scriptmark-0.2.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL scriptmark-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Size 2.3 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3d7db563aa921fc9ddbad9bfb2c330524ff4f1d9caf8032001593aa3c604ade7
BLAKE2b-256 checksum
How to use checksums
9c38a7caa521b92511bbebc024c7b1b4643da9f4f1acbbe5cfb552ddd0d835c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.

Transparency log

Release files / scriptmark-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl

Download URL scriptmark-0.2.0-cp312-cp312-macosx_10_12_x86_64.whl
Size 2.5 MB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
64e4e4df0e4c6d6fda7ee816b9493494788ca28a6f7e796658622a7c619cffe1
BLAKE2b-256 checksum
How to use checksums
336ab2c542db559644cb96ca0c9ec43cb12156fb7bb891ef8a3f650b99e2afd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.

Transparency log

Release files / scriptmark-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL scriptmark-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.7 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
c7ef3e08f3226a8da05ff58e2cfaabe6828f24d0dd0f14369b01aa622541a566
BLAKE2b-256 checksum
How to use checksums
b3d9d0a6f4782e9664592a9ba5574d10d8e601ceb59ff4bdf903d32af5367de4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

4 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page