From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/85934 Path: news.gmane.org!not-for-mail From: DesdeChaves Newsgroups: gmane.comp.tex.context Subject: reset blocks with dorecurse Date: Tue, 14 Jan 2014 23:46:26 +0000 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0217532123==" X-Trace: ger.gmane.org 1389743189 25499 80.91.229.3 (14 Jan 2014 23:46:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Jan 2014 23:46:29 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 15 00:46:36 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W3Dgp-0003ZF-UO for gctc-ntg-context-518@m.gmane.org; Wed, 15 Jan 2014 00:46:36 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0CDDA101DE; Wed, 15 Jan 2014 00:46:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 4zDo++JjN2ga; Wed, 15 Jan 2014 00:46:33 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id E882D101E2; Wed, 15 Jan 2014 00:46:32 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 26DC7101E2 for ; Wed, 15 Jan 2014 00:46:31 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8xTeIC4u7Ww6 for ; Wed, 15 Jan 2014 00:46:29 +0100 (CET) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 782A7101DE for ; Wed, 15 Jan 2014 00:46:29 +0100 (CET) Original-Received: from mail-oa0-x232.google.com (mail-oa0-x232.google.com [IPv6:2607:f8b0:4003:c02::232]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s0ENkROJ011851 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 15 Jan 2014 00:46:28 +0100 Original-Received: by mail-oa0-f50.google.com with SMTP id l6so405820oag.9 for ; Tue, 14 Jan 2014 15:46:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=aKZd0wae0gfW1O9oWe6gccFImp22ggf+QeiNBB09hNU=; b=QVJv4IHqGncaZHVXnLU8V+RTRGvYDEDdrmmrQdfgQS5XpLiBAdR51p6xCwlM+VGg4h cTg/dQRLH1KIgG4EWHGnjWhXXt4K8JwBkgmDjm3OINicCrMakg4hEurJCNiQLAsDhnct sigwuZYPuBOh2cDs/Sk1oXC+YTHqHwxfkhA2JBwr3dP69/1dYknJ/IRuD3AMPl7fwoTp +xyIfwoiwzqdfuU2cI8KNkh7VP0aXRLodN5Z0FiLIg6GYiUtKGSCUnqbrjLPCJdxTUV2 hAKql6taD+uKEv8VblYBOl70Il6SN6iKrX/kiyG0K3XjDyC0uMuBiT+ge91qF03S4dLB uoLQ== X-Received: by 10.182.40.201 with SMTP id z9mr3438405obk.45.1389743186681; Tue, 14 Jan 2014 15:46:26 -0800 (PST) Original-Received: by 10.60.52.143 with HTTP; Tue, 14 Jan 2014 15:46:26 -0800 (PST) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4003:c02::232; country=US X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03LdXKsaF - 4f1c7d1c56bc - 20140115 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:85934 Archived-At: --===============0217532123== Content-Type: multipart/alternative; boundary=001a11c33b02f8a47904eff6cc65 --001a11c33b02f8a47904eff6cc65 Content-Type: text/plain; charset=ISO-8859-1 Is there a way to empty the blocks after each recurse cycle. If i make three exams with the command \dorecurse[3], in the first exam i found the hints and the answers of all exams. I try with the commands \resetnumber[hint, answer], but don't work. %%%% begin question-hint-answer-blocks.tex \defineblock[question] \defineblock[hint] \defineblock[answer] \defineenumeration[question] [alternative=hanging, width=2.5cm, text={Question}, headstyle={\bi}, stopper={.}] \defineenumeration[hint] [alternative=hanging, width=4cm, text={Hint for question}, headstyle={\bi}, stopper={.}] \defineenumeration[answer] [alternative=hanging, width=4.5cm, text={Answer to question}, headstyle={\bi}, stopper={.}] \setupblock[question][before={\startquestion},after={\stopquestion}] \setupblock[hint][before={\starthint},after={\stophint}] \setupblock[answer][before={\startanswer},after={\stopanswer}] \keepblocks[question] \hideblocks[hint] \hideblocks[answer] \startsetups examn:make \resetnumber[answer] \resetnumber[question] \resetnumber[hint] \page \setcounter[userpage][1] \centerline{\kap{Maths}} \centerline{\kap{Worksheet}} \crlf Name:\thinrules[n=1]%, interlinespace=big] Evaluation:\thinrules[n=1]%, interlinespace=big] \getbuffer[examn] \stopsetups \starttext \setuppagenumbering[state=stop] \startbuffer[examn] \section{Questions} \beginquestion Compute $4\times 5$. \endquestion \beginhint Use the fact that $2\times 5 = 10$. \endhint \beginanswer $20$. \endanswer \beginquestion What is the value of $100 / 10$? \endquestion \beginhint Remember that $10\times 10 = 100$. \endhint \beginanswer $10$ \endanswer \section{Hints to all questions} \useblocks[hint] \section{Answers to all questions} \useblocks[answer] \setuppagenumber[number=1] \stopbuffer \setuprandomize[124] % set a seed \dorecurse{3} {\setups[examn:make]} \stoptext Thanks a lot Jorge --001a11c33b02f8a47904eff6cc65 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Is there a way to empty the blocks after each recurse cycl= e.
If i make three exams with the command \dorecurse[3], in the f= irst exam i found the hints and the answers of all exams. =A0

