Skip to content
wiseoddPublic

About

Question banks in Typst, sampled into exams with balanced versions

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

sortes

Exam sampler for Typst. Sortes (SOR-tays) is Latin for random draws.

Docs: Guide References
Typst 0.14+ License: MIT

Installation

With Homebrew, which also installs Typst:

brew install wiseodd/tap/sortes

Or install Typst and uv, then:

uv tool install sortes

sortes runs on macOS (Apple silicon) and Linux (x86, ARM). On Windows, use WSL.

Usage

Create a course (replace <course> with your course name) and a term inside it (replace <term> with e.g. W2027):

sortes init <course>
cd <course>
sortes term <term>

This will create a directory called <course> with bank.typ and typst.toml inside, and an empty term directory <term>. bank.typ is your question bank, and it has a few example questions to start from. A question looks like this:

#import "@local/sortes:1.0.0": *

= Supervised Learning and Regression <regression>

#q(<supervised-def>)[
  What is supervised learning?
  - Minimizing a function given data
  - #correct[Approximating the function $bold(x) |-> y$ from labeled data]
  - Learning without labels
]

Say, the term is W2027 and you write an exam midterm.typ in it. It uses your own template and asks for questions by section or by ID:

#import "@local/sortes:1.0.0": *

#show: sortes.with(
  bank: include "../bank.typ",
  lock: json("sortes.lock"),
  title: "Midterm",
  versions: 2,
  points: 20,
)

#draw(<regression>, 3)
#pick(<normal-eq-derive>)

Both are ordinary Typst files, so you can preview them in your editor, with <course> as the project root. Then:

sortes build W2027/midterm.typ

In W2027/PDFs, it will output midterm-A.pdf and midterm-B.pdf, and their solutions midterm-A-sol.pdf and midterm-B-sol.pdf. Print the former. The questions it drew are recorded in W2027/sortes.lock, so building again gives the same exam. Commit it with your exams.

More info: https://sortes.kristia.de

Development

make check   # fmt, clippy, tests (tests need typst)
make docs    # build the docs site into docs/dist

About

Question banks in Typst, sampled into exams with balanced versions

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages