1

I am using the exam class. I have a number of multiple choice questions with the correct answers specified with \CorrectChoice. For example:

\question[2]
What fruit is yellow?
\begin{choices}
    \choice apple
    \choice orange
    \CorrectChoice banana
    \choice papaya
\end{choices}

By default when printing the answers it displays both the correct and incorrect answers:

enter image description here

This is a lot of wasted space to go in an answer guide especially if you have a lot of questions. Is there any to get it so that it only displays only the correct answers?

Maybe something like this would work well:

  1. C

As per request, here is a full minimal document:

\documentclass[%
    % 11pt,
     answers,
    addpoints]{exam}

    \usepackage{graphicx}

    \pagestyle{head}
    \firstpageheader{
        Title \\
        Date
    }{}{
        \ifprintanswers \textbf{Answer Key}
        \else Full name:\enspace\makebox[2in]{\hrulefill} \fi \\
        This quiz is worth a total of \textbf{\numpoints\ marks}.
    }



\runningheader{}{}{}

\frenchspacing
\unframedsolutions
\SolutionEmphasis{\sffamily}
\renewcommand{\solutiontitle}{}

\boxedpoints
\pointsinrightmargin
\marginbonuspointname{\textsc{up}}
\makeatletter% rewrite setup@point@toks assuming right margins
\def\clap#1{\hbox to 0pt{\hss#1\hss}}% define \clap as per https://www.tug.org/TUGboat/tb22-4/tb72perlS.pdf
\def\setup@point@toks{%
\point@toks={%
\rlap{\hskip-\@totalleftmargin
\hskip\textwidth
\hskip\@rightmargin
\hskip-\rightpointsmargin
\clap{\padded@point@block}% change \llap to \clap
}%
\global \point@toks={}%
}%
}% end setup@point@toks
\setlength{\rightpointsmargin}{.5in}% assuming the default 1 inch margins
\makeatother
% - adjust the top and bottom margins
\extraheadheight{.25in}
\extrafootheight{-.5in}
\setlength{\marginparwidth}{1.5in}
% NB: remember to use \newpage after the last question

\begin{document}

% Quiz instructions
\begin{center}
%   \parbox{5.5in}{\centering\itshape Be sure to read each question carefully and answer fully.}
\fbox{\fbox{\parbox{5.5in}{\centering
Be sure to read each question carefully and answer fully.}}}
\end{center}

% Quiz questions
\begin{questions}


\question[2]
What fruit is yellow?
\begin{choices}
    \choice apple
    \choice orange
    \CorrectChoice banana
    \choice papaya
\end{choices}

\end{questions}
\end{document}
  • "exam module"? What do you mean? Is it a class or a package? Could you give a full, compilable, and yet minimal, document? – Clément Sep 18 '17 at 16:22
  • Please see updated question with a minimal example. – kojow7 Sep 18 '17 at 16:29
  • Thanks. Your example is not exactly minimal (you could remove the pagestyle, the spacing, the packages, the instructions, etc., and we would stil see your problem). I hoped that the solution would be in Section 5.7 or 8.6 of the exam manual, but it isn't, so I'm afraid you'll have to do something a bit hacky. – Clément Sep 18 '17 at 16:49

Your Answer

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

Browse other questions tagged or ask your own question.