I need to create an exam which consists of two parts A and B. From these two parts, I need to create three versions: one which contains part A and B, one which only contains part A and one which only contains part B. Each version needs to have a custom title page, its own page and question numbering, and a point table.
What I would like to have in the end is a single PDF file of the following structure:
- title page for A + B (page no. 1)
- questions from A numbered 1 to n
- questions from B numbered n + 1 to m
- title page for A (restart page and question numbering, set point sum back to 0)
- questions from A numbered 1 to n
- title page for B (restart page and question numbering, set point sum back to 0)
- questions from B numbered 1 to m
Currently, I use the following approach: one file contains the questions from A; one file contains those from B. A master file includes these files and uses custom counters to restart the page/question numbering when appropriate. This works okay but it would be nice if I could use some of the features in the exam
class (e.g. optionally show solutions, boxes for the answers relative to the page height). I am aware that these features can be implemented manually but this is time consuming and the result is probably less user-friendly than using a well-maintained, well-documented external package/class.
This, finally, brings me to my question: can this be achieved using the exam class (especially, having multiple point sums in one file) or a different package?
Edit: Using the answers from the question which is linked in the comments I was able to get pretty close to what I need. I now have three file:
a.tex
:
\question A's first question
\begin{parts}
\part[1] part 1
\part[2] part 2
\part
\begin{subparts}
\subpart[1] 3a
\subpart[2] 3b
\end{subparts}
\end{parts}
\question[2] A's second question
b.tex
:
\question B's first question
\begin{parts}
\part[2] part b1
\part[2] part b2
\end{parts}
\question[1] B's second question
\question[2] B's third question
main.tex
:
\documentclass[a5paper, addpoints]{exam}
\pointsinrightmargin
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[english]{babel}
\begin{document}
\begin{questions}
\begingradingrange{AB}
\uplevel{
% Title page for A + B
\partialgradetable{AB}[h][questions]
}
\input{a.tex}
\input{b.tex}
\endgradingrange{AB}
\clearpage
\setcounter{page}{1}
\begingradingrange{onlyA}
\uplevel{
% Title page for A
\partialgradetable{onlyA}[h][questions]
}
\input{a.tex}
\endgradingrange{onlyA}
\clearpage
\setcounter{page}{1}
\begingradingrange{onlyB}
\uplevel{
% Title page for B
\partialgradetable{onlyB}[h][questions]
}
\input{b.tex}
\endgradingrange{onlyB}
\clearpage
\end{questions}
\end{document}
Compiling main.tex
creates three pages:
The first page is exactly how I want it to be. The question numbering - especially, in the grade table - on the second and third page, however, has to start with question 1 again.
I hope that this clarifies my question.