Using the answer at How to let users type in clozes in PDF?, I was able to create a cloze document where users type in the fill-in-the-blanks in a PDF. I used the code in a macro, so it calls the same \field[cloze]
multiple times.
\setupinteraction[state=start]
\definefield[cloze][line]
\starttext
Frogs have four \field[cloze] and two eyes.
Frogs have four \field[cloze] and two eyes.
Frogs have four \field[cloze] and two eyes.
Frogs have four \field[cloze] and two eyes.
\stoptext
<<-- Try typing in one field and it copies to the other fields.
The problem is when users fill in the first cloze, Adobe Acrobat automatically fills in all of the other clozes with the exact same value. I need the user to type different values in.
\setupinteraction[state=start]
\definefield[cloze1][line]
\definefield[cloze2][line]
\definefield[cloze3][line]
\definefield[cloze4][line]
\starttext
Frogs have four \field[cloze1] and two eyes.
Frogs have four \field[cloze2] and two eyes.
Frogs have four \field[cloze3] and two eyes.
Frogs have four \field[cloze4] and two eyes.
\stoptext
<<-- Try typing in one field and it no longer copies to the other fields.
Now the solution in a Minimal Working Answer is to change \field[cloze] to have different names for each cloze, such as \field[tree] and \field[mountain], the problem is, I'm using it embedded within some complex macros. I tried using \field[#1] to send a different value, and \field[\expanded[#1]] and \field[\randomnumber{0}{10000000}], \def\somevalue{\randomnumber{0}{10000000}}\field{\expanded{somevalue}}, etc. and many many other combinations of code, but everything I attempt fails to compile. Due to it being deep in many layers of macros, I can't manually chane \field[cloze] to other values.
How can I use the code from the answer, but in a way that each cloze is a place where users can type a unique value, and that value doesn't get automatically copies to every cloze?
\field{\expanded{somevalue}}
won't do anything. You need something like\expanded{\field[\somevalue]}
.