3

There is a type of MCQ (Multiple Choice Questions) in which each MCQ can have either one or more than one answer, with the maximum number of possible answers can be equal to to the number of total choices. How this can be done in latex using examdesign class?

Here is an example:

\documentclass[a4paper, 11pt]{examdesign}

\parindent 0pt

\usepackage[margin=1in]{geometry}

\class{Your Exam}

\Fullpages

\ContinuousNumbering

\DefineAnswerWrapper{}{}

\NumberOfVersions{1}

\ShortKey

\NoRearrange
\begin{document}

\begin{multiplechoice}[title={A title}]

These are meant to be multiple-choice questions, with multiple answers.

\begin{question}
  How many people live in Wales?
    \choice{Approximately 2,811,865.}
    \choice[!]{More than in most countries.}
    \choice{None.}
    \choice{Exactly seventeen.}
\end{question}

\begin{question}
  How many cows does it take to graze a field?
  \choice[i]{One.}
  \choice[i]{Two.}
  \choice{Three.}
  \choice[i]{Four}
\end{question}
\end{multiplechoice}
\end{document}

I want the correct answers at different \choices, and all choices should be printed in the solution.

2

examdesign already supports multiple correct answers.

There just seems to be a small issue in the definition of \exam@ShortKeyChoice (the internal definition of \choice in your example). An internal counter for the solution tracking is not stepped up for correct solutions. That means that the key in the answer section is off if you have several correct answers.

I strongly suggest you contact the package maintainer about this. The documentation will probably mention how to report bugs. (Though given that the last real change to the package was in 2001 chances for a big fix might be smaller than I initially thought. The email address of the developer is also not visible in the PDF documentation, you have to go to the source .dtx directly to find it.)

In the meantime here is a workaround. We only had to move the \stepcounter{choice} outside the conditional. In the original definition the counter is only stepped up in the (here removed) \else branch of the \if#1! which mean that the counter would only be increased for wrong answers, but not for correct ones. This meant that the count for the n-th correct answer would be off by n-1.

\documentclass[a4paper, 11pt]{examdesign}

\makeatletter
\renewcommand{\exam@ShortKeyChoice}[2][]{%
  \if#1!%
    \ifOneCorrectAnswerAlreadyGiven
    , (\alph{choice})
    \else
    \exam@MultipleChoiceShortKeyPrefix
    (\alph{choice})%
    \OneCorrectAnswerAlreadyGiventrue
    \fi
   \fi
  \stepcounter{choice}%
  \ignorespaces}
\makeatother

\class{Your Exam}
\Fullpages
\ContinuousNumbering
\DefineAnswerWrapper{}{}
\NumberOfVersions{1}
\ShortKey
\NoRearrange

\begin{document}
\begin{multiplechoice}[title={A title}]
These are meant to be multiple-choice questions, with multiple answers.

\begin{question}
  How many people live in Wales?
    \choice{Approximately 2,811,865.}
    \choice[!]{More than in most countries.}
    \choice{None.}
    \choice{Exactly seventeen.}
\end{question}

\begin{question}
  How many cows does it take to graze a field?
  \choice{One.}
  \choice[!]{Two.}
  \choice{Three.}
  \choice[!]{Four}
\end{question}
\end{multiplechoice}
\end{document}

2. (b), (d)

  • Thanks "moew", that's splendid. Your response have also cleared another small glitch about how to print answers in CAPITALS. – Parag Feb 21 at 12:15
  • Is it possible to put options to a question in a single line rather than each option with newline? – Parag May 2 at 9:55
  • @Parag Possibly (I didn't have a look and don't have the time right now). I suggest you ask a new question about that. It seems only mildly related to this question. – moewe May 2 at 10:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.