From: DesdeChaves <desdechaves@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: reset blocks with dorecurse
Date: Tue, 14 Jan 2014 23:46:26 +0000 [thread overview]
Message-ID: <CAPBmU9FicDkocoBGo-ENUDfgng081DT6f-SrSeVxtuxR32H=8w@mail.gmail.com> (raw)
[-- 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
___________________________________________________________________________________
next reply other threads:[~2014-01-14 23:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-14 23:46 DesdeChaves [this message]
2014-01-15 14:06 ` DesdeChaves
2014-01-15 14:18 ` Wolfgang Schuster
2014-01-15 14:26 ` DesdeChaves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPBmU9FicDkocoBGo-ENUDfgng081DT6f-SrSeVxtuxR32H=8w@mail.gmail.com' \
--to=desdechaves@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).