I try with the commands \resetnumber[hint, = answer], but don't work.
=A0 =A0
%%%% begin questio= n-hint-answer-blocks.tex
\defineblock[question]
\define= block[hint]
\defineblock[answer]

\defineenumeration[quest= ion]
=A0 =A0 =A0 =A0 [alternative=3Dhanging,
=A0 =A0 = =A0 =A0 width=3D2.5cm,
=A0 =A0 =A0 =A0 text=3D{Question},
=A0 =A0 =A0 =A0 headstyle=3D{\bi},
=A0 =A0 =A0 =A0 stopper=3D{.}]

\defineenumera= tion[hint]
=A0 =A0 =A0 =A0 [alternative=3Dhanging,
=A0 = =A0 =A0 =A0 width=3D4cm,
=A0 =A0 =A0 =A0 text=3D{Hint for questio= n},
=A0 =A0 =A0 =A0 headstyle=3D{\bi},
=A0 =A0 =A0 =A0 stopper=3D{.}]

\defineenumera= tion[answer]
=A0 =A0 =A0 =A0 [alternative=3Dhanging, =A0 =A0 =A0 = =A0width=3D4.5cm,
=A0 =A0 =A0 =A0 text=3D{Answer to question},
=A0 =A0 =A0 =A0 headstyle=3D{\bi},
=A0 =A0 =A0 =A0 stopper=3D{.}]

\setupblock[qu= estion][before=3D{\startquestion},after=3D{\stopquestion}]
\setup= block[hint][before=3D{\starthint},after=3D{\stophint}]
\setupbloc= k[answer][before=3D{\startanswer},after=3D{\stopanswer}]
\keepblocks[question]
\hideblocks[hint]
\hideblock= s[answer]




=
\startsetups examn:make

\resetnumber[answer]<= /div>
\resetnumber[question]
\resetnumber[hint]
=A0 =A0 = \page
=A0 =A0 =A0 =A0 \setcounter[userpage][1]
\centerl= ine{\kap{Maths}}
=A0\centerline{\kap{Worksheet}} =A0\crlf
=A0Name:\thinrules[n=3D1]%, interlinespace=3Dbig]
Evaluation:\thinrules[n=3D1]%, interlinespace=3Dbig]


=A0 =A0 \getbuffer[examn]

\= stopsetups

\starttext
\setuppagenumberin= g[state=3Dstop]
\startbuffer[examn]

\section{Questions}
=

\beginquestion
=A0 Compute $4\times 5$.
=
=A0=A0

=A0=A0
\endquestion

\beginhint
=A0 Use the fact that $2\times 5 =3D 10$.
\endhint

\beginanswer
=A0 $20$.=
\endanswer

\beginquestion
=A0= What is the value of $100 / 10$?
\endquestion

\beginhint
Remember th= at $10\times 10 =3D 100$.
\endhint

\begi= nanswer
$10$
\endanswer

\secti= on{Hints to all questions}

\useblocks[hint]

\section{Answ= ers to all questions}

\useblocks[answer]

\setuppagenumber[number=3D1]
\stopbuffer

\setuprandomize[124] % set a seed

<= br>
\dorecurse{3} {\setups[examn:make]}

= \stoptext

Thanks a lot

Jorge
--001a11c33b02f8a47904eff6cc65-- --===============0217532123== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0217532123==--