So far, I have used my homebrewn style file to create the examination papers which have multiple sets of questions.
Recently, I switched to the exam
class and immensely enjoying the additional power it provides. Now, in case of multiple sets, I am stuck at some point.
My setup, with all the paraphernalia striped, looks something like this.
I use the macro \setcode
which, along with other
things, control the inclusion of external files and use of fonts at specific places.
\documentclass[addpoints]{exam}
\begin{document}
\def\setcode{1}
Total: \numpoints
\begin{questions}
\question[5] First question in Set 1.
\end{questions}
\def\setcode{2}
Total: \numpoints
\begin{questions}
\question[5] First question in Set 2.
\end{questions}
\end{document}
Now, the problem with the above scenario is, internals like \numpoints
are incorrect. As is evidenced by the output and the warning message
regarding multiply defined labels.
I found out that the labels are no more handled using \label
s. Rather,
these are written directly into the .aux file. See this excerpt from
exam.cls
.
This was previously done with
\pageref
commands. When I stopped using\pageref
for this (in order to make this compatible withhyperref.sty
), this stuff was created:
\gdef
commands forexam@lastpage
,exam@numpoints
,exam@numbonuspoints
,exam@numquestions
,exam@numparts
,exam@numsubparts
andexam@numsubsubparts
are written to the.aux
file via\AtEndDocument
.
I understand that if I could hack my \setcode
into the above internals,
my problem would have been solved.
Do you think you could suggest a way for this?
I know that a completely new setup, say something like this, perhaps would solve my problem. But the other side of the coin is, I already have a big setup from more than a decade, which will have to be completely reworked in order for the new setup to work.
aux
file and that would require additional rewritting of the code, a simple setting of the parameters wouldn't help. I would prepare one TeX file on a per student basis (generated from the database somehow, perhaps), that is a sort of workaround for this class. Or I would try theeqexam
package (AcroTeX bundle) if it fits my needs better.eqexam
looks like a promising one, and perhaps will solve my problem, again, with a major reworking of my present setup. So, I will take your first advice, use my setup, fitted intoexam
class. At the same time, I will want keep the uses of internal counters minimal.\label
s or\let
s), then there would be no need for thataux
file at all, or, if there is a way of loading and saving theaux
file intentionally on-the-fly (that's usually unrecommended way).:-)
\def\catchme{exam@numquestions: \thenumquestions\par exam@numparts: \thenumparts\par exam@numsubparts: \thenumsubparts\par exam@numsubsubparts: \thenumsubsubparts} \catchme