Publish¶
For instructors. Publishing turns an instructor notebook into a versioned assignment on the grader and produces the student notebook to distribute.
The command¶
From the grader's backend directory, or anywhere the grader command is installed:
uv run grader publish assignments/glm.py \
--server https://grader.dartbrains.org \
--offering neuroimaging/2026-fall \
--slug glm --title "GLM"
--offeringis the course slug and term,course/term. The offering must exist (an administrator creates it) and you must be one of its instructors.--slugnames the assignment inside the offering. Reuse the same slug to publish a new version.--manual qidand--hybrid qid=auto_pointsoverride the grading mode for a question.--tokenskips interactive sign-in; see Sessions and tokens for when you would need one.
Without --token, the command opens your browser for the same sign-in handshake students use.
From the web page¶
An assignment that already exists can take a corrected notebook without the command line. On Assignments, choose More, then Upload corrected notebook… (on the assignment's own page it is under More too), and pick the instructor notebook. Nothing is published yet: the panel shows the questions it found in _marks and how each is graded, what it adds, removes or changes, and a link to download the student copy it built. Publish makes it live. A notebook that is the same as what students have is reported as no change. Anything grader publish would refuse -- a solution block that is not closed, no _marks cell, a marker left in the student copy -- is refused here with the same reason.
The command is still the way to create an assignment and set its dates in one step, and to mark questions --manual or --hybrid explicitly.
What publishing does¶
- Validates the markers, strips solutions and hidden tests, and refuses to continue if any marker survives.
- Reads the marks cell and the check labels to build the question list: id, title, points, grading mode.
- Uploads the instructor notebook and the stripped student notebook to the grader.
- The grader finalizes the student notebook: it writes the assignment's identity into the PEP 723 block (server, course, term, slug, ids, version) and stores exactly those bytes as version N.
- The command downloads the finalized notebook and writes
glm_student.pynext to your source. That file is what you distribute.
The published student notebook is also served at a stable address, https://<server>/a/<course>/<term>/<slug>/student.py, and .../molab opens it in MoLab directly.
Versions¶
A version is immutable. Every submission records which version the student opened, and it is graded against that version's instructor notebook, hidden tests included, forever. Republishing creates version N+1; students who already opened version N keep working and submitting, and they see a note that a newer version exists.
Two things do not create a version: publishing identical content (the grader answers unchanged), and changing question titles, which update in place.
Removing a question in a new version does not break older copies: submissions from version N for that question are still accepted and graded.
Check it as a student before the class does¶
Staff can submit, which exists precisely so you can rehearse the thing your students will do:
-
For the full student experience -- their assignment list, deadlines enforced, student-scoped data -- turn on Preview as a student from your Student view page first (Exams). It works before the assignment opens.
-
Open the published student notebook the way your class will — from the course page, in MoLab or the browser.
- Sign in, answer one question wrongly, and submit. Read the feedback.
- Answer it correctly and submit again. Confirm the score and the attempt count.
- If the assignment reads data, ask your operator to run
grader warm-cache --check --slug <slug>first. A cold cache turns every submission into a grader failure rather than a zero.
Twenty minutes, and it catches what no amount of reading can.
Keeping the course website in step¶
If your course site shows the student notebook (DartBrains commits the file into its repository so the site's MoLab button works), republish means: run grader publish, copy the new _student.py into the site, and deploy the site. A sync-assignments command for marimo-book that does this automatically is planned.
Assignment settings¶
Settings live on the grader, not in the notebook, so they change without republishing. Edit them with Settings on the Assignments page (or on the assignment's page) or through the API:

| Setting | Meaning | Default |
|---|---|---|
due_at |
Shown to students; not enforced yet | none |
attempts_allowed |
Maximum attempts per question, or unlimited | unlimited |
grade_policy |
Which attempt counts: latest, highest, first, selected |
latest |
environments |
Which launch buttons the course site shows | ["molab"] |
log_checks |
Record Check results for the class-wide failing-check view | on |
canvas_assignment_id |
Column id for Canvas export | none |
required_datasets |
Datasets the operator pre-caches for the sandbox | none |