[NTG-context] reset blocks with dorecurse

DesdeChaves desdechaves at gmail.com
Wed Jan 15 15:06:39 CET 2014


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 <desdechaves at gmail.com>

> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20140115/b6134802/attachment.html>


More information about the ntg-context mailing list