Debian Codegraph @

texmf-dist/doc/latex/eq-pin2corr/examples/get-hash-string.tex

raw
1 \documentclass{article}
2 \usepackage[designv]{web}
3 \usepackage{eforms}
4
5 %\previewOn\pmpvOn
6 \def\cs#1{\texttt{\eqbs#1}}
7
8 \begin{defineJS}{\btnHashStrAct}
9 var resp=app.response({
10 cQuestion: "Enter a PIN number",
11 cTitle: "Get Hash String"
12 });
13 if (resp !=null) {
14 var f=this.getField("txtHashStr");
15 var hashStr=Collab.hashString(resp);
16 f.value=hashStr;
17 f=this.getField("txtPINNum");
18 f.value=resp;
19 f=this.getField("txtdeclPINId");
20 f.value = "\\\\declPINId{"+resp+"}{"+hashStr+"}";
21 f=this.getField("txtdeclPINId");
22 var g=this.getField("txtdeclRePINId");
23 g.value = "\\\\declRePINId{"+resp+"}{"+hashStr+"}";
24
25 }
26 \end{defineJS}
27
28 \parindent0pt
29
30 \begin{document}
31
32 \section*{Get Hash String from PIN number}
33
34 \textbf{Extensive Instructions.} Create a four digit (PIN) number.
35 Push the button and enter the four digit number you just created into the response box.
36 When you press the \textsf{OK} button,
37 the hash string of the PIN number you entered appears in the text field. The PIN number goes in as the
38 first argument of \verb|\declPINId| (\verb|\declRePINId|), and the hash string is the second argument of
39 \verb|\declPINId| (\verb|\declRePINId|); eg,
40 \begin{verbatim}
41 \declPINId{5243}{02JRVZdRgYgCA-Rtje8VkD} % PIN/hash string (default)
42 \declRePINId{1234}{By9mbLF0NJMA2sN2x4D0VB} % PIN/hash string (default)
43 \end{verbatim}
44 Normally, the PIN numbers for \cs{declPINId} and \cs{declRePINId} are different.\medskip
45
46 \textbf{Brief Instructions.} Press \textsf{Push}, enter your PIN, press \textsf{OK}.\medskip\par\noindent
47 \pushButton[\CA{Push}\AAmouseup{\btnHashStrAct}]{btn}{}{11bp}\olBdry
48 \textField[\textSize{8}]{txtHashStr}{2in}{11bp} Chosen PIN: \textField[\textSize{8}]{txtPINNum}{\widthof{00000}}{11bp}
49 \medskip\par\noindent
50 %
51 Save these two values as arguments of \verb|\declPINId| and place in the preamble of your
52 quiz document.\medskip
53
54 \noindent
55 For \cs{declPINId}, copy to quiz document:\\[6pt]\null
56 \hspace{15pt}\textField[\textSize{8}]{txtdeclPINId}{3in}{13bp}\vcgBdry[6pt]
57 For \cs{declRePINId}, copy to quiz document:\\[6pt]\null
58 \hspace{15pt}\textField[\textSize{8}]{txtdeclRePINId}{3in}{13bp}\vcgBdry[6pt]
59 \pushButton[\CA{Reset}\AAmouseup{this.resetForm();}]{reset}{}{13bp}
60
61
62
63
64 \end{document}