Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to lectern are documented here.
## [Unreleased]

### Added
- **`reg-exam-build` writes a per-outcome `GRADING_NOTE.md` for every Gradescope build.** The note was a one-line-per-question summary table, which left the grader to invent the Gradescope rubric. It is now the ISA work order: every question gets one rubric row per possible outcome (each MC choice, both T/F sides, each FIB blank plus a wrong-order row, and every item of an authored `Gradescope rubric` block on written questions), with the points that row carries and a stable `form·Qn·slot` key. Graders enter the rows verbatim and only choose which one applies, so points land the same way whoever grades, and `reg-gradescope-stats` reads the note directly. Graduated from the CECS 378 Su26 prototype (`build_grading_note.py`) into `lectern.grading_note`, with two fixes on the way: a code question keyed True/False no longer loses its credit to a trailing brace, and math in choices renders as `2^(n/2)` rather than `2^{n/2`. `% order: any` before a multi-blank fill drops the wrong-order row. New **`--grading-note-only`** rewrites just the note for an exam that is already printed.
- **`reg-guardcheck`: the student's half of the guard-file check.** The instructor-side check reads git history from outside the student's control and is the record; this is the notice the *student* sees, in the CI run they already look at. `stamp` records a template's expected digests to `grading/guard.sha256` (`sha256sum`-format, so `sha256sum -c` verifies it with no tooling); `check` runs as one step in the lab's own `autograde.yml` and reports what changed. ==It notifies, it never grades==: no points, no pass/fail, and it always exits 0 (`--strict` opts out) because failing a student's build over a file that does not affect their program is a bad way to open a conversation. It never invents a `result.json` either, since a result file conjured from nothing reads downstream as a zero-point run; it only records a `notices` array in one that already exists. The message is deliberately unaccusing: what changed, that it does not affect the assignment or the grade, that the instructor sees it in the history, and the `git checkout` line that restores it, plus a GitHub Actions run annotation. Stdlib-only, so a template vendors the single file as `grading/guardcheck.py` and the runner's bare `python3` runs it. Workflow snippet at `lectern/references/guardcheck.workflow.yml`. ==A student controls their own workflow, so this is a courtesy and not evidence==: the sweep is what counts.
- **Guard-file integrity: grading checks for repos that modify `AGENTS.md`.** Every lab template ships `AGENTS.md`, the high-authority AI-assistant surface, and the doctrine has always been that a student may delete it because doing so is a visible act in the git history. Nothing actually looked. The new `lectern.triage_guardfile` module compares each declared **guard file** at the grading commit against its baseline and reports `intact`, `modified`, `deleted` or `absent`, with the commits that touched it and a copy-pasteable reproduce command. Wired into all three surfaces: `reg-triage sweep` (a `guard` column in `results.csv`, a Guard column and a *Guard files* roll-up in `TRIAGE.md`), `reg-triage report` (section **A.6 Guard-file integrity**), and `reg-lab-recon` (a `guard` column in `cohort.csv`, a *Guard files* section in `FACTS.md`). Both manifests take `guard_files:`, defaulting to `["AGENTS.md"]`; an entry may be `{path, sha256}` to compare against the file **as distributed**, which is the only way to catch an edit made inside a squashed initial commit. Otherwise the baseline is the file's first appearance in that repo, and a file born modified reads as intact. ==It is a Part A fact and never a score==: `guardfile_forensics` does not register in `SIGNALS`, awards no points, and cannot move a bucket, because there are innocuous reasons to touch these files and the engine's standing rule is that no adverse finding is automated. Report schema bumped to v2; the signal set is unchanged.
- **`reg-admin-form` — campus administrative forms, filled from the vault.** Admin forms are haphazard: no dropdowns, and they still want exact course numbers, class numbers, rooms, meeting times and a coverage plan — facts the vault already holds and that are miserable to retype from memory on a sick morning. A YAML **form profile** declares one form's fields and where each value comes from (`instructor.*` from an `identity.yaml`, `leave.*`, `term.*`, `absence.*`, `classes.*`, `literal:`, or `prompt`); the engine resolves them and writes a paste-per-box `FORM.md`, a routing `EMAIL.md`, and a machine `record.yaml`. The deterministic core is the new **`class_calendar`** module: it parses both `meets` dialects (`"TuTh 11:00-12:15"` and `"TuTh 11:00 AM–12:15 PM"`, any Unicode dash, bare `T` = Tuesday, and a trailing meridiem that carries back so `3:30-4:45 PM` is not an 03:30 class), expands each section across the requested dates, and subtracts term boundaries plus the term-spec's new optional **`no-instruction`** closures — so a Thanksgiving absence doesn't bill classes that were never going to meet. Each affected meeting is annotated with the topic its syllabus *Week of* table scheduled. Leave types carry `omit:` / `defaults:` / `guidance:`, so the **personal holiday omits *justification* on purpose** — it is contractual time off, and an empty "Reason" box invites volunteering one. Ships the **CSULB Notice of Absence** profile (SSO chiclet → DocuSign) with the chair/coordinator/associate-dean routing pinned. Adding a form is a profile, not code. Fields carry an optional **`section:`** and render grouped under it in profile order — a paste-per-box product is only useful in the form's own box order, so the Notice of Absence profile mirrors DocuSign's two screens (the PowerForm signer-information gate, then the absence form) and records **Associate Dean before Department Coordinator**, as the screen actually orders them. Fields with **`choices:`** render as a tick-list with the right box marked (a checkbox is ticked, not pasted); an out-of-range value and a section split across the profile are both rejected as authoring bugs. The shipped Notice of Absence profile is **verified against a completed DocuSign envelope** — it is a *class-delivery* form under CFA CBA Art. 24.6, not a timekeeping one, so it asks for class numbers + catalog titles (new `classes.numbers-titles` source, fed by an optional `title:` on each term-spec section), a delivery-change checkbox, a reason checkbox, and the arrangements for students — no employee ID, hours, or department. Leave types map onto the form's own reason vocabulary via `defaults:`, and the profile records that DocuSign marks the free-text `Other:` box required even when a named reason is ticked. Slash command **`/timeoff`**; `reg-admin-form init` seeds the vault, `list` shows forms + leave types, `render` does the work. A fourth product, the **Obsidian record note** (`<date>-<form>.md`), carries Dataview-queryable frontmatter (`type: absence-record`, dates, hours, contact-hours, sections-affected, `status: draft`) so a semester note can list the term's absences on its own; `status` flips to `submitted` by hand, since nothing the tool can observe proves DocuSign went through.
Expand All @@ -23,9 +24,6 @@ All notable changes to lectern are documented here.
- **True/False exam questions now use stacked `(a) True / (b) False` choices** — the house standard documented in `references/reference_exam.tex` and `docs/design/exam-tex-format.md`. The previous inline `\textsc{T~/~F.}` form listed no answer options on their own lines, so Gradescope's region detection could not find them. The `\textsc{T~/~F.}` label and inline `Answer:` reveal are retained, so questions stay typed `tf` and `parse_outline_from_tex` still emits `True`/`False` in `_outline.csv` — no code change, purely an authoring-convention fix.
- **Refreshed the `examples/cecs-378-demo` worked example** to cover the current command surface. The demo exam gains a stacked-T/F section and a `gradescope: region` build (emitting `gradescope/` + `GRADING_NOTE.md`), and the README adds runnable stages for `reg-syllabus` (stamp + build), `reg-qbank` (validate + emit), `reg-exam-readinglist` (Lectern→Scriptorium seam), and `reg-gradescope-stats` (item analysis), plus a documented "requires live infrastructure" section for the Classroom / ISA-publish / triage / term-finalize verbs.

