ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* reset blocks with dorecurse
@ 2014-01-14 23:46 DesdeChaves
  2014-01-15 14:06 ` DesdeChaves
  0 siblings, 1 reply; 4+ messages in thread
From: DesdeChaves @ 2014-01-14 23:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2035 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 3383 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-15 14:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-14 23:46 reset blocks with dorecurse DesdeChaves
2014-01-15 14:06 ` DesdeChaves
2014-01-15 14:18   ` Wolfgang Schuster
2014-01-15 14:26     ` DesdeChaves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).