I happily use the exam
document class to create exams and quizzes. I often make at least part of my exams multiple choice, and I'd like to be able to
- generate multiple versions of the exam by permuting the answer choices (automatically, rather than by hand as I do now), and
- generate an answer key for each version when compiling the exam with answers on.
Do any of you do that or have suggestions about how I might be able to implement that?
Best Answer
I know this problem well. I have my own package that does it, along with several documents full of crufty code. I can tell you my implementation:
Permuting answer choices:
pgfmath
list to store the answer choicesYou might find the
\pgfmathsetseed
command useful because you want randomized choices but the same randomized choices each time you compile! You might also find http://random.org/ good for getting sufficiently random seeds.For generating multiple versions and answer keys I use
docstrip
. My main file is a docstrip file likeexam.dtx
and I use guards liketo
\generate
files likeexam-A.tex
,exam-A-key.tex
, etc. Then you have one document per file without manually repeating code.I don't use the
exam
class but I think this could work in that.