Skip to content

Add ScalaTest pipeline, corrector summary, and PDF improvements#6

Open
pmudry wants to merge 2 commits into
mainfrom
feat/scala-test-pipeline-and-pdf-improvements
Open

Add ScalaTest pipeline, corrector summary, and PDF improvements#6
pmudry wants to merge 2 commits into
mainfrom
feat/scala-test-pipeline-and-pdf-improvements

Conversation

@pmudry
Copy link
Copy Markdown
Contributor

@pmudry pmudry commented May 26, 2026

Summary

  • New scripts/run_tests.py: compiles reference solutions + ScalaTest suites once, then for each student × question compiles their code (with package renaming and embedded test-class stripping) and runs the matching suite in parallel; results in test_results.json
  • New scripts/generate_summary.py: produces a corrector summary as a Markdown table and a colour-coded Typst/PDF from test_results.json
  • PDF template improvements: fix duplicate question title, student code always starts on a new page, Source Sans 3 font for question text, test-result badge (✓/~/✗/⚠) per question, en-dash in title, no fancy line, no logo
  • generate_pdfs_typst.py: new --test-results flag, overwrite-safe output, Answer.test_results optional field
  • Docs & hygiene: docs/WORKFLOW.md end-to-end guide with agent prompts; exams/exam_template.yaml generic structure template; .gitignore extended to exclude all student-data artefacts (pdf/, pregrade/, *.tar, test_results.json, summary.*, labo_test_*.yaml)

Test plan

  • uv run python scripts/generate_pdfs_typst.py -i EXAM.yaml -o pdf/ produces PDFs without errors
  • uv run python scripts/run_tests.py -i EXAM.yaml -o test_results.json -j 4 completes and writes valid JSON
  • uv run python scripts/generate_pdfs_typst.py -i EXAM.yaml -o pdf/ --test-results test_results.json injects test badges into PDFs
  • uv run python scripts/generate_summary.py -i EXAM.yaml -r test_results.json -o summary writes summary.md and summary.pdf
  • No student data files appear in git status after running the full pipeline

🤖 Generated with Claude Code

pmudry and others added 2 commits May 26, 2026 14:08
New scripts:
- scripts/run_tests.py: compile & run ScalaTest suites per student in
  parallel; handles package renaming, embedded test-class splitting,
  timeouts and compile errors; writes test_results.json
- scripts/generate_summary.py: produce a corrector summary as both
  Markdown table and colour-coded Typst/PDF from test_results.json

PDF template improvements (template.typst.jinja2):
- Strip leading level-1 heading from question descriptions to fix
  duplicate title rendering
- Student code always starts on a new page (#pagebreak before answer)
- Question description text rendered in Source Sans 3
- Test-result badge per question (green/orange/red/error) in the
  "Student answer" header alongside the point score
- Replace -- with en-dash in title; disable fancy-line and logo

generate_pdfs_typst.py:
- Add --test-results flag to inject test_results.json into PDFs
- Overwrite existing PDFs in output folder instead of erroring
- Add json/field imports; Answer dataclass gets optional test_results

Documentation & repo hygiene:
- docs/WORKFLOW.md: end-to-end guide (prerequisites, agent prompts for
  Steps 0a/0b, run_tests, generate_pdfs, generate_summary, cheat sheet,
  troubleshooting)
- exams/exam_template.yaml: generic structure template (no real exam
  content, no student data)
- .gitignore: exclude pdf/, pregrade/, *.tar, test_results.json,
  summary.*, labo_test_*.yaml and other artefacts containing student data

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant