From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/85946 Path: news.gmane.org!not-for-mail From: DesdeChaves Newsgroups: gmane.comp.tex.context Subject: Re: reset blocks with dorecurse Date: Wed, 15 Jan 2014 14:06:39 +0000 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1262307096==" X-Trace: ger.gmane.org 1389794805 28579 80.91.229.3 (15 Jan 2014 14:06:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Jan 2014 14:06:45 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 15 15:06:54 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 1W3R7L-0002TG-Oi for gctc-ntg-context-518@m.gmane.org; Wed, 15 Jan 2014 15:06:51 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 469C6101EB; Wed, 15 Jan 2014 15:06:51 +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 VpK1iXzxhImr; Wed, 15 Jan 2014 15:06:49 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 3265A101E6; Wed, 15 Jan 2014 15:06:49 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DD500101E6 for ; Wed, 15 Jan 2014 15:06:46 +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 P6JDa-3MLoN4 for ; Wed, 15 Jan 2014 15:06:42 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 0FDB5101E3 for ; Wed, 15 Jan 2014 15:06:41 +0100 (CET) Original-Received: from mail-ob0-x236.google.com (mail-ob0-x236.google.com [IPv6:2607:f8b0:4003:c01::236]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s0FE6dr3012106 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 15 Jan 2014 15:06:40 +0100 Original-Received: by mail-ob0-f182.google.com with SMTP id wn1so1186153obc.13 for ; Wed, 15 Jan 2014 06:06:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Qq3VqihvzAacDjNqpXttRXo/SXtkVYq2zKb0zl/LCXo=; b=XDvMUEnvAX2IRUxLolO7fLUnqAFTi2z/0p6cv50oh4GZaldA2on0G37xYO4NRSjIQ6 gvYMcKMRtO7QfSiRJndm3fcf+7L+ZI83JqcSYtjswtehEqqsvRCKqEc9EnMb359U8vcH CLTd2VqSaGR4IXiMVOb8dy2CDxqmlCjzU2q5INAPJ1bgWtrAhQeStw2LpL/bYkMMMfw+ 1jDdBA4vBdABURY8AcDODkFTyNFNYMhEql1MbAh6NLWQgDVtE0OhEF6Eh+AhStY2zV5+ LLLy/7I0GupWpWUWMrUDiwFhLBS1OSLJqR2zxew33dydVfFep86wEhBM+WAl6Z0e/DHZ IwoQ== X-Received: by 10.60.80.101 with SMTP id q5mr1925075oex.44.1389794799333; Wed, 15 Jan 2014 06:06:39 -0800 (PST) Original-Received: by 10.60.52.143 with HTTP; Wed, 15 Jan 2014 06:06:39 -0800 (PST) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4003:c01::236; country=US X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TLee6E4p - e0093d9e4ce2 - 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:85946 Archived-At: --===============1262307096== Content-Type: multipart/alternative; boundary=089e01228ccc53376e04f002d154 --089e01228ccc53376e04f002d154 Content-Type: text/plain; charset=ISO-8859-1 Please, can someone provide some assistance in resolving this problem, if possible. I need to prepare a worksheet for Friday and I'm having this problem, ie, each worksheet show the hints and the answers of all worksheets. thanks in advance Jorge 2014/1/14 DesdeChaves > 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 > -- Atentamente DesdeChaves --089e01228ccc53376e04f002d154 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Please, can someone provide some assistance in resolv= ing this problem, if possible. I need to prepare a worksheet for Friday and= I'm having this problem, ie, each worksheet show the hints and the ans= wers of all worksheets.


thanks in advance

Jorge


2014/1/14 DesdeChaves <desdechaves@gmail.com>
Is there a way to empty the= blocks after each recurse cycle.
If i make three exams with the comman= d \dorecurse[3], in the first 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 question-hint-answe= r-blocks.tex
\defineblock[question]
\defineblock[hint]<= /div>
\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



--
Atentamente<= br>
DesdeChaves
--089e01228ccc53376e04f002d154-- --===============1262307096== 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 ___________________________________________________________________________________ --===============1262307096==--