← All templates

Exam with random variants (esami)

Several versions of an exam in one file, with multiple-choice questions and a problem whose variants and answer order are chosen per version.

Create an account to use this
Category
Teaching
Document class
article (article.cls) — ships with TeX Live
Workflow
Assignment / problem set — no revision rounds
Author
Grazia Messineo, Salvatore Vassallo
Source
CTAN
Licence
esami.sty: The LaTeX Project Public License 1. Sample text: Manulyx, CC0 1.0 (free to use, no conditions).

What you get

  • main.tex — the file that is compiled · 1 KB
  • q-roots.tex · 581 B
  • q-derivative.tex · 238 B
  • p-quadratic.tex · 370 B

These become your files. Editing them afterwards changes your project and nothing else — a project owns its files from the moment it is made.

Link to this template. Send it to a student or co-author: it starts a new paper in this template, through sign-up if they need an account.

https://manulyx.com/start/ctan-teaching-esami

2 venues use this class

Manulyx keeps one template per document class and relates every venue to it, rather than one near-identical card per journal. Searching the gallery for any of these names finds this template.

Journal of Machine Learning Research, Transactions on Machine Learning Research
  • Journal of Machine Learning Research
  • Transactions on Machine Learning Research

Source

main.tex — the file that is compiled · 1 KB
% esami builds \numcompiti versions of the exam in one PDF. Exercises live in separate
% files; each \newproblem in a file is a variant, and one variant is chosen per version.
% Options: solutions / nosolutions, quizsolutions / noquizsolutions, shuffle / noshuffle.
\documentclass[a4paper,UKenglish]{article}
\usepackage[T1]{fontenc}
\usepackage[shuffle,nosolutions,noquizsolutions]{esami}
\usepackage{amsmath}

\def\numcompiti{2}%   number of versions
\date{2026/01/22}%    the exam date, in the form YYYY/MM/DD

\begin{document}

\whiledo{\thevers<\numcompiti}{\stepvers
% the seed for this version, derived from the date and the version number
\FPeval\seme{round(\thenomefile*(\thevers)+1-trunc(\thenomefile*(\thevers)/(2^31-1):0)*(2^31-1):0)}
\randomi=\seme
\permuta

\begin{center}
  {\Large\bfseries Your paper}\\[4pt]
  Course Code -- Course Name \quad \longdate \quad Version \thevers
\end{center}

\noindent Name:~\makebox[7cm]{\hrulefill}\hfill Student ID:~\makebox[4cm]{\hrulefill}

\section*{Part one: multiple choice}

\begin{test}[2]
\begin{questions}
\esercizi{q-roots,q-derivative}
\end{questions}
\end{test}

\section*{Part two: problem}

\esercizi{p-quadratic}

\closevers
}

\end{document}
q-roots.tex · 581 B

Loading…

q-derivative.tex · 238 B

Loading…

p-quadratic.tex · 370 B

Loading…

The first page, as this template compiles today. Click it to enlarge, and again to shrink. Open the file ↗