← All templates

Multiple-choice exam versions (mcexam)

A multiple-choice exam whose question and answer order is permuted across four versions, with concept, exam, key and answers outputs.

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
Jorre Vannieuwenhuyze
Source
CTAN
Licence
mcexam.sty: The LaTeX Project Public License 1.3c. Sample text: Manulyx, CC0 1.0 (free to use, no conditions).

What you get

  • main.tex — the file that is compiled · 2 KB

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-mcexam

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 · 2 KB
\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
% output=concept shows every version's permutation and the correct answers;
% output=exam prints one version for students; output=key prints the key table;
% output=answers prints a version with the correct answers and explanations.
\usepackage[output=exam,
            numberofversions=4,
            version=1,
            seed=2026,
            randomizequestions=true,
            randomizeanswers=true]{mcexam}
\usepackage{tikz}
\usepackage{fancyhdr,lastpage}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.4pt}
\lfoot{\mctheversion}
\rfoot{Page \thepage\ of \pageref{LastPage}}

\begin{document}

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

\mcifoutput{concept,exam}{
  \noindent Name: \dotfill\\[.5\baselineskip]
  \noindent Student ID: \dotfill

  \medskip
  \noindent\textbf{Instructions.} Answer all questions on the answer sheet. Each question has
  exactly one correct answer.
}

\begin{mcquestions}

\question What is the value of $\displaystyle\int_0^1 2x\,dx$?
  \begin{mcanswerslist}
  \answer $0$
  \answer[correct] $1$
  \answer $2$
  \answer $\tfrac12$
  \end{mcanswerslist}
  \begin{mcexplanation}
  $\int_0^1 2x\,dx = \bigl[x^{2}\bigr]_0^1 = 1$.
  \end{mcexplanation}

\question Which figure is a square?
  \begin{mcanswers}
  \begin{tabular}{@{}cccc}
  \answer{1}{\tikz{\draw (0,0) -- (1.2,0) -- (0.6,1) -- cycle;}} &
  \answer{2}{\tikz{\draw (0,0) rectangle (1.6,0.8);}} &
  \answer[correct]{3}{\tikz{\draw (0,0) rectangle (1,1);}} &
  \answer{4}{\tikz{\draw (0,0) circle[radius=0.5];}} \\
  \answernum{1} & \answernum{2} & \answernum{3} & \answernum{4} \\
  \end{tabular}
  \end{mcanswers}

\question Which statement about the derivative of $f(x) = x^{2}$ at $x = 3$ is correct?
  \begin{mcanswerslist}[fixlast]
  \answer It equals $9$.
  \answer[correct] It equals $6$.
  \answer It equals $3$.
  \answer None of the above.
  \end{mcanswerslist}

\question Which is the largest planet in the Solar System?
  \begin{mcanswerslist}
  \answer[correct] Jupiter
  \answer Saturn
  \answer Neptune
  \answer Earth
  \end{mcanswerslist}

\question When was the first crewed Moon landing?
  \begin{mcanswerslist}[ordinal]
  \answer 1965
  \answer 1967
  \answer[correct] 1969
  \answer 1972
  \end{mcanswerslist}

\end{mcquestions}

\end{document}

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