[OS X TeX] Multiple choice tests

Alain Schremmer Schremmer.Alain at gmail.com
Fri Jan 6 15:10:53 EST 2006

Alain Schremmer wrote:

> Talbot's probsoln package uses his generator to modify/pick the 
> problems and I would like to use it to pick n and i randomely in the 
> main file.
> The trouble is that I cannot read his code and, even less, if need be, 
> extract his pseudo-random number generator to modify it for my own 
> purpose.

I have made some progress by cutting Talbot's sample example down to 
something I could graft on a pared-down version of my own main file.

I have enclosed this main file below for reference. Should anyone wish, 
I will send her/him all the ancillary files for the example to work.

Note that I am also using Sneep's \includeExercise.

When I typeset the main file, the pdf is:

    2. random one of a, b, c, d, e, say d
    3. random one of a, b, c, d, e, say b

        (this is because, as probsoln says: "Each problem is preceeded
        by a \item, so the command \selectrandomly should occur within
        one of the list-like environments, such as enumerate.")

    Contents of file 016-Exam-1-Question-1-a
    Contents of file 016-Exam-33-Question-1-a

(1) My immediate question, is whether I can use variables so that, 
instead of the above, I get just

    Contents of file 016-Exam-1-Question-1-d
    Contents of file 016-Exam-33-Question-1-b

(2) My less immediate question is how to shuffle the 33 questions. I 
think that the solution is in Talbot's probsoln but …



% begin PREAMBLE

% begin use packages
% end use packages
%begin IncludeExercises/IncludeFileName


\newboolean{FinalVersionWithExercises} % defaults to false
\setboolean{FinalVersionWithExercises}{true} % uncomment this line to 
actually include the exercises

\ifthenelse{\boolean{FinalVersionWithExercises}}% if true, do the first 
thing, otherwise the second.
\input{#1}% true part
{\url{#1}}% else part
%end IncludeExercises/IncludeFileName





%Bottom one.

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/

More information about the MacOSX-TeX mailing list