### Known gaps
- **`reg-exam-build` GRADING_NOTE.md ≠ `reg-gradescope-stats` input format.** The build emits a summary-table grading note (`| Q | Name | Pts | Type | Answer | Rubric |`); `reg-gradescope-stats` parses the richer per-question form (`#### <Form>·Q<n> · … · <TYPE>` + `| Pts | Key | Rubric item |`). The demo's gradescope-stats stage uses a hand-authored stats-compatible note; bridging the two is a tracked follow-up.

### Security
- **Vendored `slugify`, dropped the `vaultkit` dependency** — the name `vaultkit` on PyPI is an unrelated third-party SDK, so depending on it was a dependency-confusion risk. The one helper used (`slugify`) is now inlined in `lectern/_text.py`, making the public distribution self-contained with no private/ambiguous dependency.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ This is a deliberate design principle, not an accident. Proprietary LMS gradeboo

**Grade-appeal reproducibility:** a build is fully deterministic. Given the same manifest, `.tex` sources, roster, and `assign_seed`, re-running `reg-exam-build` regenerates byte-identical content. This means a disputed paper can always be reproduced from archived sources — even weeks after the exam. See [docs/design/exam-tex-format.md](docs/design/exam-tex-format.md) for the full appeals runbook.

**Gradescope products:** set `gradescope: region` or `gradescope: bubble` in the manifest to emit a `gradescope/` directory with per-form template PDFs, answer-key PDFs, and outline CSVs ready for Gradescope import. See [docs/gradescope-workflow.md](docs/gradescope-workflow.md).
**Gradescope products:** set `gradescope: region` or `gradescope: bubble` in the manifest to emit a `gradescope/` directory with per-form template PDFs, answer-key PDFs, and outline CSVs ready for Gradescope import, plus a per-outcome `GRADING_NOTE.md`: every question's Gradescope rubric items with their points, for graders to enter and apply. `--grading-note-only` refreshes just the note. See [docs/gradescope-workflow.md](docs/gradescope-workflow.md).

