On Fri, 27 Feb 2009, Curious Learn wrote:
I was not aware of this cool feature in Context. This could be very useful in
making multiple choice tests. I have one question. Is there a simple way in
which one can switch between itemized lists that are random and non-random? For
example, if I have 40 multiple choice questions, each of which has the following
form:
Question Text
\startitemize[random]
\startitem first item \stopitem
\startitem second item \stopitem
\startitem third item \stopitem
\startitem fourth item \stopitem
\stopitemize
If I want the PDF file that has the items in the order I entered them in (i.e.,
not a random permutation); is it possible to do that in a way other than going
and taking out the "random" from each itemize environment?
Use modes:
\defineitemgroup[choices]
\startmode[random]
\setupitemgroup[choices][1][random]
\nextrandom % to get rid of the randomize bug
\stopmode
\starttext
\startchoices[n]
\startitem 1 \stopitem
\startitem 2 \stopitem
\startitem 3 \stopitem
\startitem 4 \stopitem
\startitem 5 \stopitem
\stopchoices
\stoptext
Compile this file with "texexec --mode=random " to get random choices,
compile without --mode=... to get normal behaviour. If you want random all
the time and normal a few times, then change
\startmode[random]...\stopmode
to
\stopnotmode[nonrandom] .... \stopnotmode.
Then when you compile with texexec --mode=nonrandom you will not get
random choices, if you compile without --mode=... you will get random
answers.
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________