summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/eq-pin2corr/examples
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-02-21 03:01:41 +0000
committerNorbert Preining <norbert@preining.info>2021-02-21 03:01:41 +0000
commitf35565737733e319e7293a9fafe1b78e87f8a14e (patch)
tree197b08b39b09262f4e71486f610106580871631d /macros/latex/contrib/eq-pin2corr/examples
parentb94dba90d83866ccb6db5273d214512e859c3179 (diff)
CTAN sync 202102210301
Diffstat (limited to 'macros/latex/contrib/eq-pin2corr/examples')
-rw-r--r--macros/latex/contrib/eq-pin2corr/examples/get-hash-string.pdfbin0 -> 83433 bytes
-rw-r--r--macros/latex/contrib/eq-pin2corr/examples/get-hash-string.tex52
-rw-r--r--macros/latex/contrib/eq-pin2corr/examples/qz-pin-to-correct.pdfbin0 -> 171609 bytes
-rw-r--r--macros/latex/contrib/eq-pin2corr/examples/qz-pin-to-correct.tex99
4 files changed, 151 insertions, 0 deletions
diff --git a/macros/latex/contrib/eq-pin2corr/examples/get-hash-string.pdf b/macros/latex/contrib/eq-pin2corr/examples/get-hash-string.pdf
new file mode 100644
index 0000000000..c1920bddba
--- /dev/null
+++ b/macros/latex/contrib/eq-pin2corr/examples/get-hash-string.pdf
Binary files differ
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}
diff --git a/macros/latex/contrib/eq-pin2corr/examples/qz-pin-to-correct.pdf b/macros/latex/contrib/eq-pin2corr/examples/qz-pin-to-correct.pdf
new file mode 100644
index 0000000000..1fca51e00a
--- /dev/null
+++ b/macros/latex/contrib/eq-pin2corr/examples/qz-pin-to-correct.pdf
Binary files differ
diff --git a/macros/latex/contrib/eq-pin2corr/examples/qz-pin-to-correct.tex b/macros/latex/contrib/eq-pin2corr/examples/qz-pin-to-correct.tex
new file mode 100644
index 0000000000..b084b55c5a
--- /dev/null
+++ b/macros/latex/contrib/eq-pin2corr/examples/qz-pin-to-correct.tex
@@ -0,0 +1,99 @@
+\documentclass{article}
+\usepackage[designv,forcolorpaper]{web}
+\usepackage{exerquiz}[2021/02/17]
+\usepackage[!showscore]{eq-pin2corr}
+
+%\previewOn\pmpvOn
+
+\useBeginQuizButton[\CA{Begin}]
+\useEndQuizButton[\CA{End}]
+\showCreditMarkup % optional
+\let\uif\textsf
+\useMCCircles % optional
+
+%
+% When building your own quiz document, decide on a PIN number
+% then use the utility document get-hash-string.pdf to acquire
+% the corresponding hash string. Place your own PIN and hash string
+% in the two arguments of \declPINId.
+\declPINId{5243}{02JRVZdRgYgCA-Rtje8VkD} % PIN number, hash string
+% So instructor can bypass entering the PIN.
+\classPINVar{_PinCode1}
+
+\parindent0pt
+\parskip6pt
+
+\begin{document}
+
+\section*{PIN Security for Quizzes}
+
+This demo file implements a feature that prevents that student from
+correcting his/her own quiz. The \uif{Correct} button appears at the end of
+the quiz, but a PIN number is needed for it to execute. For the purpose of
+this demo files, the PIN number is given to the right of the \uif{Correct}
+button; of course, the PIN is not given to the student. \verb~:-{)~ Test it
+out: (1) take the test; (2) press the \uif{End} button; (3) save and close
+the document; (4) open the document and press the \uif{Correct} button, the
+graded quiz should be reported. \textsf{Adobe Reader DC} (or \textsf{Adobe
+Acrobat}) is required for the document to function as designed.
+
+\usePINCorrBtn
+
+\begin{quiz*}{qz1}
+Solve each, passing is 100\%.
+\begin{questions}
+ \item The sum of 1 and 1 is \dots
+\begin{answers}{8}
+\bChoices
+ \Ans0 0\eAns
+ \Ans0 1\eAns
+ \Ans1 2\eAns
+ \Ans0 3\eAns
+ \Ans0 4\eAns
+\eChoices
+\end{answers}
+ \item $ \cos(\pi) = \RespBoxMath{-1}{1}{.0001}{[0,1]}\cgBdry\kern1bp
+\CorrAnsButton{-1} $
+
+\item $\displaystyle\frac{d}{dx}{\sin(x)}=\RespBoxMath{cos(x)}{4}{.0001}{[0,1]}\cgBdry\kern1bp
+\CorrAnsButton{cos(x)} $
+\end{questions}
+\end{quiz*}\quad\ScoreField[\rectW{2.25in}]\currQuiz\olBdry\CorrButton{\currQuiz} (PIN: \numPINId)
+
+\noindent
+Answers: \AnswerField\currQuiz
+
+% remove this \end{document} and recompile. This next quiz has no PIN security.
+\end{document}
+
+\section*{No PIN security}
+
+To restore the default definition of the \verb|\CorrButton| action, expand
+the freshly defined macro \verb|\restoreCorrBtnJS|.
+
+% restore the Correct button to its normal/default behavior: the student
+% can get his/her score and the quiz is marked up.
+\restoreCorrBtn
+
+\begin{quiz*}{qz2}
+Solve each, passing is 100\%.
+\begin{questions}
+ \item The sum of 1 and 1 is \dots
+\begin{answers}{8}
+\bChoices
+ \Ans0 0\eAns
+ \Ans0 1\eAns
+ \Ans1 2\eAns
+ \Ans0 3\eAns
+ \Ans0 4\eAns
+\eChoices
+\end{answers}
+ \item $ \cos(\pi) = \RespBoxMath{-1}{1}{.0001}{[0,1]}\cgBdry\kern1bp
+\CorrAnsButton{-1} $
+
+\item $\displaystyle\frac{d}{dx}{\sin(x)}=\RespBoxMath{cos(x)}{4}{.0001}{[0,1]}\cgBdry\kern1bp
+\CorrAnsButton{cos(x)} $
+\end{questions}
+\end{quiz*}\quad\PointsField{\currQuiz}\olBdry\CorrButton{\currQuiz}
+
+\end{document}