From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/47947 Path: news.gmane.org!not-for-mail From: Curious Learn Newsgroups: gmane.comp.tex.context Subject: Re: =?utf-8?q?Two_questions_-_Cross_Referencing_=28Auto?= =?utf-8?q?mated=09label_generation_+_Random_items=29?= Date: Wed, 4 Mar 2009 12:54:42 +0000 (UTC) Message-ID: References: <6A462629-D6C0-4A9C-81E7-E5B130A4CB7D@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1236171495 6332 80.91.229.12 (4 Mar 2009 12:58:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Mar 2009 12:58:15 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed Mar 04 13:59:20 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1Leqgx-0005tk-KJ for gctc-ntg-context-518@m.gmane.org; Wed, 04 Mar 2009 13:59:19 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D18361FBBA; Wed, 4 Mar 2009 13:57:47 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04369-07; Wed, 4 Mar 2009 13:56:45 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 99E6A1FADF; Wed, 4 Mar 2009 13:56:26 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8496D1FADF for ; Wed, 4 Mar 2009 13:55:20 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06781-06 for ; Wed, 4 Mar 2009 13:55:01 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by ronja.ntg.nl (Postfix) with ESMTP id 4EE381FA2B for ; Wed, 4 Mar 2009 13:54:55 +0100 (CET) Original-Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by filter2-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n24CsrLe005947 for ; Wed, 4 Mar 2009 13:54:54 +0100 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Leqcd-0005VE-0S for ntg-context@ntg.nl; Wed, 04 Mar 2009 12:54:51 +0000 Original-Received: from pool-96-231-211-174.washdc.fios.verizon.net ([96.231.211.174]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Mar 2009 12:54:51 +0000 Original-Received: from curiouslearn by pool-96-231-211-174.washdc.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Mar 2009 12:54:51 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 96.231.211.174 (Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.6) Gecko/2009011912 Firefox/3.0.6) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.91.229.2; country=NO; region=12; city=Oslo; latitude=59.9167; longitude=10.7500; http://maps.google.com/maps?q=59.9167,10.7500&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 188438734 - a56aeb796c70 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:47947 Archived-At: Wolfgang Schuster googlemail.com> writes: > You don't need \nextrandom any longer, it's fixed with the last beta. > > \newcounter\choicecounter > > \define[1]\Rightitem > {\doglobal\increment\choicecounter > \startitem[\choicecounter]#1\stopitem} > > \define[1]\Wrongitem > {\startitem#1\stopitem} > > \processbetween{rightitem}\Rightitem > \processbetween{wrongitem}\Wrongitem > > \startrightitem This is the CORRECT answer. \stoprightitem > \startwrongitem Yet another wrong answer. \stopwrongitem > You can use a fixed random order for the items (the don't change after > each new run) with '\setupsystem[random=3456]', you can change the order > when you user another number. > > Wolfgang > Awesome solution. Works great. Thanks very much Wolfgang. I can now use your solution. If it is not too difficult to explain, I would appreciate if someone could explain why the following does not work. It is not necessary because Wolfgang's solution is great but will help me understand it better. \def\AnsT {\doglobal\increment\choicecounter \startitem[\choicecounter]#1\stopitem} \def\eAns{\stopitem} With these commands if I use \AnsT This is the CORRECT answer. \eAns \startwrongitem Yet another wrong answer. \stopwrongitem I get the error "File ended while scanning use of \startitem" ___________________________________________________________________________________ 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 ___________________________________________________________________________________