Variations of an exam

Use mailmerge and declare some fields (\mailfields), define the repetitions (\mailrepeat) and define different sets of parameters (\mailentry).

See the documentation for persuasive examples.

Edit: Here's your example with mailmerge:

\documentclass{exam}
\usepackage[magyar]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{t1enc}
\usepackage{nicefrac}
\usepackage{siunitx}
\usepackage{multicol}
\usepackage{mailmerge}
\pagestyle{empty}
\addpoints
\pointname{ pont}
\pointsinrightmargin
\marginpointname{ pont}
\begin{document}
\mailfields{group,a,b}
\mailrepeat{
\centerline{\large V. exam -- \field{group} group}
\begin{questions}
    \question[5]What is the result of $\field{a}\cdot\field{b}$?
\end{questions}\clearpage}
\mailentry{A,5,10}
\mailentry{B,10,20}
\end{document}

This question is the reason for the »variations« feature of exsheets introduced in v0.6. The command \vary is provided which in the default setting has two arguments. The command \variant{<num>} (where <num> is either 1 or 2) will choose if the first or second argument is used.

Here is a use-case example:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[magyar]{babel}

\usepackage[load-headings]{exsheets}
\SetupExSheets{
  headings = runin-nr ,
  headings-format = \normalfont ,
  points/name = pont/ok % this is what translate.google.com tells me...
}

\begin{document}

% \variant{1} % default
\centerline{\large V. exam -- \vary{A}{B} group}
\bigskip

\begin{question}{5}
 What is the result of $\vary{5}{10}\cdot\vary{10}{20}$?
\end{question}

\bigskip
\variant{2}
\centerline{\large V. exam -- \vary{A}{B} group}
\bigskip

\begin{question}{5}
 What is the result of $\vary{5}{10}\cdot\vary{10}{20}$?
\end{question}

\end{document}

enter image description here

If you wanted more than two variations you could for example issue \SetVariations{3} in the preamble which would cause \vary to have three arguments. <num> in \variant{<num>} now could be 1, 2 or 3.

Tags:

Exam