[Tex/LaTex] Exam package labels multiply defined

exam

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 every questions environment. Actually, the class seems to be expecting just one questions environment.

Using two will most certainly confuse the point system. If you don't plan to use it, you can do

\documentclass[12pt]{exam}
\usepackage{xpatch}

\makeatletter
\xpatchcmd{\questions}
  {question@\arabic{question}}
  {question@\arabic{section}@\arabic{question}}
  {}{}
\makeatother
\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}

The alternative is to use \section inside the single questions environment.

\documentclass[12pt]{exam}

\begin{document}


\begin{questions}
\section{On part one}
\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}

\section{On part two}

\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}