ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: \itemize[random] does not work
Date: Fri, 27 Feb 2009 18:45:10 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.00.0902271841110.6570@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <loom.20090227T223758-608@post.gmane.org>

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
___________________________________________________________________________________


  reply	other threads:[~2009-02-27 23:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-27 10:57 Marcin Borkowski
2009-02-27 11:25 ` Wolfgang Schuster
2009-02-27 11:36   ` Marcin Borkowski
2009-02-27 11:47     ` Wolfgang Schuster
2009-02-27 21:22       ` Aditya Mahajan
2009-02-27 22:45         ` Curious Learn
2009-02-27 23:45           ` Aditya Mahajan [this message]
2009-02-28 11:08             ` Curious Learn
2009-02-28 11:14           ` batela
2009-03-01  9:29         ` Wolfgang Schuster
2009-03-01 18:46           ` Hans Hagen
2009-03-01 22:17             ` Wolfgang Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.0902271841110.6570@ybpnyubfg.ybpnyqbznva \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).