[NTG-context] solutions and problems

Xan dxpublica at telefonica.net
Sun Feb 23 21:12:56 CET 2014


> > Can you help me?
> 
> Your counter settings are useless because context stores only the environment plus content for the answers, nothing is done with them at this point. When you flush the answer blocks context sees them for the first time and the counter for the questions is 3 at this point and this is why you get always the same value.

Is there any way of first evaluate \getnumber[exercici] and then store the content, and not inversely (as context does now)?

> 
> \defineenumeration[exercici][text=Exercici]
> \defineenumeration[resposta][text=Solucions]
> 
> \defineblock[resposta]
> \hideblocks[resposta]
> 
> \starttext
> 
> \startexercici Question 1
> \beginresposta
> \resposta Answer 1 \par
> \endresposta
> \stopexercici
> 
> \startexercici Question 2
> \beginresposta
> \incrementcounter[resposta]
> \endresposta
> \stopexercici
> 
> \startexercici Question 3
> \beginresposta
> \resposta Answer 3 \par
> \endresposta
> \stopexercici
> 
> \subject{Answers}
> 
> \selectblocks[resposta]
> 
> \stoptext
> 
> Wolfgang

Increment counter *every* time is possible option, but in fact very annoying: if I have 100 exercises (now I have more than this) and I have only 20 exercises, then I have to put "\incrementcounter" in 80 exercises. It's a tedious thing.

Is there any more "relaxing" thing: assuming that I have 'resposta' nested in 'exercici' like

\startexercici
\beginresposta
\resposta Answer X
\endresposta
\stopexercici

?


Thanks another time,
Xan


More information about the ntg-context mailing list