# [NTG-context] getting ConTeXt results back to Lua (for typesetting solutions at end of document)

Hans Hagen j.hagen at xs4all.nl
Fri Feb 1 09:48:08 CET 2019

```On 2/1/2019 4:10 AM, Sanjoy Mahajan wrote:
> Thank you, Matthias and Wolfgang, for the examples/solutions.
>
> If I understand them right, there must be one solution for each exercise
> (otherwise the solution numbering gets out of sync).  Or do the
> coupling= options in Matthias's example remove that restriction?  In my
> experiments with the examples, deleting the first solution
> unsynchronized the exercise--solution numbering, no matter how I fiddled
> with the coupling keys.
>
> In the ideal pedagogical world, I'd write a solution for each exercise.
> But reality might intervene, so I still wonder if the solutions can
> automatically know and include the exercise number (perhaps by placing
> \getnumber[exercise]).  If there is a clever way, that's great.  But,
> the nature of TeX as a macro language may preclude the \getnumber code
> being evaluated just when one wants.
given that context originally was made for typesetting educational
looking at the 'blocks' mechanism (there are some examples in the test
suite under blocks)

Hans

-----------------------------------------------------------------