From f35565737733e319e7293a9fafe1b78e87f8a14e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 21 Feb 2021 03:01:41 +0000 Subject: CTAN sync 202102210301 --- .../eq-pin2corr/examples/get-hash-string.pdf | Bin 0 -> 83433 bytes .../eq-pin2corr/examples/get-hash-string.tex | 52 +++++++++++ .../eq-pin2corr/examples/qz-pin-to-correct.pdf | Bin 0 -> 171609 bytes .../eq-pin2corr/examples/qz-pin-to-correct.tex | 99 +++++++++++++++++++++ 4 files changed, 151 insertions(+) create mode 100644 macros/latex/contrib/eq-pin2corr/examples/get-hash-string.pdf create mode 100644 macros/latex/contrib/eq-pin2corr/examples/get-hash-string.tex create mode 100644 macros/latex/contrib/eq-pin2corr/examples/qz-pin-to-correct.pdf create mode 100644 macros/latex/contrib/eq-pin2corr/examples/qz-pin-to-correct.tex (limited to 'macros/latex/contrib/eq-pin2corr/examples') 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 Binary files /dev/null and b/macros/latex/contrib/eq-pin2corr/examples/get-hash-string.pdf 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 Binary files /dev/null and b/macros/latex/contrib/eq-pin2corr/examples/qz-pin-to-correct.pdf 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} -- cgit v1.2.3