Hi
Wolfgang,
Thanks for the
solution you sent yesterday.
Your solutions solves
the problem I was fighting with, but when I try to apply it to my real
document there is an issue when some questions don’t have answers. This
prevents the synchronization of Questions and Answers if one doesn't
issue the commands
\beginanswer
\incrementcounter[answer]
\endanswer
right after a question
without an answer. And when the above commands are issued, the last
Question does not show the link to its corresponding Answer.
Below is your modified example
where one can see the problem (please see the fifth Question in the
source below).
Best
regards: OK
%%%% begin example-ws.tex
\setupinteraction[state=start]
\newcounter\QuestionCounter
\newcounter\AnswerCounter
\define[1]\QuestionTextCommand
{\doglobal\increment\QuestionCounter
\pagereference[question:\QuestionCounter]%
\doifreferencefoundelse{answer:\QuestionCounter}
{\goto{#1}[answer:\QuestionCounter]}
{#1}}
\define[1]\AnswerTextCommand
{\doglobal\increment\AnswerCounter
\pagereference[answer:\AnswerCounter]%
\doifreferencefoundelse{question:\AnswerCounter}
{\goto{#1}[question:\AnswerCounter]}
{#1}}