ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \itemize[random] does not work
@ 2009-02-27 10:57 Marcin Borkowski
  2009-02-27 11:25 ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Marcin Borkowski @ 2009-02-27 10:57 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

Hello,

I've noticed that \startitemize[random] does not mix the items randomly.
Is it a bug or am I doing something wrong?

Here's the code (tested on context live):

\starttext
\startitemize[a,random]
\item A
\item B
\item C
\stopitemize
\stoptext

Regards

-- 
Marcin Borkowski (http://mbork.pl)
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: \itemize[random] does not work
  2009-02-27 10:57 \itemize[random] does not work Marcin Borkowski
@ 2009-02-27 11:25 ` Wolfgang Schuster
  2009-02-27 11:36   ` Marcin Borkowski
  0 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2009-02-27 11:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Feb 27, 2009 at 11:57 AM, Marcin Borkowski
<mbork@atos.wmid.amu.edu.pl> wrote:
> Hello,
>
> I've noticed that \startitemize[random] does not mix the items randomly.
> Is it a bug or am I doing something wrong?

A simple \item is not enough, you need a \startitem ... \stopitem pair.
Please add a note to the wiki.

\startitemize[a,random]
\startitem A \stopitem
\startitem B \stopitem
\startitem C \stopitem
\stopitemize

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: \itemize[random] does not work
  2009-02-27 11:25 ` Wolfgang Schuster
@ 2009-02-27 11:36   ` Marcin Borkowski
  2009-02-27 11:47     ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Marcin Borkowski @ 2009-02-27 11:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dnia Fri, Feb 27, 2009 at 12:25:39PM +0100, Wolfgang Schuster napisa&#322;(a):
> On Fri, Feb 27, 2009 at 11:57 AM, Marcin Borkowski
> <mbork@atos.wmid.amu.edu.pl> wrote:
> > Hello,
> >
> > I've noticed that \startitemize[random] does not mix the items randomly.
> > Is it a bug or am I doing something wrong?
> 
> A simple \item is not enough, you need a \startitem ... \stopitem pair.
> Please add a note to the wiki.
> 
> \startitemize[a,random]
> \startitem A \stopitem
> \startitem B \stopitem
> \startitem C \stopitem
> \stopitemize

Thanks for a speedy response!

I've also noticed a strange thing: the first item always is the first -
it won't get mixed with the others.

> Wolfgang

Regards

-- 
Marcin Borkowski (http://mbork.pl)

888 * ostre słowa * ostra muzyka * ostra płyta
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: \itemize[random] does not work
  2009-02-27 11:36   ` Marcin Borkowski
@ 2009-02-27 11:47     ` Wolfgang Schuster
  2009-02-27 21:22       ` Aditya Mahajan
  0 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2009-02-27 11:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2009/2/27 Marcin Borkowski <mbork@atos.wmid.amu.edu.pl>:

> Thanks for a speedy response!
>
> I've also noticed a strange thing: the first item always is the first -
> it won't get mixed with the others.

This is normal although I have here a document [1] where the first item
always appear between the other items, you can try if this did also
happen for you.

[1] http://wolfgang.schuster.googlepages.com/baytex

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: \itemize[random] does not work
  2009-02-27 11:47     ` Wolfgang Schuster
@ 2009-02-27 21:22       ` Aditya Mahajan
  2009-02-27 22:45         ` Curious Learn
  2009-03-01  9:29         ` Wolfgang Schuster
  0 siblings, 2 replies; 12+ messages in thread
From: Aditya Mahajan @ 2009-02-27 21:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, 27 Feb 2009, Wolfgang Schuster wrote:

> 2009/2/27 Marcin Borkowski <mbork@atos.wmid.amu.edu.pl>:
>
>> Thanks for a speedy response!
>>
>> I've also noticed a strange thing: the first item always is the first -
>> it won't get mixed with the others.
>
> This is normal although I have here a document [1] where the first item
> always appear between the other items,

There is a bug somewhere in the initialization of the random number 
generator. The first random number is always 1. An easy work around is to 
add \nextrandom somewhere before \starttext and then the first item will 
be random.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: \itemize[random] does not work
  2009-02-27 21:22       ` Aditya Mahajan
@ 2009-02-27 22:45         ` Curious Learn
  2009-02-27 23:45           ` Aditya Mahajan
  2009-02-28 11:14           ` batela
  2009-03-01  9:29         ` Wolfgang Schuster
  1 sibling, 2 replies; 12+ messages in thread
From: Curious Learn @ 2009-02-27 22:45 UTC (permalink / raw)
  To: ntg-context

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?

Thanks.


___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: \itemize[random] does not work
  2009-02-27 22:45         ` Curious Learn
@ 2009-02-27 23:45           ` Aditya Mahajan
  2009-02-28 11:08             ` Curious Learn
  2009-02-28 11:14           ` batela
  1 sibling, 1 reply; 12+ messages in thread
From: Aditya Mahajan @ 2009-02-27 23:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: \itemize[random] does not work
  2009-02-27 23:45           ` Aditya Mahajan
@ 2009-02-28 11:08             ` Curious Learn
  0 siblings, 0 replies; 12+ messages in thread
From: Curious Learn @ 2009-02-28 11:08 UTC (permalink / raw)
  To: ntg-context

Aditya Mahajan <adityam <at> umich.edu> writes:

> \defineitemgroup[choices]
> 
> \startmode[random]
>    \setupitemgroup[choices][1][random]
>    \nextrandom % to get rid of the randomize bug
> \stopmode

> Compile this file with "texexec --mode=random " to get random choices, 
> compile without --mode=... to get normal behaviour. 

Thanks very much Aditya. That's awesome. I am going to try that for the next
test I make.









___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: \itemize[random] does not work
  2009-02-27 22:45         ` Curious Learn
  2009-02-27 23:45           ` Aditya Mahajan
@ 2009-02-28 11:14           ` batela
  1 sibling, 0 replies; 12+ messages in thread
From: batela @ 2009-02-28 11:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1635 bytes --]


For multiple choice you can try:

http://fourier.math.uoc.gr/~mk/much/example/

see:

  [NTG-context] create and grade multiple choice exams with MUCH an  
ConTeXT

have a nice day


Em 27/02/2009, às 10:45, Curious Learn escreveu:

> 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?
>
> Thanks.
>
>
> _______________________________________________________________________ 
> ____________
> 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
> _______________________________________________________________________ 
> ____________
>
>
Um Abraço,

Jorge Magalhães

[-- Attachment #1.2: Type: text/enriched, Size: 1632 bytes --]



For multiple choice you can try:


http://fourier.math.uoc.gr/~mk/much/example/


see:


<bold> [NTG-context] create and grade multiple choice exams with MUCH
an ConTeXT


have a nice day</bold>



Em 27/02/2009, às 10:45, Curious Learn escreveu:


<excerpt>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?


Thanks.



___________________________________________________________________________________

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

___________________________________________________________________________________



</excerpt>Um Abraço,


Jorge Magalhães


[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: \itemize[random] does not work
  2009-02-27 21:22       ` Aditya Mahajan
  2009-02-27 22:45         ` Curious Learn
@ 2009-03-01  9:29         ` Wolfgang Schuster
  2009-03-01 18:46           ` Hans Hagen
  1 sibling, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2009-03-01  9:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen


Am 27.02.2009 um 22:22 schrieb Aditya Mahajan:

>>> I've also noticed a strange thing: the first item always is the  
>>> first -
>>> it won't get mixed with the others.
>
> There is a bug somewhere in the initialization of the random number  
> generator. The first random number is always 1. An easy work around  
> is to add \nextrandom somewhere before \starttext and then the first  
> item will be random.


The best would be to add

   \appendtoks\nextrandom\to\everystarttext

to the core.

Wolfgang

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: \itemize[random] does not work
  2009-03-01  9:29         ` Wolfgang Schuster
@ 2009-03-01 18:46           ` Hans Hagen
  2009-03-01 22:17             ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2009-03-01 18:46 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

Wolfgang Schuster wrote:
> 
> Am 27.02.2009 um 22:22 schrieb Aditya Mahajan:
> 
>>>> I've also noticed a strange thing: the first item always is the first -
>>>> it won't get mixed with the others.
>>
>> There is a bug somewhere in the initialization of the random number 
>> generator. The first random number is always 1. An easy work around is 
>> to add \nextrandom somewhere before \starttext and then the first item 
>> will be random.
> 
> 
> The best would be to add
> 
>   \appendtoks\nextrandom\to\everystarttext
> 
> to the core.

i'd rather try to figure out why the initialization fails; i noticed it 
a while ago, but couldn't find the reason

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: \itemize[random] does not work
  2009-03-01 18:46           ` Hans Hagen
@ 2009-03-01 22:17             ` Wolfgang Schuster
  0 siblings, 0 replies; 12+ messages in thread
From: Wolfgang Schuster @ 2009-03-01 22:17 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

On Sun, Mar 1, 2009 at 7:46 PM, Hans Hagen <pragma@wxs.nl> wrote:

> i'd rather try to figure out why the initialization fails; i noticed it a
> while ago, but couldn't find the reason

Don't know why this happens with the randomizer in thrd-ran.tex but
it's easy to solve it in supp-ran.tex

Line 72 is '\ifx\normaluniformdeviate\undefined' but \normaluniformdeviate
is not defined but \uniformdeviate is defined (I guess \bindprimitive in
syst-ini.tex prefixed the commands with 'normal' in a earlier version).

You should also remove the normal prefix from the \nextrandom redefinition
in supp-ran.tex

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-03-01 22:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-27 10:57 \itemize[random] does not work 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
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

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).