Browser autograder

Reviewed grader specs inside the same package boundary.

Use this path for HTML, CSS, or JavaScript activities that need reviewed browser checks, governed evidence return, local preview assertions, and import into Lantern's normal package inventory.

When to use

Use a browser autograder when the reviewable check matters.

  • The learner code runs in the browser.
  • The grader specs should be reviewed with the package.
  • The app returns structured evidence through Lantern.
  • Preview assertions prove the package before import.
  • The app should enter Lantern's reviewed package inventory like any other app.

This is still one Lantern package. It is not a separate external tool, and it does not get raw LMS tokens, arbitrary outbound HTTP, or server-side code execution.

Scaffold

Start from the shipped starter.

deno task app:new /tmp/my-browser-autograder \
  --starter=browser-autograder \
  --app-id=my-autograder \
  --title="My Autograder"

If the activity does not need reviewed browser grader specs, use --starter=simple-activity instead.

my-browser-autograder/
  manifest.json
  dist/
    index.html
    app.js
  content/
    activity.json
  preview/
    fixtures.json
    tests.json
  grading/
    specs/
      checks.spec.js
  evidence/
    example-output.json

Manifest

The manifest points to the reviewed grading artifacts.

{
  "grading": {
    "mode": "browser",
    "max_score": 100
  },
  "preview": {
    "fixtures_file": "/preview/fixtures.json",
    "tests_file": "/preview/tests.json"
  },
  "authoring": {
    "kind": "browser_autograder",
    "grader_spec_files": ["/grading/specs/checks.spec.js"],
    "evidence_example_file": "/evidence/example-output.json"
  }
}
grading.mode = "browser"Lantern runs reviewed browser grading.
preview.tests_filePoints to the local preview assertion contract.
authoring.grader_spec_filesThe only reviewed grader spec source.
authoring.evidence_example_fileThe structured evidence baseline for authors and reviewers.

Files

Edit the files that define both the activity and the grading proof.

Activity files

  • manifest.json
  • content/activity.json
  • dist/index.html
  • dist/app.js
  • preview/fixtures.json
  • preview/tests.json

Autograder files

  • grading/specs/checks.spec.js
  • evidence/example-output.json

preview/tests.json is for local preview assertions. grading/specs/*.js is for reviewed browser grading. evidence/example-output.json is the structured evidence baseline.

Local loop

Validate, test preview, then inspect.

deno task app:validate /tmp/my-browser-autograder
deno task app:test-preview /tmp/my-browser-autograder
deno task app:preview /tmp/my-browser-autograder

For a richer shipped example, run the same checks against Web Checkup:

deno task app:validate examples/apps/web-checkup
deno task app:test-preview examples/apps/web-checkup

Web Checkup uses multiple reviewed grader specs: grading/specs/structure.spec.js and grading/specs/behavior.spec.js.

Import and review

The autograder enters the normal governed inventory.

deno task local:init
deno task local:bootstrap
deno task local:start

Open /admin/packages/import on the local URL printed by Wrangler and import the exact package directory you validated locally. Lantern stores an immutable snapshot, signs the reviewed runtime contract, and adds the version to admin inventory for approval and LMS setup.

What this keeps together

  • One reviewed package.
  • One governed evidence path.
  • One grading and audit boundary.
  • One import and approval flow.