From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/47915 Path: news.gmane.org!not-for-mail From: Curious Learn Newsgroups: gmane.comp.tex.context Subject: Two questions - Cross Referencing (Automated label generation + Random items) Date: Tue, 3 Mar 2009 13:17:03 +0000 (UTC) Message-ID: 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 1236086671 3920 80.91.229.12 (3 Mar 2009 13:24:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Mar 2009 13:24:31 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Mar 03 14:25:47 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 1LeUd1-0003Jn-ME for gctc-ntg-context-518@m.gmane.org; Tue, 03 Mar 2009 14:25:47 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C16801FB7E; Tue, 3 Mar 2009 14:24:09 +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 08792-01; Tue, 3 Mar 2009 14:22:11 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 604841FB82; Tue, 3 Mar 2009 14:22:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DC4361FB3C for ; Tue, 3 Mar 2009 14:21:40 +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 30870-06-2 for ; Tue, 3 Mar 2009 14:21:09 +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 D21151FB64 for ; Tue, 3 Mar 2009 14:20:52 +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 n23DHBBG006425 for ; Tue, 3 Mar 2009 14:19:42 +0100 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LeUUi-0002EO-2R for ntg-context@ntg.nl; Tue, 03 Mar 2009 13:17:12 +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 ; Tue, 03 Mar 2009 13:17:12 +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 ; Tue, 03 Mar 2009 13:17:12 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 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: 187830590 - 0d8dd50fcaab 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:47915 Archived-At: As I mentioned earlier, I am trying to use Context to make a multiple choice test. I have two questions. (1) Suppose I want to get a list of answers to the the multiple choice questions. One way I can think of doing this is by assigning a label to the CORRECT answer as done in the following code and then referring to that label. Is there a way these labels can be generated automatically, instead of hardcoding them as I have done below? defineenumeration[problem][text= ,location=inleft] \setupenumerations[problem][stopper=)] \defineitemgroup[choices][levels=1] \setupitemgroup[choices][1][a,packed] \nextrandom \starttext \problem This is the first question. \startchoices \startitem This is incorrect answer 1. \stopitem \startitem This is a wrong answer too. \stopitem \startitem[1] This is the CORRECT answer. \stopitem \startitem Yet another wrong answer. \stopitem \stopchoices \problem This is the second question. \startchoices \startitem[2] This is the CORRECT answer. \stopitem \startitem This is a wrong answer too. \stopitem \startitem This is not a correct choice. \stopitem \startitem Yet another wrong answer. \stopitem \stopchoices Answers to the questions \in[1] \in[2] \stoptext (2) When I add the option "random" to the itemgroup (\setupitemgroup[choices][1][a,packed,random]) then as expected the choices are listed in a random order. However, the label does not change with the choice listing. I want the reference to be attached to the CORRECT answer, which changes its position with random option. Is there a way to have the reference reflect the letter corresponding to the correct answer. Thanks in advance for your help. I really appreciate it. ___________________________________________________________________________________ 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 ___________________________________________________________________________________