I am using the exam package to create a questionnaire.
I have two sections with multiple choice questions.
When I put two "questions" environment under each sections, I get latex warning mentioning labels defined multiple times (Label `question@1' multiply defined etc).
Does anyone know how to avoid having two questions with same label?
A sample code is given below
\documentclass[12pt]{exam}
\begin{document}
\section{On part one}
\begin{questions}
\question
Which of the following statements is/are True?
\begin{choices}
\choice B is true
\choice A is false
\correctchoice C is false
\end{choices}
\question
Why is this false
\begin{choices}
\correctchoice Yay
\correctchoice Bee
\correctchoice See
\choice Dee
\end{choices}
\end{questions}
\section{On part two}
\begin{questions}
\question
Which of the following statements is/are True?
\begin{choices}
\choice B is true
\choice A is false
\correctchoice C is false
\end{choices}
\question
Why is this false
\begin{choices}
\correctchoice Yay
\correctchoice Bee
\correctchoice See
\choice Dee
\end{choices}
\end{questions}
\end{document}
Best Answer
In order to do its business, the
exam
class uses self-defined labels, but in doing so it doesn't take into account the fact that question numbers are reset at everyquestions
environment. Actually, the class seems to be expecting just onequestions
environment.Using two will most certainly confuse the point system. If you don't plan to use it, you can do
The alternative is to use
\section
inside the singlequestions
environment.