summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/eq-pin2corr/examples/get-hash-string.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/eq-pin2corr/examples/get-hash-string.tex')
-rw-r--r--macros/latex/contrib/eq-pin2corr/examples/get-hash-string.tex52
1 files changed, 52 insertions, 0 deletions
diff --git a/macros/latex/contrib/eq-pin2corr/examples/get-hash-string.tex b/macros/latex/contrib/eq-pin2corr/examples/get-hash-string.tex
new file mode 100644
index 0000000000..29422f836b
--- /dev/null
+++ b/macros/latex/contrib/eq-pin2corr/examples/get-hash-string.tex
@@ -0,0 +1,52 @@
+\documentclass{article}
+\usepackage[designv]{web}
+\usepackage{eforms}
+
+%\previewOn\pmpvOn
+
+\begin{defineJS}{\btnHashStrAct}
+var resp=app.response({
+ cQuestion: "Enter a PIN number",
+ cTitle: "Get Hash String"
+});
+if (resp !=null) {
+ var f=this.getField("txtHashStr");
+ var hashStr=Collab.hashString(resp);
+ f.value=hashStr;
+ f=this.getField("txtPINNum");
+ f.value=resp;
+ f=this.getField("txtdeclPINId");
+ f.value = "\\\\declPINId{"+resp+"}{"+hashStr+"}";
+}
+\end{defineJS}
+
+\parindent0pt
+
+\begin{document}
+
+\section*{Get Hash String from PIN number}
+
+\textbf{Extensive Instructions.} Create a four digit (PIN) number.
+Push the button and enter the four digit number you just created into the response box.
+When you press the \textsf{OK} button,
+the hash string of the PIN number you entered appears in the text field. The PIN number goes in as the
+first argument of \verb|\declPINId|, and the hash string is the second argument of \verb|\declPINId|; eg,
+\begin{verbatim}
+\declPINId{5243}{02JRVZdRgYgCA-Rtje8VkD} % PIN number, hash string
+\end{verbatim}
+
+\textbf{Brief Instructions.} Press \textsf{Push}, enter your PIN, press \textsf{OK}.\medskip\par\noindent
+\pushButton[\CA{Push}\AAmouseup{\btnHashStrAct}]{btn}{}{11bp}\olBdry
+\textField[\textSize{8}]{txtHashStr}{2in}{11bp} Chosen PIN: \textField[\textSize{8}]{txtPINNum}{\widthof{00000}}{11bp}
+\medskip\par\noindent
+%
+Save these two values as arguments of \verb|\declPINId| and place in the preamble of your
+quiz document.\medskip
+
+\noindent
+Copy to quiz document: \textField[\textSize{8}]{txtdeclPINId}{3in}{13bp}\olBdry
+\pushButton[\CA{Reset}\AAmouseup{this.resetForm();}]{reset}{}{13bp}
+
+
+
+\end{document}