### Term lifecycle

Expand Down
9 changes: 9 additions & 0 deletions SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,15 @@ Produced only when `gradescope:` is `region` or `bubble`. **region** → per-for
versions) + outline; plus `gradescope_roster.csv` (Email column blank — see README
caveat; prefer LMS/LTI sync). Full details in README `### Gradescope products`.

Every Gradescope build also writes **`GRADING_NOTE.md`** next to the manifest: the
ISA work order, with **one rubric row per possible outcome** of every question
(each MC choice, both T/F sides, each FIB blank + a wrong-order row, every item of
an authored `Gradescope rubric` block on written questions), its points, and a
`form·Qn·slot` key that `reg-gradescope-stats` joins back to the evaluations
export. Graders enter the rows verbatim and only pick which applies. For an exam
already printed, `reg-exam-build exam.build.yaml --grading-note-only` rewrites just
the note.

> **How to grade the result in Gradescope** — step-by-step (region/bubble setup, A/B
> Version Sets, roster, the per-student-serial identity/appeals integration):
> `notes/gradescope-exam-workflow.md`.
Expand Down
34 changes: 29 additions & 5 deletions docs/gradescope-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ Set `gradescope: region` or `gradescope: bubble` in `exam.build.yaml`, then run
`print_layout: per-form` for the legacy per-form `<id>_combined.pdf` stacks.)*
- **`gradescope/`** — the import products covered in this document.
- **`GRADING_NOTE.md`** — the grading note (next to the manifest). One Markdown
file per exam: exam identity, the Gradescope setup steps, and a per-form
answer-key + rubric table. Gradescope imports no key or rubric, so this is the
human crib a grader works from — and it is self-contained enough to hand to a
TA/ISA who did not author the exam. See §1a.
file per exam: exam identity, the Gradescope setup steps, and for every
question **one rubric row per possible outcome**, with its points. Gradescope
imports no key or rubric, so this is the work order a grader enters and then
grades from. It is self-contained enough to hand to a TA/ISA who did not
author the exam. See §1a.

### 1a. The grading note (`GRADING_NOTE.md`)

Expand All @@ -54,7 +55,30 @@ comments authored directly above each question's `\item` in the exam `.tex`:
question number). `% rubric:` is required on `fib` and `code` questions and
optional on `mc`/`tf` (which default to "correct choice = full points, else 0").
The note collects all forms, so an A/B exam yields one note with a `## Form A` and
`## Form B` section, each a `Q · Name · Pts · Type · Answer · Rubric` table.
`## Form B` section.

