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 \startanswer..\stopanswer inside \startexercise..\stopexercise and using \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 materials including questions, answers, explanations ... how about looking at the 'blocks' mechanism (there are some examples in the test suite under blocks)
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------