Monday, 27 May 2013

exam class - print answer key to multiple choice questions

exam class - print answer key to multiple choice questions

I'm using the exam document class, and I'd like to print the letter of the correct answer. Something like:
    \documentclass{exam}
    \begin{document}

    \begin{questions}

        \question This is a multiple choice question
        \begin{choices}
           \choice this is a choice
           \choice this is another choice
           \CorrectChoice this is the correct choice
           \choice this is another choice
        \end{choices}

        The answer is /theCorrectChoice

    \end{questions}

    \end{document}
I've seen similar issues online but I haven't been able to find a good way to directly reference "the correct choice" the way you can reference /thequestion, for example. Does anyone know how to solve this?

No comments:

Post a Comment