**Every outcome gets a row.** Each question is a `#### <Form>·Q<n> · name · pts ·
TYPE` heading over a `| Pts | Key | Rubric item |` table. The grader enters every
row into Gradescope as a rubric item and then only decides which one applies, so a
grader who did not write the question applies points the same way, and a student
can see that every alternative was considered.

| Type | Rows |
|---|---|
| `mc` | one per choice, `(a)`…; only the `\correctchoice` carries `+N` |
| `tf` | `True` and `False`; the keyed side carries `+N` |
| `fib` | one per blank (`+N` each when the points divide evenly, else `·` and the *Scoring* caption rules), plus an `order` row for multi-blank fills unless `% order: any` precedes the question |
| `code` / written | the question's authored **Gradescope rubric** block, item for item, with its category as a `[Group]` tag (see `docs/design/exam-tex-format.md`); a code question whose answer is True/False gets the two T/F rows |

Every question also ends with a `none` row (*No answer / multiple marks*) unless
its authored rubric has its own catch-all. Credit is carried by the points: `+N`
rows credit, `0` rows do not and exist for feedback and statistics. Each row's
`form·Qn·slot` key is what `reg-gradescope-stats` joins to Gradescope's *Export
Evaluations* columns for per-distractor item analysis.

To refresh the note after editing an exam that is already printed, run
`reg-exam-build exam.build.yaml --grading-note-only`. It reads the form sources
and rewrites only `GRADING_NOTE.md`; no PDFs are rebuilt.

### Region target (fixed-template, rubric grading) — the standard

Expand Down
10 changes: 4 additions & 6 deletions examples/cecs-378-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,10 @@ reg-gradescope-stats \
counts, and flags **dead** distractors (chosen by nobody) and possible **miskeys**
(a distractor chosen more than the key).

> **Known format gap.** `reg-exam-build` emits a *summary-table* `GRADING_NOTE.md`
> (`| Q | Name | Pts | Type | Answer | Rubric |`), but `reg-gradescope-stats`
> consumes the richer *per-question* form (`#### <Form>·Q<n> · <name> · <pts> · <TYPE>`
> with `| Pts | Key | Rubric item |` tables). They do not yet match, so this stage
> uses a hand-authored stats-compatible note at `gradescope-stats/GRADING_NOTE.md`.
> Bridging the two formats is a tracked follow-up.
> **Note format.** `reg-exam-build` now emits the per-outcome `GRADING_NOTE.md`
> that `reg-gradescope-stats` reads, so the build's own note can be passed with
> `--grading-note`. This stage keeps its hand-authored note at
> `gradescope-stats/GRADING_NOTE.md` so the sample evaluation CSVs stay matched to it.

---

Expand Down
13 changes: 13 additions & 0 deletions lectern/exam_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ def _build_parser() -> argparse.ArgumentParser:
default=None,
help="(with --roster) write register CSV here (default: <stem>_serials.csv next to source)",
)
p.add_argument(
"--grading-note-only",
action="store_true",
help="(with a .yaml manifest) rewrite only GRADING_NOTE.md; no PDFs are rebuilt",
)
return p


Expand All @@ -389,6 +394,10 @@ def main(argv: list[str] | None = None) -> int:
parser.error("--roster/--combined/--register are not valid with a .yaml manifest "
"(configure them in the manifest instead)")
manifest = exam_pack.load_manifest(args.source)
if args.grading_note_only:
note = exam_pack.write_grading_note(manifest, args.source.parent)
print(f" + {note.name} (per-outcome rubric, {len(manifest.forms)} form(s))")
return 0
result = exam_pack.run(manifest, args.source.parent)
print(f" forms: {', '.join(result.forms)}")
print(f" + build/ ({result.student_pdf_count} student PDF(s))")
Expand All @@ -403,8 +412,12 @@ def main(argv: list[str] | None = None) -> int:
print(f" + {shown}")
if result.gradescope_dir:
print(f" + gradescope/ ({manifest.gradescope})")
if result.grading_note:
print(f" + {result.grading_note.name} (per-outcome rubric)")
return 0

if args.grading_note_only:
parser.error("--grading-note-only requires a .yaml manifest")
if args.combined and args.roster is None:
parser.error("--combined requires --roster")
if args.register is not None and args.roster is None:
Expand Down
Loading
Loading