From 6b7ef024ba8f7c1560c7347a072db848c3555541 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 2 Jul 2021 06:04:52 +0900 Subject: thorshammer update --- texmf-dist/doc/latex/thorshammer/README.md | 8 +- texmf-dist/doc/latex/thorshammer/container.tex | 2 +- .../latex/thorshammer/examples/nosolns/thexrt.tex | 4 +- .../examples/ordinary-option/get-hash-string.tex | 35 ---- .../ordinary-option/quiz-pwd-to-correct-AA.tex | 190 --------------------- .../ordinary-option/quiz-pwd-to-correct-AR.tex | 174 ------------------- .../examples/ordinary-option/thqz-p2c.pdf | Bin 0 -> 143076 bytes .../examples/ordinary-option/thqz-p2c.tex | 181 ++++++++++++++++++++ .../doc/latex/thorshammer/folder-js/aeb-reader.js | 50 ------ .../doc/latex/thorshammer/folder-js/aeb_pro.js | 158 ----------------- .../doc/latex/thorshammer/install-action-seq.pdf | Bin 345357 -> 487300 bytes .../doc/latex/thorshammer/install-action-seq.tex | 81 +++++++++ .../system-scripts/standalone/00-class.cfg | 4 + .../system-scripts/standalone/csvTOcfg.ps1 | 67 ++++++++ .../system-scripts/standalone/mkclassFolders.ps1 | 60 +++++++ .../system-scripts/thors-structure/thmclass.ps1 | 109 ++++++++++-- texmf-dist/doc/latex/thorshammer/thmclass.pdf | Bin 207656 -> 1807261 bytes texmf-dist/doc/latex/thorshammer/thors-the-man.pdf | Bin 1388897 -> 1457397 bytes texmf-dist/doc/latex/thorshammer/thors-the-man.tex | 119 ++++++------- texmf-dist/doc/latex/thorshammer/thorshammer.pdf | Bin 6227257 -> 490931 bytes .../source/latex/thorshammer/thorshammer.dtx | 78 ++++++--- texmf-dist/tex/latex/thorshammer/thorshammer.sty | 53 +++--- 22 files changed, 636 insertions(+), 737 deletions(-) delete mode 100644 texmf-dist/doc/latex/thorshammer/examples/ordinary-option/get-hash-string.tex delete mode 100644 texmf-dist/doc/latex/thorshammer/examples/ordinary-option/quiz-pwd-to-correct-AA.tex delete mode 100644 texmf-dist/doc/latex/thorshammer/examples/ordinary-option/quiz-pwd-to-correct-AR.tex create mode 100644 texmf-dist/doc/latex/thorshammer/examples/ordinary-option/thqz-p2c.pdf create mode 100644 texmf-dist/doc/latex/thorshammer/examples/ordinary-option/thqz-p2c.tex delete mode 100644 texmf-dist/doc/latex/thorshammer/folder-js/aeb-reader.js delete mode 100644 texmf-dist/doc/latex/thorshammer/folder-js/aeb_pro.js create mode 100644 texmf-dist/doc/latex/thorshammer/install-action-seq.tex create mode 100644 texmf-dist/doc/latex/thorshammer/system-scripts/standalone/00-class.cfg create mode 100644 texmf-dist/doc/latex/thorshammer/system-scripts/standalone/csvTOcfg.ps1 create mode 100644 texmf-dist/doc/latex/thorshammer/system-scripts/standalone/mkclassFolders.ps1 diff --git a/texmf-dist/doc/latex/thorshammer/README.md b/texmf-dist/doc/latex/thorshammer/README.md index f4c622a1..fefee6b2 100644 --- a/texmf-dist/doc/latex/thorshammer/README.md +++ b/texmf-dist/doc/latex/thorshammer/README.md @@ -1,6 +1,6 @@ The thorshammer Package Author: D. P. Story -Dated: 2020-01-13 +Dated: 2021-06-24 WARNING: Adobe Acrobat DC or Adobe Acrobat XI is required for post PDF-creation. Any PDF-creator application is supported. @@ -20,6 +20,12 @@ Note: Unzip action-sequences.zip to obtain the action-sequences folder. If intriguing, install thorshammer and try this workflow. +What's New (2021-06-24) Moved aeb_pro.js to the acrotex.js package, which is + now required. Other minor changes and fixes. + +What's New (2020-01-21) Published password of action sequences. + + Enjoy! Now, I must get back to my retirement. diff --git a/texmf-dist/doc/latex/thorshammer/container.tex b/texmf-dist/doc/latex/thorshammer/container.tex index 4bfb64d7..9002d64d 100644 --- a/texmf-dist/doc/latex/thorshammer/container.tex +++ b/texmf-dist/doc/latex/thorshammer/container.tex @@ -8,7 +8,7 @@ %% \documentclass{article} \usepackage[designi]{web} -\usepackage{eforms} +\usepackage{eforms}[2020/12/14] \hypersetup{pdfpagemode=UseAttachments} %% \previewOn\pmpvOn \parindent0pt \parskip6pt diff --git a/texmf-dist/doc/latex/thorshammer/examples/nosolns/thexrt.tex b/texmf-dist/doc/latex/thorshammer/examples/nosolns/thexrt.tex index 7852cdc1..f94d5187 100644 --- a/texmf-dist/doc/latex/thorshammer/examples/nosolns/thexrt.tex +++ b/texmf-dist/doc/latex/thorshammer/examples/nosolns/thexrt.tex @@ -1,7 +1,7 @@ \documentclass{article} \usepackage{amstext} \usepackage{web} -\usepackage[usesumrytbls,allowrandomize]{exerquiz} +\usepackage[usesumrytbls,allowrandomize]{exerquiz} \usepackage{ran_toks} \usepackage[usebatch]{thorshammer} @@ -10,7 +10,7 @@ % It is important to freeze the seed so that (1) you can reproduce the exact % same quiz at a later time; (2) allow content written to the AUX file to % come up to date. This is important when using summary tables. -\useRandomSeed{1344524586} +\useRandomSeed{1344524586} \setInitMag{fitwidth} \hypersetup{pdfpagemode=UseNone} % don't need to see bookmarks diff --git a/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/get-hash-string.tex b/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/get-hash-string.tex deleted file mode 100644 index b20c438a..00000000 --- a/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/get-hash-string.tex +++ /dev/null @@ -1,35 +0,0 @@ -\documentclass{article} -\usepackage[designi]{web} -\usepackage{eforms} - -%\previewOn\pmpvOn - -\parindent0pt \parskip6pt - -\begin{document} - -\begin{defineJS}{\btnAct} -var resp=app.response({ - cQuestion: "Enter a PIN number", - cTitle: "Get Hash String" -}); -var f=this.getField("txt"); -if (resp!=null) f.value=Collab.hashString(resp); -\end{defineJS} - -Create a four digit (PIN) number and copy that number into the body of the -definition of the \verb|\PIN| command, which is defined in the source file -\texttt{quiz-pwd-to-correct-AR.tex}. This is to record and save the 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 -number you entered appears in the text field. Copy and paste this value into -the \texttt{quiz-pwd-to-correct-AR.tex} as the value of the -\texttt{\_PinCode} JavaScript variable. Now you're ready to compile the file -\texttt{quiz-pwd-to-correct-AR.tex}. - -\pushButton[\CA{Push}\AAmouseup{\btnAct}]{btn}{}{11bp}\olBdry -\textField[\textSize{8}]{txt}{2in}{11bp}\olBdry -\pushButton[\CA{Reset}\AAmouseup{this.resetForm();}]{reset}{}{11bp} - -\end{document} diff --git a/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/quiz-pwd-to-correct-AA.tex b/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/quiz-pwd-to-correct-AA.tex deleted file mode 100644 index e84d9781..00000000 --- a/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/quiz-pwd-to-correct-AA.tex +++ /dev/null @@ -1,190 +0,0 @@ -\documentclass{article} -\usepackage{amstext} -\usepackage[designi]{web} -\usepackage{exerquiz}[2019/10/14] - -%\previewOn\pmpvOn - -% save the original defn of \eq@@EndQuizButtonActions as \eq@@EndQuizButtonActionsSave -\efsave\eq@@EndQuizButtonActions\as\eq@@EndQuizButtonActionsDefSave - -\usepackage[ordinary]{thorshammer} - -\thQzHeaderL{PWD Quizzes} -\thQzHeaderCQ{Quiz 1} - -% save the revised defn of \eq@@EndQuizButtonActions as \eq@@EndQuizButtonActionsThorSave -\efsave\eq@@EndQuizButtonActions\as\eq@@EndQuizButtonActionsThorSave - -\renewcommand\eqQuizPointsMsg{% -"\eqptScore\space"+ptScore+" \eqOutOf\space"+nPointTotal} - -\let\app\textsf -\let\pkg\textsf -\let\uif\textsf -\let\env\texttt -\let\opt\texttt -\def\cs#1{\texttt{\char`\\#1}} - - -\execJSOn -\useBeginQuizButton[\CA{Begin}] -\useEndQuizButton[\CA{End}] - -% If the students have Acrobat, they can see the pin number -% if they know how; however, if we use a hash string, the actual -% PIN is not retained within document. -\def\PIN{5243} % PIN number, change as desired - -% save \CorrBtnActionsJS as \CorrBtnActionsJSSave -\efsave\CorrBtnActionsJS\as\CorrBtnActionsJSSave -\begin{defineJS*}[\makeesc\@]{\CorrBtnActionsPwdJS} -var resp=app.response({ - cQuestion: "Enter the PIN number", - cTitle: "View Answers", - bPassword: true -}); -var _resp=Collab.hashString(resp); -if (_resp==_PinCode) { - correctQuiz("@eqBaseName",@thequestionno); - if (typeof correctSumryTbl == "function") - correctSumryTbl("@eqBaseName",@thequestionno); -} -\end{defineJS*} - -\DeclareQuiz{qz1} - -\begin{execJS}{execjs} -this.addScript("Pin Code","var _PinCode = \"" + Collab.hashString("\PIN")+"\""); -\end{execJS} - -\begin{document} - -\section{Introduction} - -\noindent\textbf{Goal:} Make the \uif{Correct} button password -protected.\medskip - -\noindent\textbf{Discussion:} This file illustrates the methods -of protecting the \uif{Correct} button with a password. This -file requires \app{Acrobat} to create; while the companion file -(\texttt{quiz-pwd-to-correct-AR.tex}) does not. - -If only MC and MS questions are posed, the \pkg{thorshammer} -package is not needed; otherwise, it is needed to support the -other types of questions. - -Within \pkg{exerquiz} the command that holds the JavaScript -action of the \uif{Correct} button is \cs{CorrBtnActionsJS}. We -save this macro, and change over to \cs{CorrBtnActionsPwdJS}, -defined in the preamble. We use the commands \cs{efsave} and -\cs{efrestore}, defined in \pkg{eforms}, to change the default -action to the password action, and back again. We do the same -thing for the \uif{End Quiz} action. (\pkg{thorshammer} -redefines \cs{eq@@EndQuizButtonActions}, the JavaScript actio of -the \uif{End Quiz} button.) - - -\newpage - -\section{Quiz with PIN to correct} - -% require students to answer all questions -\renewcommand\minQuizResp{highThreshold} % 1 - -For the quiz below, the \uif{Correct} button has an encrypted -password. The password appears in parentheses for the convenience of the casual reader. - -% use password version of \CorrButton action -\efrestore\CorrBtnActionsJS\from\CorrBtnActionsPwdJS -\begin{quiz*}{\currQuiz} -Solve each -\begin{questions} - \item The sum of 1 and 1 is\dots -\begin{answers}{5} -\bChoices - \Ans0 0\eAns - \Ans0 1\eAns - \Ans1 2\eAns - \Ans0 3\eAns - \Ans0 4\eAns -\eChoices -\end{answers} -\item $9+8=\RespBoxMath{17}{1}{.0001}{[0,1]}\cgBdry\CorrAnsButton{17}$ -\end{questions} -\end{quiz*}\quad\PointsField{\currQuiz}\olBdry\CorrButton{\currQuiz} (PIN: \PIN)\vcgBdry - -\AnswerField{\currQuiz} - -\newpage - -\section{Quiz without PIN to correct} - -Now we try to create an ordinary \pkg{exerquiz} quiz without password protection. - -% restore \eq@@EndQuizButtonActions from its default defn -\efrestore\eq@@EndQuizButtonActions\from\eq@@EndQuizButtonActionsDefSave -% restore \CorrBtnActionsJS from \CorrBtnActionsJSSave -\efrestore\CorrBtnActionsJS\from\CorrBtnActionsJSSave - -\renewcommand\minQuizResp{lowThreshold} - -\begin{quiz*}{qz2} -Solve each -\begin{questions} - \item The sum of 1 and 1 is\dots -\begin{answers}{5} -\bChoices - \Ans0 0\eAns - \Ans0 1\eAns - \Ans1 2\eAns - \Ans0 3\eAns - \Ans0 4\eAns -\eChoices -\end{answers} -\item $9+8=\RespBoxMath{17}{1}{.0001}{[0,1]}\cgBdry\CorrAnsButton{17}$ -\end{questions} -\end{quiz*}\quad\PointsField{\currQuiz}\olBdry\CorrButton{\currQuiz}\vcgBdry - -\AnswerField{\currQuiz} - - -\newpage - -\section{Another quiz with PIN to correct} - -It is possible to have a different PIN number for this quiz (multiple PINs in one document), but -I see no need for this. - -\DeclareQuiz{qz3} - - -% restore \eq@@EndQuizButtonActions from \eq@@EndQuizButtonActionsThorSave -\efrestore\eq@@EndQuizButtonActions\from\eq@@EndQuizButtonActionsThorSave -% restore password protection for Correct button -\efrestore\CorrBtnActionsJS\from\CorrBtnActionsPwdJS - -% require students to answer all questions -\renewcommand\minQuizResp{highThreshold} - -\begin{quiz*}{qz3} -Solve each -\begin{questions} - \item The sum of 1 and 1 is\dots -\begin{answers}{5} -\bChoices - \Ans0 0\eAns - \Ans0 1\eAns - \Ans1 2\eAns - \Ans0 3\eAns - \Ans0 4\eAns -\eChoices -\end{answers} -\item $9+8=\RespBoxMath{17}{1}{.0001}{[0,1]}\cgBdry\CorrAnsButton{17}$ -\end{questions} -\end{quiz*}\quad\PointsField{\currQuiz}\olBdry\CorrButton{\currQuiz} (PIN: \PIN)\vcgBdry - -\AnswerField{\currQuiz} - - -\end{document} diff --git a/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/quiz-pwd-to-correct-AR.tex b/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/quiz-pwd-to-correct-AR.tex deleted file mode 100644 index 9123ce34..00000000 --- a/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/quiz-pwd-to-correct-AR.tex +++ /dev/null @@ -1,174 +0,0 @@ -% Requires Acrobat -\documentclass{article} -\usepackage{amstext} -\usepackage[designi]{web} -\usepackage{exerquiz}[2019/10/11] - -\efsave\eq@@EndQuizButtonActions\as\eq@@EndQuizButtonActionsDefSave - -\usepackage[ordinary]{thorshammer} - -\thQzHeaderL{PWD Quiz} -\thQzHeaderCQ{Quiz 1} - -\efsave\eq@@EndQuizButtonActions\as\eq@@EndQuizButtonActionsThorSave - -%\previewOn\pmpvOn - -\renewcommand\eqQuizPointsMsg{% -"\eqptScore\space"+ptScore+" \eqOutOf\space"+nPointTotal} - -\let\app\textsf -\let\pkg\textsf -\let\env\texttt -\let\opt\texttt -\let\uif\textsf - -\execJSOn -\useBeginQuizButton[\CA{Begin}] -\useEndQuizButton[\CA{End}] - -% If the students have Acrobat, they can see the pin number -% if they know how. - -\efsave\CorrBtnActionsJS\as\CorrBtnActionsJSSave -\begin{defineJS*}[\makeesc\@]{\CorrBtnActionsPwdJS} -var resp=app.response({ - cQuestion: "Enter the PIN number", - cTitle: "View Answers", - bPassword: true -}); -var _resp=Collab.hashString(resp); -if (_resp==_PinCode) { - correctQuiz("@eqBaseName",@thequestionno); - if (typeof correctSumryTbl == "function") - correctSumryTbl("@eqBaseName",@thequestionno); -} -\end{defineJS*} - -\DeclareQuiz{qz} - -\def\PIN{5243} % PIN number, change as desired -\begin{insDLJS}{pin}{Pin Code} -var _PinCode = "02JRVZdRgYgCA-Rtje8VkD"; -\end{insDLJS} - -\parindent0pt -\parskip6pt - -\begin{document} - -\noindent\textbf{Goal:} Make the \uif{Correct} button password protected.\medskip - -\noindent\textbf{Discussion:} -This demo file uses a \emph{hash string} to encode the password for the instructor to correct -the quiz, it avoids the use of \app{Adobe Acrobat} by getting the hash string from the -PDF \texttt{get-hash-string}. Copy the hash string generated from \texttt{get-hash-string} -as the value of the JavaScript variable \texttt{\_PinCode} in the \textsf{insDLJS} environment -seen in this source file for this document. Then, compile this document and distribute. - -%Delay the correction of this next quiz by expanding the new command -%\verb|\pwdCorrBtnJS|. - -\newpage - -\section{Quiz with PIN to correct} - -% require students to answer all questions -\renewcommand\minQuizResp{highThreshold} % 1 - -For the quiz below, the \uif{Correct} button has an encrypted -password. The password appears in parentheses for the convenience of the casual reader. - -% use password version of \CorrButton action -\efrestore\CorrBtnActionsJS\from\CorrBtnActionsPwdJS -\begin{quiz*}{\currQuiz} -Solve each -\begin{questions} - \item The sum of 1 and 1 is\dots -\begin{answers}{5} -\bChoices - \Ans0 0\eAns - \Ans0 1\eAns - \Ans1 2\eAns - \Ans0 3\eAns - \Ans0 4\eAns -\eChoices -\end{answers} -\item $9+8=\RespBoxMath{17}{1}{.0001}{[0,1]}\cgBdry\CorrAnsButton{17}$ -\end{questions} -\end{quiz*}\quad\PointsField{\currQuiz}\olBdry\CorrButton{\currQuiz} (PIN: \PIN)\vcgBdry - -\AnswerField{\currQuiz} - -\newpage - -\section{Quiz without PIN to correct} - -Now we try to create an ordinary \pkg{exerquiz} quiz without password protection. - -% restore \eq@@EndQuizButtonActions from its default defn -\efrestore\eq@@EndQuizButtonActions\from\eq@@EndQuizButtonActionsDefSave -% restore \CorrBtnActionsJS from \CorrBtnActionsJSSave -\efrestore\CorrBtnActionsJS\from\CorrBtnActionsJSSave - -\renewcommand\minQuizResp{lowThreshold} - -\begin{quiz*}{qz2} -Solve each -\begin{questions} - \item The sum of 1 and 1 is\dots -\begin{answers}{5} -\bChoices - \Ans0 0\eAns - \Ans0 1\eAns - \Ans1 2\eAns - \Ans0 3\eAns - \Ans0 4\eAns -\eChoices -\end{answers} -\item $9+8=\RespBoxMath{17}{1}{.0001}{[0,1]}\cgBdry\CorrAnsButton{17}$ -\end{questions} -\end{quiz*}\quad\PointsField{\currQuiz}\olBdry\CorrButton{\currQuiz}\vcgBdry - -\AnswerField{\currQuiz} - - -\newpage - -\section{Another quiz with PIN to correct} - -It is possible to have a different PIN number for this quiz (multiple PINs in one document), but -I see no need for this. - -\DeclareQuiz{qz3} - - -% restore \eq@@EndQuizButtonActions from \eq@@EndQuizButtonActionsThorSave -\efrestore\eq@@EndQuizButtonActions\from\eq@@EndQuizButtonActionsThorSave -% restore password protection for Correct button -\efrestore\CorrBtnActionsJS\from\CorrBtnActionsPwdJS - -% require students to answer all questions -\renewcommand\minQuizResp{highThreshold} - -\begin{quiz*}{qz3} -Solve each -\begin{questions} - \item The sum of 1 and 1 is\dots -\begin{answers}{5} -\bChoices - \Ans0 0\eAns - \Ans0 1\eAns - \Ans1 2\eAns - \Ans0 3\eAns - \Ans0 4\eAns -\eChoices -\end{answers} -\item $9+8=\RespBoxMath{17}{1}{.0001}{[0,1]}\cgBdry\CorrAnsButton{17}$ -\end{questions} -\end{quiz*}\quad\PointsField{\currQuiz}\olBdry\CorrButton{\currQuiz} (PIN: \PIN)\vcgBdry - -\AnswerField{\currQuiz} - -\end{document} \ No newline at end of file diff --git a/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/thqz-p2c.pdf b/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/thqz-p2c.pdf new file mode 100644 index 00000000..3c37ab22 Binary files /dev/null and b/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/thqz-p2c.pdf differ diff --git a/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/thqz-p2c.tex b/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/thqz-p2c.tex new file mode 100644 index 00000000..f9484694 --- /dev/null +++ b/texmf-dist/doc/latex/thorshammer/examples/ordinary-option/thqz-p2c.tex @@ -0,0 +1,181 @@ +\documentclass{article} +\usepackage{amstext} +\usepackage[designi]{web} +\usepackage{exerquiz}[2021/06/24] +\usepackage[!showscore]{eq-pin2corr}[2021/06/24] + +%\previewOn\pmpvOn + +\usepackage[ordinary]{thorshammer} + +\thQzHeaderL{Secured Quiz} +\thQzHeaderCQ{Quiz 1} + +% Thor's hammer modifies this definition, we restore it to its +% 'ordinary' definition. +\renewcommand\eqQuizPointsMsg{% +"\eqptScore\space"+ptScore+" \eqOutOf\space"+nPointTotal} + +\let\app\textsf +\let\pkg\textsf +\let\uif\textsf +\let\env\texttt +\let\opt\texttt +\def\cs#1{\texttt{\char`\\#1}} + + +\execJSOn +\useBeginQuizButton[\CA{Begin}] +\useEndQuizButton[\CA{End}] + +% the default PIN number for eq-pin2corr is 5243 +% +% 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} + +\DeclareQuiz{qz1} + +\begin{document} + +\section{Introduction} + +\noindent\textbf{Goal:} Make the \uif{Correct} button password protected. +This revised file now uses the +\pkg{\href{https://ctan.org/pkg/eq-pin2corr}{eq-pin2corr}} package to make +things simpler. Additional commands are introduced here to manage the smooth +transition from password PIN protection, to an ordinary quiz, and back to a +PIN protected quiz.\medskip + +\noindent\textbf{Discussion:} This file illustrates the methods for +protecting the \uif{Correct} button with a password. To create a PIN +protected \uif{Correct} button, expand \cs{usePINCorrBtn} (\pkg{eq-pin2corr}) +prior to the quiz. Following the quiz, use the commands \cs{restoreNormalEndQuiz} +(\pkg{exerquiz}) and \cs{restoreCorrBtn} (\pkg{eq-pin2corr}). The latter +restores the default action of the \uif{End Quiz} control, this is needed +because \pkg{thorshammer} changes this action to a custom action; +\cs{restoreCorrBtn} removes the PIN security of the \uif{Correct} control. + +There is another command \cs{useEndQuizThor} (\pkg{thorshammer}) is used to +modify the \uif{End Quiz} control to the action as defined by the +\pkg{thorshammer} package. Read additional comments found in the body and +source of this file. + + +\newpage + +\section{Quiz with PIN to correct} + +% require students to answer all questions +\renewcommand\minQuizResp{highThreshold} % 1 + +For the quiz below, the \uif{Correct} button has an encrypted +password. The password appears in parentheses for the convenience of the casual reader. + +% use password version of \CorrButton action +\usePINCorrBtn + +\begin{quiz*}{\currQuiz} +Solve each +\begin{questions} + \item The sum of 1 and 1 is\dots +\begin{answers}{5} +\bChoices + \Ans0 0\eAns + \Ans0 1\eAns + \Ans1 2\eAns + \Ans0 3\eAns + \Ans0 4\eAns +\eChoices +\end{answers} +\item $9+8=\RespBoxMath{17}{1}{.0001}{[0,1]}\cgBdry\CorrAnsButton{17}$ +\end{questions} +\end{quiz*}\quad\PointsField{\currQuiz}\olBdry\CorrButton{\currQuiz} (PIN: \numPINId)\vcgBdry + +\AnswerField{\currQuiz} + +\newpage + +\thQzHeaderL{Ordinary Quiz} +\thQzHeaderCQ{Quiz 2} + + +\section{Quiz without PIN to correct} + +Now we try to create an ordinary \pkg{exerquiz} quiz without password protection. + + +% Now do an ordinary quiz +\restoreNormalEndQuiz +\restoreCorrBtn + +\renewcommand\minQuizResp{lowThreshold} + +\begin{quiz*}{qz2} +Solve each +\begin{questions} + \item The sum of 1 and 1 is\dots +\begin{answers}{5} +\bChoices + \Ans0 0\eAns + \Ans0 1\eAns + \Ans1 2\eAns + \Ans0 3\eAns + \Ans0 4\eAns +\eChoices +\end{answers} +\item $9+8=\RespBoxMath{17}{1}{.0001}{[0,1]}\cgBdry\CorrAnsButton{17}$ +\end{questions} +\end{quiz*}\quad\PointsField{\currQuiz}\olBdry\CorrButton{\currQuiz}\vcgBdry + +\AnswerField{\currQuiz} + + +\newpage + +\thQzHeaderL{Secured Quiz} +\thQzHeaderCQ{Quiz 3} + + +\section{Another quiz with PIN to correct} + +It is possible to have a different PIN number for this quiz (multiple PINs in one document), but +I see no need for this. + +The previous quiz was a normal \pkg{exerquiz} quiz. We now want another PIN protected quiz, so +prior to this next quiz we expand \cs{usePINBtn} and \cs{useEndQuizThor}. The latter is a new +command that restores the default action of the \pkg{thorshammer} package to the \uif{End Quiz} event. + +\DeclareQuiz{qz3} + +\usePINCorrBtn +\useEndQuizThor + +% require students to answer all questions +\renewcommand\minQuizResp{highThreshold} + +\begin{quiz*}{qz3} +Solve each +\begin{questions} + \item The sum of 1 and 1 is\dots +\begin{answers}{5} +\bChoices + \Ans0 0\eAns + \Ans0 1\eAns + \Ans1 2\eAns + \Ans0 3\eAns + \Ans0 4\eAns +\eChoices +\end{answers} +\item $9+8=\RespBoxMath{17}{1}{.0001}{[0,1]}\cgBdry\CorrAnsButton{17}$ +\end{questions} +\end{quiz*}\quad\PointsField{\currQuiz}\olBdry\CorrButton{\currQuiz} (PIN: \numPINId)\vcgBdry + +\AnswerField{\currQuiz} + + +\end{document} diff --git a/texmf-dist/doc/latex/thorshammer/folder-js/aeb-reader.js b/texmf-dist/doc/latex/thorshammer/folder-js/aeb-reader.js deleted file mode 100644 index 87783f86..00000000 --- a/texmf-dist/doc/latex/thorshammer/folder-js/aeb-reader.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - AEB Adobe Acrobat Reader JavaScript Methods - - Copyright (C) 2019 AcroTeX.Net - D. P. Story - http://www.acrotex.net - - Version 1.0 -*/ -// console.println("Version 1.0 (Reader DC)"); -if ( typeof aebTrustedFunctions == "undefined") { - aebTrustedFunctions = app.trustedFunction( function ( doc, oFunction, oArgs ) - { - app.beginPriv(); - var retn = oFunction( oArgs, doc ); - app.endPriv(); - return retn; - }); -} -aebSaveAs = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - app.beginPriv(); - app.execMenuItem("Save"); - app.endPriv(); -}); -aebDocSaveAs = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - var Msg=function(e){return (aebDocSaveAs.msg==undefined)?("Doc SaveAs Error: " + e.toString()):aebDocSaveAs.msg;} - var Action=function(){return ((aebDocSaveAs.action==undefined)?null:eval(aebDocSaveAs.action));} - app.beginPriv(); - try { - return retn = doc.saveAs(oArgs); - } catch(e){console.println(Msg(e));Action();} - app.endPriv(); - aebDocSaveAs.msg=undefined; - aebDocSaveAs.action=undefined; -}); -aebBrowseForDoc = app.trustPropagatorFunction( function ( oArgs ) -{ - app.beginPriv(); - return retn = app.browseForDoc(oArgs); - app.endPriv(); -}); -aebLaunchURL=app.trustPropagatorFunction ( function ( oArgs ) -{ - app.beginPriv(); - var retn = app.launchURL(oArgs); - app.endPriv(); -}); - diff --git a/texmf-dist/doc/latex/thorshammer/folder-js/aeb_pro.js b/texmf-dist/doc/latex/thorshammer/folder-js/aeb_pro.js deleted file mode 100644 index 31c6c2fd..00000000 --- a/texmf-dist/doc/latex/thorshammer/folder-js/aeb_pro.js +++ /dev/null @@ -1,158 +0,0 @@ -/* - AEB Pro Document Assembly Methods - - Copyright (C) 2012 -- 2019 AcroTeX.Net - D. P. Story - http://www.acrotex.net - - Version 1.7.2 -*/ -// console.println("Version 1.7.2"); -if ( typeof aebTrustedFunctions == "undefined") { - aebTrustedFunctions = app.trustedFunction( function ( doc, oFunction, oArgs ) - { - app.beginPriv(); - var retn = oFunction( oArgs, doc ); - app.endPriv(); - return retn; - }); -} -aebAddWatermarkFromFile = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - app.beginPriv(); - return retn = doc.addWatermarkFromFile(oArgs); - app.endPriv(); -}); -aebImportIcon = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - app.beginPriv(); - return retn = doc.importIcon(oArgs); - app.endPriv(); -}); -aebInsertPages = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - var Msg=function(e){return (aebInsertPages.msg==undefined)?("Insert Pages Error: " + e.toString()):aebInsertPages.msg;} - app.beginPriv(); - try { doc.insertPages(oArgs); } catch(e) {console.println(Msg(e));} - app.endPriv(); - aebInsertPages.msg=undefined; -}) -aebAppOpenDoc = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - var Msg=function(e){return (aebAppOpenDoc.msg==undefined)?("App Open Doc Error: " + e.toString()):aebAppOpenDoc.msg;} - app.beginPriv(); - try { var retn = app.openDoc(oArgs); } catch(e) {console.println(Msg(e));} - app.endPriv(); - aebAppOpenDoc.msg=undefined; - return retn; -}) -aebImportTextData = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - app.beginPriv(); - return retn = doc.importTextData(oArgs); - app.endPriv(); -}); -aebImportSound = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - app.beginPriv(); - return retn = doc.importSound(oArgs); - app.endPriv(); -}); -aebSaveAs = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - app.beginPriv(); - app.execMenuItem("Save"); - app.endPriv(); -}); -// Version 1.7.2 -aebDocSaveAs = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - var Msg=function(e){return (aebDocSaveAs.msg==undefined)?("Doc SaveAs Error: " + e.toString()):aebDocSaveAs.msg;} - var Action=function(){return ((aebDocSaveAs.action==undefined)?null:eval(aebDocSaveAs.action));} - app.beginPriv(); - try { - return retn = doc.saveAs(oArgs); - } catch(e){console.println(Msg(e));Action();} - app.endPriv(); - aebDocSaveAs.msg=undefined; - aebDocSaveAs.action=undefined; -}); -aebExtractPages = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - app.beginPriv(); - return retn = doc.extractPages(oArgs); - app.endPriv(); -}); -aebMailDoc = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - app.beginPriv(); - return retn = doc.mailDoc(oArgs); - app.endPriv(); -}); -aebImportDataObject = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - app.beginPriv(); - return retn = doc.importDataObject(oArgs); - app.endPriv(); -}); -aebSignatureSign = app.trustPropagatorFunction( function ( oArgs, field ) -{ - app.beginPriv(); - return retn = field.signatureSign(oArgs); - app.endPriv(); -}); -aebSecurityHandlerLogin = app.trustPropagatorFunction( function ( oArgs, securityHandler ) -{ - app.beginPriv(); - return retn = securityHandler.login(oArgs); - app.endPriv(); -}); -aebSecurityGetHandler = app.trustPropagatorFunction( function ( oArgs, security ) -{ - app.beginPriv(); - return retn = security.getHandler(oArgs); - app.endPriv(); -}); -aebAppGetPath = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - app.beginPriv(); - var retn = app.getPath(oArgs); - app.endPriv(); - return retn; -}); -aebSignatureSetSeedValue = app.trustPropagatorFunction( function ( oArgs, field ) -{ - app.beginPriv(); - return retn = field.signatureSetSeedValue(oArgs); - app.endPriv(); -}); -aebAddIcon=app.trustPropagatorFunction( function ( oArgs, doc ) -{ - app.beginPriv(); - doc.addIcon(oArgs); - app.endPriv(); -}); -aebCreateTemplate = app.trustPropagatorFunction( function ( oArgs, doc ) -{ - var Msg=function(e){return (aebCreateTemplate.msg==undefined)?("Create Template Error: " + e.toString()):aebCreateTemplate.msg;} - app.beginPriv(); - try { doc.createTemplate(oArgs); } catch(e) {console.println(Msg(e));} - app.endPriv(); - aebCreateTemplate.msg=undefined; - -}) -// Version 1.7.1 removed doc from arg in browse and launch -aebBrowseForDoc=app.trustPropagatorFunction( function ( oArgs ) -{ - app.beginPriv(); - var retn = app.browseForDoc(oArgs); - app.endPriv(); -}); -// added aebLaunchURL Version 1.7 -aebLaunchURL=app.trustPropagatorFunction ( function ( oArgs ) -{ - app.beginPriv(); - var retn = app.launchURL(oArgs); - app.endPriv(); -}); - diff --git a/texmf-dist/doc/latex/thorshammer/install-action-seq.pdf b/texmf-dist/doc/latex/thorshammer/install-action-seq.pdf index e7a68382..ea8bae8e 100644 Binary files a/texmf-dist/doc/latex/thorshammer/install-action-seq.pdf and b/texmf-dist/doc/latex/thorshammer/install-action-seq.pdf differ diff --git a/texmf-dist/doc/latex/thorshammer/install-action-seq.tex b/texmf-dist/doc/latex/thorshammer/install-action-seq.tex new file mode 100644 index 00000000..98acf739 --- /dev/null +++ b/texmf-dist/doc/latex/thorshammer/install-action-seq.tex @@ -0,0 +1,81 @@ +\documentclass{article} +\usepackage[fleqn]{amsmath} +% +% the driver line is not necessary if you +% have aebpro.cfg configured to your driver. +% +\usepackage[web]{aeb_pro} +\usepackage{eforms} +\usepackage[altbullet]{lucidbry} +\usepackage{pifont} +\usepackage{graphicx} + +\usepackage{fancyvrb} + +\usepackage{xbmks} +\xbmksetup{colors={int=red},styles={intbf}} +%\DeclareInitView{layoutmag={navitab:UseOutlines}} +\hypersetup{pdfpagemode=UseOutlines} + +\makeatletter +\renewcommand{\paragraph} + {\@startsection{paragraph}{4}{0pt}{6pt}{-3pt} + {\normalfont\normalsize\bfseries}} +\renewcommand{\subparagraph} + {\@startsection{subparagraph}{5}{\parindent}{6pt}{-3pt}% + {\normalfont\normalsize\bfseries}} +\makeatother + +\mathindent\parindent + +\def\AEBP{\app{AeB Pro}} +\def\AEB{\app{AeB}} +\def\APB{\app{APB}} +\def\app#1{\textsf{#1}} +\def\amtIndent{\parindent} +\def\meta#1{$\langle\textit{\texttt{#1}}\rangle$} +\def\SC#1{{\small#1}} +\def\PDF{\SC{PDF}} +\let\uif\textsf +\let\opt\texttt + +%\reversemarginpar +\def\acInstr{How to install Action sequences in \textsf{Acrobat}} +\title{\acInstr} +\author{D. P. Story} +\email{dpstory@acrotex.net} +\version{1.0} +\revisionLabel{Published:} + +\begin{document} + +\maketitle + +\pdfbookmarkx[1]{The thorshammer package}[action={\GoToR/F(thors-the-man.pdf)/D[0 /Fit]},color=blue,style={bf}]{thorhammer} +\pdfbookmarkx[1]{Documentation of the system scripts}[action={\GoToR/F(thmclass.pdf)/D[0 /Fit]},color=blue,style={bf}]{sysscripts} + +\thispagestyle{empty} + +\begin{center}\large\bfseries + How to install action sequences +\end{center} + +\noindent \app{Acrobat XI} or later is required. Open \app{Acrobat} and +select \uif{Tools > Action Wizard}. Now select \uif{Manage Actions} to view +the \uif{Manage Actions} dialog box, refer to +\hyperref[fig:MA]{Figure~\ref*{fig:MA}} below. + +\begin{figure}[htb]\centering +\includegraphics[width=.67\linewidth]{graphics/manage-actions} +\caption{Manage Actions dialog box}\label{fig:MA} +\end{figure} + +\noindent \textbf{To import an Action sequence,} press the \uif{Import} +control and browse for the action sequence to be imported. Once you've +located the targeted action sequence, press the \uif{Open} control. This +imports the targeted sequence into the list the action sequences back in the +\uif{Manage Actions} dialog box. Press \uif{Close} to close this dialog box. +Before closing the \uif{Manage Actions} dialog box, you can, of course, +import additional action sequences. + +\end{document} diff --git a/texmf-dist/doc/latex/thorshammer/system-scripts/standalone/00-class.cfg b/texmf-dist/doc/latex/thorshammer/system-scripts/standalone/00-class.cfg new file mode 100644 index 00000000..fda6a2ef --- /dev/null +++ b/texmf-dist/doc/latex/thorshammer/system-scripts/standalone/00-class.cfg @@ -0,0 +1,4 @@ +\classMember{Muehle}{Waeter}{MW634B/_Thor} +\classMember{Anton}{Mueller}{AM256M/_Thor} +\classMember{Laura}{Voegt}{LM356B/_Thor} + diff --git a/texmf-dist/doc/latex/thorshammer/system-scripts/standalone/csvTOcfg.ps1 b/texmf-dist/doc/latex/thorshammer/system-scripts/standalone/csvTOcfg.ps1 new file mode 100644 index 00000000..87cda66f --- /dev/null +++ b/texmf-dist/doc/latex/thorshammer/system-scripts/standalone/csvTOcfg.ps1 @@ -0,0 +1,67 @@ +# Make a complete cfg for thorshammer package from a csv list +# accepted list delimiters: , or ;. Spaces ar not allowed! Replace all german umlauts +# with ue, oe, ae, ss to avoid problems with thorshammer package +# +# Example list: +# First Name|Last Name|Folder +# Anton;Müller;AM29914M +#\classMember{Anton}{Mueller}{AM299/instructor-name} +# Anton;Müller;*C:/.../AM299 +#\classMember{Anton}{Mueller}*{C:/.../AM299/instructor-name} +# +If ( $args.Length -eq 0 ) { + Write-Host "A CSV file of the class members is required," ` + "see documentation" + exit +} else { + $listName=$args[0] + if(Test-Path -Path ./$listName.csv) { + } else { + Write-Host "Cannot find the file `"$listName.csv`" in the current folder," ` + "check the spelling, do not include the extension." + exit + } +} +get-content "$listName.csv" | foreach { +"\classMember{" + $_ ` ++ "/_Thor}" ` +-Replace ";", "}{" ` +-Replace ",","}{" ` +-Replace "{\*", "*{" } | Set-Content "convertedList.cfg" + +# Store convertedList.cfg in a variable +$convertedListCfg = get-content .\convertedList.cfg -Raw + +# function to replace umlauts +# https://www.datenteiler.de/powershell-umlaute-ersetzen/ +function Replace-Umlaute ([string]$s) { + $UmlautObject = New-Object PSObject | Add-Member -MemberType NoteProperty -Name Name -Value $s -PassThru + + # hash tables are by default case insensitive + # we have to create a new hash table object for case sensitivity + + $characterMap = New-Object system.collections.hashtable + $characterMap.ä = "ae" + $characterMap.ö = "oe" + $characterMap.ü = "ue" + $characterMap.ß = "ss" + $characterMap.Ä = "Ae" + $characterMap.Ü = "Ue" + $characterMap.Ö = "Oe" + + foreach ($property in "Name") { + foreach ($key in $characterMap.Keys) { + $UmlautObject.$property = $UmlautObject.$property -creplace $key,$characterMap[$key] + } + } + $UmlautObject +} + +# replace umlauts in .cfg and make a correctedListCfg +$correctedListCfg = Replace-Umlaute "$convertedListCfg" +$correctedListCfg.Name + +# Finally append correctedListCfg to desired +# cfg file, usually class.cfg +add-content "00-class.cfg" $correctedListCfg.Name +Remove-Item convertedList.cfg diff --git a/texmf-dist/doc/latex/thorshammer/system-scripts/standalone/mkclassFolders.ps1 b/texmf-dist/doc/latex/thorshammer/system-scripts/standalone/mkclassFolders.ps1 new file mode 100644 index 00000000..7f7fcc3e --- /dev/null +++ b/texmf-dist/doc/latex/thorshammer/system-scripts/standalone/mkclassFolders.ps1 @@ -0,0 +1,60 @@ +$classPath="C:\Users\dpstory\Desktop\Test Folder\target\myClass" +# Create class folders +If ( $args.Length -eq 0 ) { + Write-Host "A CVS file of the class members is required," ` + "see documentation" + exit +} else { + $listName=$args[0] + if(Test-Path -Path ./$listName.csv) { + } else { + Write-Host "Cannot find the file `"$listName.csv`" in the current folder," ` + "check the spelling, do not include the extension." + exit + } +} +get-content "$listName.csv" | foreach { +$_ +">_Thor" -Replace ";","," } | Set-Content "commaList.csv" + +$argList=@() +get-content "commaList.csv" | %{ +# Write-Host "$_" + $split=$_.split(",") +# Write-Host $split[2] + $argList+=$split[2] +} +$currentPath=Convert-Path . +cd $classPath +Write-Host "Creating folder structure at `$classPath`"," ` + "with some exceptions" +for ($i=0; $i -lt $argList.length; $i++) { + $arg=$argList[$i] + $splitTwo=$argList[$i].split(">") + $firstName=$splitTwo[0] + $secondName=$splitTwo[1] + if ($firstName[0] -eq "*") { + $arg=$arg.substring(1) + $msg="Parsing the full path $arg" -Replace ">","/" + Write-Host $msg + Write-Host "Creating exceptional folders" + $firstName=$firstName.substring(1) +#Write-Host "$firstName" + Write-Host " Creating folder: $firstName" + New-Item $firstName -ErrorAction:Ignore -ItemType directory + $secondName=$firstName+"/$secondName" +#Write-Host "$secondName" + Write-Host " Creating folder: $secondName" + New-Item $secondName -ErrorAction:Ignore -ItemType directory + } else { + $msg="Parsing the relative path $arg" -Replace ">","/" + Write-Host $msg + Write-Host " Creating folder: $firstName" + New-Item $firstName -ErrorAction:Ignore -ItemType directory + cd $firstName + Write-Host " Creating subfolder of $firstName named: $secondName" + New-Item $secondName -ErrorAction:Ignore -ItemType directory + cd .. + } +} +cd $currentPath +Remove-Item commaList.csv diff --git a/texmf-dist/doc/latex/thorshammer/system-scripts/thors-structure/thmclass.ps1 b/texmf-dist/doc/latex/thorshammer/system-scripts/thors-structure/thmclass.ps1 index 2dcbc65c..7f1f72bf 100644 --- a/texmf-dist/doc/latex/thorshammer/system-scripts/thors-structure/thmclass.ps1 +++ b/texmf-dist/doc/latex/thorshammer/system-scripts/thors-structure/thmclass.ps1 @@ -1,3 +1,11 @@ +# Version 1.4 changes +# ===================================================================================================== +# small modifications of tex template +# remove some comments +# added partial support for cntdwn package, not fully working here to keep tex template small +# interested users should refer to Acrotex blog for further explanations +# anyway the template compiles without errors +# ===================================================================================================== # Version 1.3 changes # ===================================================================================================== # copyka.ps1 allows a comment character (#) @@ -415,7 +423,7 @@ New-Item "tex-template.tex" -ItemType file If ($locale -like "*$myLocale*") { # German ###################################### Set-Content "tex-template.tex" '%% Customize template ! %% -\documentclass[fontsize=11pt]{scrartcl} +\documentclass[fontsize=12pt]{scrartcl} \usepackage[% german, pro, @@ -424,17 +432,19 @@ navibar, forcolorpaper %forpaper ]{web} +% Page layout \usepackage[top=20mm,left=20mm,right=20mm,bottom=25mm]{geometry} +%\useFullWidthForPaper \usepackage[usesumrytbls,allowrandomize]{exerquiz} \usepackage{ran_toks} \usepackage[% % usebatch % copy to class folder -batchdistr % only copy to instructors folder -% testmode % testing quizzes +% batchdistr % only copy to instructors folder +testmode % testing quizzes ]{thorshammer} \hypersetup{pdfencoding=auto} % include or remove hyperref options %\usepackage{thorshammerConf} % place your own sty file here -\usepackage[autostyle=true]{csquotes} % change quotes globally +%\usepackage[autostyle=true]{csquotes} % change quotes globally \DeclareQuiz{q#number} \setInitMag{fitwidth} @@ -454,8 +464,8 @@ batchdistr % only copy to instructors folder %\DeclareCoverPage{0} % Header settings -\thQzName{#theme} % Thema -\thQzHeaderL{#class} % Klasse +\thQzName{#theme} +\thQzHeaderL{#class} \thQzHeaderCQ{#subject: \thqzname} \thQzHeaderCS{Lösungen: \thqzname} @@ -464,7 +474,7 @@ batchdistr % only copy to instructors folder \subject{#subject} \author{#instrName} \keywords{#time} -\university{Freiherr-vom-Stein-Berufskolleg} % change to your institution +\university{Freiherr-vom-Stein-Berufskolleg} \version{#number} \copyrightyears{#date} @@ -475,9 +485,26 @@ batchdistr % only copy to instructors folder \sadMultQuizzes \end{makeClassFiles} +% Timer settings, this are personal settings for a timer in the quiz, if you want that, refer to +% http://www.acrotex.net/blog/?p=450 +% with \usepackage[shortcount]{cntdwn} + +% \newcommand{\thorTimer}[2]{% +% \setShortCntDwn{CntDwnTimer1} +% {% +% length=#1*\minutes, +% notify1=#2*\minutes, +% event1=AllowEndQuiz1, +% event2=NoAction, +% event3=NoAction, +% endEvent=EndTheQuiz1 +% } +% } +%\thorTimer{#time}{10} % original command \setShortCntDwn + \begin{document} + \makeinlinetitle -% Instructions % Declare Quiz bodys \declareQuizBody{qzbody1} @@ -487,11 +514,22 @@ batchdistr % only copy to instructors folder \begin{qzbody1} \bRTVToks{\currQuiz} -% Change margin settings for summary tables, and set it back after -% \thQuizHeader execution -\newgeometry{top=20mm,left=30mm,right=20mm,bottom=25mm} \thQuizHeader -\newgeometry{top=20mm,left=20mm,right=20mm,bottom=25mm} + +% priorInitQuiz for the timer, see Timer settings +\begin{defineJS}[\makeesc\!]{\priorInitQuiz} +this.getField("endQuiz.!thisQuiz").display=display.hidden; +qtypesReadOnly("!thisQuiz",false); +\end{defineJS} + +% postInitQuiz for timer, see Timer settings +\begin{defineJS}[\makeesc\!]{\postInitQuiz} +AllowEndQuiz1.arg="!currQuiz"; +EndTheQuiz1.arg="!currQuiz"; +sStartTimer(_oCntDwnTimer1); +\end{defineJS} + +% Instructions here \begin{quiz*}{\currQuiz} % Bearbeiten Sie folgende Aufgaben. @@ -526,7 +564,11 @@ Set-Content "tex-template.tex" '%% Customize template ! %% \usepackage{web} \usepackage[usesumrytbls,allowrandomize]{exerquiz} \usepackage{ran_toks} -\usepackage[usebatch]{thorshammer} +\usepackage[% +% usebatch % copy to class folder +% batchdistr % only copy to instructors folder +testmode % testing quizzes +]{thorshammer} \DeclareQuiz{q#number} @@ -560,8 +602,8 @@ Set-Content "tex-template.tex" '%% Customize template ! %% %\DeclareCoverPage{0} % Header settings -\thQzName{#theme} % topic -\thQzHeaderL{#class} % class +\thQzName{#theme} +\thQzHeaderL{#class} \thQzHeaderCQ{#subject: \thqzname} \thQzHeaderCS{Solutions: \thqzname} @@ -581,14 +623,51 @@ Set-Content "tex-template.tex" '%% Customize template ! %% \sadMultQuizzes \end{makeClassFiles} +% Timer settings, this are personal settings +% for a timer in the quiz, if you want that, refer to % +% http://www.acrotex.net/blog/?p=450 + +% \newcommand{\thorTimer}[2]{% +% \setShortCntDwn{CntDwnTimer1} +% {% +% length=#1*\minutes, +% notify1=#2*\minutes, +% event1=AllowEndQuiz1, +% event2=NoAction, +% event3=NoAction, +% endEvent=EndTheQuiz1 +% } +% } +%\thorTimer{#time}{10} % original command \setShortCntDwn + + \begin{document} + +% Declare quiz bodies \declareQuizBody{qzbody1} +%\declareQuizBody{qzbody2} +%\declareQuizBody{qzbody3} +%\declareQuizBody{qzbody4} + \begin{qzbody1} \bRTVToks{\currQuiz} \thQuizHeader +% priorInitQuiz for the timer, see Timer settings +\begin{defineJS}[\makeesc\!]{\priorInitQuiz} +this.getField("endQuiz.!thisQuiz").display=display.hidden; +qtypesReadOnly("!thisQuiz",false); +\end{defineJS} + +% postInitQuiz for timer, see Timer settings +\begin{defineJS}[\makeesc\!]{\postInitQuiz} +AllowEndQuiz1.arg="!currQuiz"; +EndTheQuiz1.arg="!currQuiz"; +sStartTimer(_oCntDwnTimer1); +\end{defineJS} + % Instructions \begin{quiz*}{\currQuiz} Solve each of these problems, passing is 100\%. diff --git a/texmf-dist/doc/latex/thorshammer/thmclass.pdf b/texmf-dist/doc/latex/thorshammer/thmclass.pdf index 50e2da72..642cd178 100644 Binary files a/texmf-dist/doc/latex/thorshammer/thmclass.pdf and b/texmf-dist/doc/latex/thorshammer/thmclass.pdf differ diff --git a/texmf-dist/doc/latex/thorshammer/thors-the-man.pdf b/texmf-dist/doc/latex/thorshammer/thors-the-man.pdf index d67db59e..6e4416d3 100644 Binary files a/texmf-dist/doc/latex/thorshammer/thors-the-man.pdf and b/texmf-dist/doc/latex/thorshammer/thors-the-man.pdf differ diff --git a/texmf-dist/doc/latex/thorshammer/thors-the-man.tex b/texmf-dist/doc/latex/thorshammer/thors-the-man.tex index be267d67..82b71cb5 100644 --- a/texmf-dist/doc/latex/thorshammer/thors-the-man.tex +++ b/texmf-dist/doc/latex/thorshammer/thors-the-man.tex @@ -78,7 +78,7 @@ email={dpstory@acrotex.net}, subject=Documentation for the thorshammer package, talksite={\url{www.acrotex.net}}, - version={1.5.7, 2020/01/13}, + version={1.5.11, 2021/06/24}, Keywords={assessment workflow, LaTeX, AcroTeX}, copyrightStatus=True, copyrightNotice={Copyright (C) \the\year, D. P. Story}, @@ -209,46 +209,49 @@ Thor's way. \section{Preliminaries} Most important is the correct installation of \pkg{thorshammer} along with -its required packages and folder JavaScript files. +its required packages and folder JavaScript files. These are discussed in +this section. \subsection{Package requirements} -The most recent version of the packages \pkg{insdljs} (2019/10/23), -\pkg{exerquiz} (2019/10/13), \pkg{eq-save} (2019/08/07) are required. These three packages -were modified slightly to obtain features needed by \pkg{thorshammer}. +The most recent version of the packages \pkg{insdljs} (2021/06/19), +\pkg{exerquiz} (2021/05/29), \pkg{eq-save} (2021/04/27) are required. These +three packages were modified slightly to obtain features needed by +\pkg{thorshammer}. -The \pkg{thorshammer} package ships with two folder JavaScript files -\texttt{aeb\_pro.js}\FmtMP{\textsf{aeb\_pro.js}} (Version 1.7.2 or later, +The \pkg{thorshammer} package requires the folder JavaScript files +\texttt{aeb\_pro.js}\FmtMP{\textsf{aeb\_pro.js}} (Version 1.6.2 or later, required) and \texttt{aeb-reader.js}\FmtMP{\textsf{aeb-reader.js}} (Version -1.0 or later); these two are found in \texttt{folder-js} -folder\FmtMP{\texttt{folder-js} folder}. The latter is a new JavaScript file, -the former ships with the \pkg{aeb\_pro} package. These files give access to +1.0 or later); these two are distributed by the +\pkg{acrotex-js}\FmtMP{\pkg{acrotex-js} pkg} package, dated 2021/06/24 or +later, and are found in \texttt{js-files} folder +of the distribution of \pkg{acrotex-js}. These files give access to security restricted JavaScript methods. If you already have \pkg{aeb\_pro} -installed, be sure you have Version 1.7.2 of \texttt{aeb\_pro.js}, if not, -install Version 1.7.2 provided by this distribution. +installed, be sure you have Version 1.6.2 of \texttt{aeb\_pro.js}, if not, +install Version 1.6.2 provided by the \pkg{acrotex-js} distribution. The \texttt{aeb\_pro.js} is used on the instructor's system, along with -\app{Acrobat} (\app{AA}), to author quizzes. \app{Distiller} is not used unless the -author prefers a TEX $\rightarrow$ DVI $\rightarrow$ PS $\rightarrow$ PDF -workflow, using \app{Distiller} as the PDF creator. For this workflow, -\app{pdflatex}, \app{lualatex}, and \app{xelatex} will work as PDF creators; -however, \app{Acrobat} ia needed to execute the JavaScript code generated by -the command \cs{sadQuizzes} and to execute the action sequences provided by -this package. +\app{Acrobat} (\app{AA}), to author quizzes. \app{Distiller} is not used +unless the author prefers a TEX $\rightarrow$ DVI $\rightarrow$ PS +$\rightarrow$ PDF workflow, using \app{Distiller} as the PDF creator. For +this workflow, \app{pdflatex}, \app{lualatex}, and \app{xelatex} will work as +PDF creators; however, \app{Acrobat} is needed to execute the JavaScript code +generated by the command \cs{sadQuizzes} and to execute the action sequences +provided by this package. Once the quizzes are created, the author can take the quizzes in \app{Adobe Reader} (\app{AR}) to get the same experience as his students. Additionally, -\texttt{aeb-reader.js} can be installed on the instructor's system and on the -student's work environment, if possible/permitted. \texttt{aeb-reader.js} +\texttt{aeb-reader.js}\FmtMP{\textsf{aeb-reader.js}} can be installed on the +student's work environment, if possible/permitted; \texttt{aeb-reader.js} contains a subset of JavaScript methods taken from \texttt{aeb\_pro.js} that \emph{will enhance student experience}. The author can install this file on his system to take the quizzes in the same environment, again using \app{Adobe Reader}. \textbf{Warning:}\FmtMP{\textbf{Warning}} Do not install -\texttt{aeb\_pro.js} in any folder where an \app{Adobe Reader} used by -students would read it. +\texttt{aeb\_pro.js} in any folder where an \app{Adobe Reader} is used by +students. \paragraph*{Other enhancements to user experience.} \app{Adobe Reader} is by default in \uif{Protected Mode}. -Then \uif{Protected Mode} is enabled, one or more security dialog boxes popup +When \uif{Protected Mode} is enabled, one or more security dialog boxes popup as the student saves his/her document. To eliminate this annoyance, clear the \uif{Enable Protected Mode at startup} checkbox, as shown in the \hyperref[fig:PM]{Figure~\ref*{fig:PM}}. On your personal system, open @@ -272,10 +275,10 @@ the sysadmin\FmtMP{sysadmin permission} to make those changes. %\pkg{aeb\_pro} package, though the package itself is not required. As a convenience, %\texttt{aeb\_pro.js} is also include in the \texttt{folder-js} folder. -\paragraph*{Installation of JS files for \app{Acrobat}.} The JavaScript file \texttt{aeb-reader.js} -is provided in the \texttt{folder-js} folder. Discussion of how and where to -install folder JavaScript files is found in the file -\texttt{docs/install\_jsfiles.pdf}. Read and follow the directions carefully. +\paragraph*{Installation of JS files for \app{Acrobat}.} The description of the installation of +the JavaScript file \texttt{aeb\_pro.js} is provided by the \pkg{acrotex-js} +package; read the \texttt{install\_jsfiles.pdf} file found in the +\texttt{docs} folder of the \pkg{acrotex-js} package. \paragraph*{Installation of JS files for \app{Adobe Reader}.} The folder JavaScript file \texttt{aeb-reader.js} may be installed for use by \app{Adobe Reader} as @@ -283,11 +286,12 @@ well. Installing \texttt{aeb-reader.js} enhances the experience of the students as they save their quiz document after completing the quiz. Normally, it is not possible to install such a JavaScript file for use by students; however, if the students take the quiz in a Computer Lab, the -sysadmin can install \texttt{aeb-reader.js} on all the computers used in the +sysadmin\FmtMP{sysadmin} can install \texttt{aeb-reader.js} on all the computers used in the Computer Lab. Discussion of how and where to install folder JavaScript files -is found in the file \texttt{docs/install\_jsfiles.pdf}. Read and follow the -directions carefully. (\app{Reader} looks for its folder JavaScript files in -the same location where \app{Acrobat} would look for them.) +is found in the file \texttt{docs/install\_jsfiles.pdf} of the +\pkg{acrotex-js} package. Read and follow the directions carefully. +(\app{Reader} looks for its folder JavaScript files in the same location +where \app{Acrobat} would look for them.) \subsection{Package options} @@ -1938,7 +1942,7 @@ distribution. to see if there are any errors. The attachment to this file contains the quiz results, save and do with them what you will, perhaps merging them into a larger spreadsheet. - \item \textbf{\textsf{Thor protects} action.} Applies to a collection of + \item \textbf{\textsf{Thor protects} action.}\FmtMP{Secret password is \texttt{"acrotex"}} Applies to a collection of newly created quizzes that specify the \opt{batchdistr} option. Running this action places security on the quizzes so the student's cannot view the answers even if they are using \app{Acrobat}. @@ -1958,7 +1962,7 @@ distribution. quizzes to the students folders, you can use \textsf{Thor distributes} to accomplish that task. \end{itemize} - \item \textbf{\textsf{Thor protects and distributes} action.} Applies to + \item \textbf{\textsf{Thor protects and distributes} action.}\FmtMP{Secret password is \texttt{"acrotex"}} Applies to a collection of newly created quizzes that specify the \opt{batchdistr} option. Refer to \hyperref[ss:bd]{Section~\ref{ss:bd}} for more details. The action is @@ -1987,6 +1991,10 @@ distribution. see \hyperref[item:RS]{item~\ref*{item:RS}} titled \textbf{Remove Security}. After removing security, we continue with the \textsf{Thor's way} action. \end{itemize} +\textbf{A Note on Password Protection.} The default password for the two +action sequences is \texttt{"acrotex"}. This can be changed for your system +by editing the two sequences from within the \app{Acrobat} user interface and +changing the password there. \section{Further discussion of Basic Methods} @@ -2118,40 +2126,25 @@ system drive that students have access to, designated as SD (system drive). \section{The \tops{\protect\opt{ordinary}}{ordinary} option}\label{ordinary} This option was prompted by an \pkg{exerquiz} user who had a unique problem: -He wanted to put password protection on the \uif{Correct} button of an -\pkg{exerquiz} quiz. He wanted to distribute quizzes to his students. The -students would take the quiz, and, on pressing the \uif{End Quiz} button, -would get their score, but the \uif{Correct} button would be denied to them -through a password mechanism. +He wanted to put password protection (PIN security) on the \uif{Correct} +button of an \pkg{exerquiz} quiz. He wanted to distribute quizzes to his +students. The students would take the quiz, and, on pressing the \uif{End +Quiz} button, would get their score, but the \uif{Correct} button would be +denied to them through a password mechanism. Solving this problem necessitated some of the special features of -\pkg{thorshammer}, without the use of \cs{sadQuizzes}. +\pkg{thorshammer}, without the use of \cs{sadQuizzes}, as well as the creation +of a few new commands. To see the solution to this problem, go to the -\texttt{examples/orginary-option} folder. There are three files in that -folder: -\begin{itemize} - \item {\ttfamily quiz-pwd-to-correct-AA.tex}: This file requires the use - of \app{Acrobat} to create the quizzes. The password is dynamically - encoded as the PDF is loaded into \app{Acrobat} for the first time. - \item {\ttfamily quiz-pwd-to-correct-AR.tex}: Again, the \uif{Correct} - button is password protected, only \app{Adobe Reader} is required - to build this file; however, the encrypted password cannot be built - dynamically. It must be first computed and hard-wired placed in the - source document. - \item {\ttfamily get-hash-string.tex}: This is a companion file to the - `AR' version described above. Build this file using any method. - Open it in \app{Adobe Reader} and press the \uif{Push} button. A - response dialog box opens, enter your chosen password (PIN number) - and press \uif{OK}. The hash string of your password appears on the - text field. Copy the password (or PIN) and the hash string to - {\ttfamily quiz-pwd-to-correct\allowbreak-AR.tex}. Comment out the human readable - password in your file and paste the hash string into the value of - the \texttt{\_PinCode} JavaScript variable, then build the file - {\ttfamily quiz-pwd-to\allowbreak-correct-AR.tex}. Now, the \uif{Correct} - button is password (PIN) protected. +\texttt{examples/orginary-option} folder to find the demo file +\texttt{thqz-p2c.tex}. This file uses the +\pkg{\href{https://ctan.org/pkg/eq-pin2corr}{eq-pin2corr}} package.\footnote{\pkg{eq-pin2corr} is +a package capable of placing PIN security (and other security) on an \pkg{exerquiz} quiz, apart from the +use of the \pkg{thorshammer} package.} +Additional discussion of the techniques and special ``transition'' commands +is found in the demo document. -\end{itemize} \section{My retirement} diff --git a/texmf-dist/doc/latex/thorshammer/thorshammer.pdf b/texmf-dist/doc/latex/thorshammer/thorshammer.pdf index 6e6c6fba..2ca79e94 100644 Binary files a/texmf-dist/doc/latex/thorshammer/thorshammer.pdf and b/texmf-dist/doc/latex/thorshammer/thorshammer.pdf differ diff --git a/texmf-dist/source/latex/thorshammer/thorshammer.dtx b/texmf-dist/source/latex/thorshammer/thorshammer.dtx index b50d035d..864fc977 100644 --- a/texmf-dist/source/latex/thorshammer/thorshammer.dtx +++ b/texmf-dist/source/latex/thorshammer/thorshammer.dtx @@ -16,11 +16,14 @@ % %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{thorshammer} -% [2020/01/13 v1.5.7 Support commands for Thor's way] +% [2021/06/24 v1.5.11 Support commands for Thor's way] %<*driver> \documentclass{ltxdoc} \usepackage[colorlinks,hyperindex=false,linktocpage,bookmarksnumbered]{hyperref} \usepackage{calc} +\makeatletter +\let\@latex@warning@no@line\@gobble +\makeatother %\def\texorpdfstring#1#2{#1} %\pdfstringdefDisableCommands{\let\\\textbackslash} \OnlyDescription % comment out for implementation details @@ -33,6 +36,7 @@ \let\opt\texttt \let\app\textsf \let\pkg\textsf +\let\uif\textsf \let\tops\texorpdfstring \def\EXCL{!} \def\nmpsep#1{\hskip-\marginparsep\texttt{#1}} @@ -99,6 +103,8 @@ questions, bug detecting, and motivation. High regards and respect to both. D. P % This package supports the Thorsten's workflow by providing the necessary form elements and JavaScript % to carry out his(her) plan. What happens to the quiz after that, I do not know. % +%\changes{v1.5.8}{2020/01/21}{Published password of \string\texttt{"acrotex"} for the two +%security related action sequences} %\changes{v1.4}{2019/08/11}{Begin major change to this package, leaving v1.3.8 as our best working % version prior to this update. } % @@ -166,11 +172,13 @@ questions, bug detecting, and motivation. High regards and respect to both. D. P % \end{macrocode} % \subsection{Required packages} % \begin{macrocode} -\RequirePackage{insdljs}[2019/08/06] +\RequirePackage{insdljs}[2021/06/19] % \end{macrocode} % We use the \opt{usealtadobe} option of \pkg{insdljs}, but not directly. If \cs{inputAltAdbFncs} % is \cs{relax} than the functions have not already been input above \pkg{thorshammer}. % \changes{v1.3.5}{2019/08/06}{Use \string\cs{usedAdbFuncs} to detect \string\opt{usealtadobe} option} +% \changes{v1.5.11}{2021/06/24}{Require \string\pkg{insdljs} dated 2021/06/19 or later, which +% itself requires \string\pkg{acrotex-js}.} % \begin{macrocode} \ifx\usedAdbFuncs\dl@NO \def\inputAltAdbFncs{\InputIfFileExists{altadbfncs.def}% @@ -182,8 +190,8 @@ questions, bug detecting, and motivation. High regards and respect to both. D. P \let\inputAltAdbFncs\relax \fi \inputAltAdbFncs -\RequirePackage{exerquiz}[2019/08/13] -\RequirePackage{eq-save}[2019/08/07] +\RequirePackage{exerquiz}[2021/05/29] +\RequirePackage{eq-save}[2021/04/27] \let\execjs\dl@YES \@ifundefined{CommentStream}{\newwrite\CommentStream}{} \def\csarg#1#2{\expandafter#1\csname#2\endcsname} @@ -918,14 +926,14 @@ new Array("PointsField.\currQuiz","EssayField.\currQuiz"));\r % name (\cmd\currQuiz); \texttt{@p(2)} is the number of questions; and \texttt{@p(3)} is % the password. % \begin{macrocode} -\begin{defineJS}[\catcode`\@=0\relax]{\pwdKeyJS} +\begin{defineJS}[\makeesc\@]{\pwdKeyJS} if (event.willCommit) { if (event.value==@p(3)) { @commonPassKey } } \end{defineJS} -\begin{defineJS}[\catcode`\@=0\relax]{\commonPassKey} +\begin{defineJS}[\makeesc\@\makecmt\%]{\commonPassKey} % \end{macrocode} % Added code from \cs{qz@IDTxtField} to avoid the dreaded `q1 is undefined' % JavaScript error message. This happends when the \textsf{Mark It} control @@ -941,8 +949,9 @@ if (typeof @oField=="undefined") var @oField=new Object; restoreQuizData(); this.calculate=true; +@ifthtestmode@else% var f=this.getField("postQzMsg"); -if (f!=null) f.display=display.hidden; +if (f!=null) f.display=display.hidden;@fi var f=this.getField("pbStuSvCl"); if (f!=null) f.display=display.hidden; var f=this.getField("ScoreField.@p(1)"); @@ -993,7 +1002,7 @@ problem, assigning the maximum instead"} % \changes{v1.1.3}{2019/07/03}{Remove lines not needed since \string\cs{LngPtsFld} became % a calculation field} % \begin{macrocode} -\begin{defineJS}[\makeesc\@\catcode`\%=14\relax]{\essayQKey} +\begin{defineJS}[\makeesc\@\makecmt\%]{\essayQKey} if (event.willCommit) { var qpts=(1*event.value); if (isNaN(qpts)) { @@ -1163,7 +1172,7 @@ cFilenameInit: cSave }); if(\instrAutoClose&&bOK) this.closeDoc(true); } \end{insDLJS} -\begin{defineJS}[\catcode`\@=0\relax]{\freezeQuizMU} +\begin{defineJS}[\makeesc\@]{\freezeQuizMU} var f, fname; var bOK=true; if(@instrAutoSave) { @@ -1277,7 +1286,8 @@ if(bOk)} \toks@=\expandafter{\postSubmitQuiz\t\t oRecordOfQuizData["ProbDist.\oField"]=ProbDist;\r\t\t oRecordOfQuizData["RightWrong.\oField"]=RightWrong;\r\t\t - var f=this.getField("postQzMsg");\r\t\t + \ifthtestmode\else + var f=this.getField("postQzMsg");\r\t\t\fi if (f!=null) f.display=display.visible;\r\t\t var f=this.getField("pbStuSvCl");\r\t\t if (\stuAutoSave&&f!=null)f.display=display.visible;} %\r\t\t @@ -1298,10 +1308,10 @@ beginning.\n\n Press \\"Yes\\" to end the quiz."} \def\ThorsAlertTitle#1{\flJSStr*[noquotes]{\ThorsAlert@Title}{#1}} \ThorsAlertTitle{"Thor's Hammer"} % \end{macrocode} -% \DescribeMacro\eq@EndQzBtnScript The modified script for the end of the +% \DescribeMacro\eq@EndQzBtnScriptThor The modified script for the end of the % dps0624 % quiz button. We rework the script of \cs{eq@@EndQuizButtonActions}, taken from \pkg{exerquiz}. % \begin{macrocode} -\begin{defineJS}[\makeesc\*\catcode`\%=14\relax]{\eq@EndQzBtnScript} +\begin{defineJS}[\makeesc\*\makecmt\%]{\eq@EndQzBtnScriptThor} if (!isQuizInitialized("*currQuiz")) eqAppAlert(InitMsg("*bqlabelISO"),3); else { @@ -1312,7 +1322,7 @@ cTitle: *ThorsAlert@Title, nIcon: 2, nType: 2}); *currQuiz.PtValues=(new % Array(*pointValuesArray)); ProbType=[*ptypeArray]; -*if@inclkey% +*if@inclkey *currQuiz.CorrAns=(new % Array(*corrAnsArray)); *fi% @@ -1331,7 +1341,16 @@ Array(*corrAnsArray)); % \end{macrocode} % Now, we redefine \cs{eq@@EndQuizButtonActions} of \pkg{exerquiz}. % \begin{macrocode} -\def\eq@@EndQuizButtonActions{\A{\JS{\eq@EndQzBtnScript}}} +\def\eq@@EndQuizButtonActions{\A{\JS{\eq@EndQzBtnScriptThor}}} % dps0624 +\let\eq@@EndQuizButtonActionsThorSave\eq@@EndQuizButtonActions % dps0624 +% \end{macrocode} +% Define \DescribeMacro\useEndQuizThor\cs{useEndQuizThor} to restore the \uif{End Quiz} +% control to the action defined in this package. (Other packages may removed this +% \uif{End Quiz} action.) +% \changes{v1.5.11}{2021/06/24}{Define \string\cs{useEndQuizThor}} +% \begin{macrocode} +\def\useEndQuizThor{\let\eq@@EndQuizButtonActions + \eq@@EndQuizButtonActionsThorSave} % \end{macrocode} % Add a \textsf{SaveAs} menu item to end of the quiz % \changes{v1.1.4}{2019/07/04}{Add a SaveAs menu item to end of the quiz} @@ -1403,7 +1422,7 @@ Array(*corrAnsArray)); \newif\ifUseStuSaveAsDialog\UseStuSaveAsDialogfalse \def\useStuSaveAsDialogOn{\UseStuSaveAsDialogtrue} \def\useStuSaveAsDialogOff{\UseStuSaveAsDialogfalse} -\begin{defineJS}[\makeesc\*\catcode`\%=14\relax]{\autoSaveStuJS} +\begin{defineJS}[\makeesc\*\makecmt\%]{\autoSaveStuJS} var bOK=true; global.bOkClose=true; var _path=this.path; @@ -1773,9 +1792,14 @@ Array(*corrAnsArray)); % under the name of \texttt{\ameta{name}.cut}. % \changes{v1.4}{2019/08/11}{Changes to \string\cs{InputBodyQuiz} % to support solution sets} +% \changes{v1.5.9}{2020/05/29}{Defined public \string\cs{qzLtr} version +% of \string\cs{theth@qzCnt}} +% \changes{v1.5.10}{2021/05/31}{Added \string\cs{qzLtr} the public version of +% \string\cs{theth@qzCnt}} % \begin{macrocode} \newcounter{th@qzCnt} \def\theth@qzCnt{\alph{th@qzCnt}} +\let\qzLtr\theth@qzCnt % dps5-29 \newcommand{\InputQuizBody}[1]{\newpage %\thPageOne \@ifundefined{thisQuizOrig}{\edef\thisQuizOrig{\thisQuiz} \let\Hy@EveryPageAnchor\relax}{}\stepcounter{th@qzCnt}% @@ -1806,13 +1830,15 @@ Array(*corrAnsArray)); % so the another rendition to write solutions to a fresh file. % \begin{macrocode} \immediate\openout \quiz@solns \jobname.qsl - \@ifundefined{ps@webheadings}{% - \def\th@QzHeaderL{\th@QzHeaderLQ}% - \def\th@QzHeaderC{\th@QzHeaderCQ}% - }{% - \lheader{\th@QzHeaderLQ}% - \cheader{\th@QzHeaderCQ}% - }% + \ifthordinary\else + \@ifundefined{ps@webheadings}{% + \def\th@QzHeaderL{\th@QzHeaderLQ}% + \def\th@QzHeaderC{\th@QzHeaderCQ}% + }{% + \lheader{\th@QzHeaderLQ}% + \cheader{\th@QzHeaderCQ}% + }% + \fi } % \end{macrocode} % \subsection{Building quizzes with \tops{\protect\env}{}{makeClassFiles} \& \tops{\protect\cs}{\textbackslash}{sadQuizzes}} @@ -1855,8 +1881,10 @@ Array(*corrAnsArray)); \def\setArrayLength{\ifbasicmethods0\else lst.length\fi} \def\setfilesuffix{\ifuseclassOpt"-"+fN+"_"+lN\else \ifbasicmethods""\else"-"+(i+1)\fi\fi+".pdf"} -\begin{defineJS}[\def\defineJSjsR{^^J}\let\u\relax - \catcode`\@=0\relax]{\sadQuizzes} +% \end{macrocode} +% Begin \cs{sadQuizzes} here. +% \begin{macrocode} +\begin{defineJS}[\dfnJSCR{^^J}\let\u\relax\makeesc\@]{\sadQuizzes} % \end{macrocode} % If \cs{autoCopyOff}, then this script does nothing % \begin{macrocode} @@ -2165,7 +2193,7 @@ app.clearTimeOut(toSa);",50); % \begin{macrocode} \documentclass{article} \usepackage[designi]{web} -\usepackage{eforms} +\usepackage{eforms}[2020/12/14] \hypersetup{pdfpagemode=UseAttachments} %% \previewOn\pmpvOn \parindent0pt \parskip6pt diff --git a/texmf-dist/tex/latex/thorshammer/thorshammer.sty b/texmf-dist/tex/latex/thorshammer/thorshammer.sty index a2571433..355f5794 100644 --- a/texmf-dist/tex/latex/thorshammer/thorshammer.sty +++ b/texmf-dist/tex/latex/thorshammer/thorshammer.sty @@ -19,7 +19,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{thorshammer} - [2020/01/13 v1.5.7 Support commands for Thor's way] + [2021/06/24 v1.5.11 Support commands for Thor's way] \RequirePackage{xkeyval} \edef\th@dquoteCat{\the\catcode`\"} \catcode`\"=12\relax @@ -44,7 +44,7 @@ \let\distrToStudentsOff\relax\let\distrToStudentsOff\relax}} \ProcessOptionsX \edef\thOrdQz{\ifthordinary true\else false\fi} -\RequirePackage{insdljs}[2019/08/06] +\RequirePackage{insdljs}[2021/06/19] \ifx\usedAdbFuncs\dl@NO \def\inputAltAdbFncs{\InputIfFileExists{altadbfncs.def}% {\PackageInfo{insdljs}{Inputting code for usealtadobe option}}% @@ -55,8 +55,8 @@ \let\inputAltAdbFncs\relax \fi \inputAltAdbFncs -\RequirePackage{exerquiz}[2019/08/13] -\RequirePackage{eq-save}[2019/08/07] +\RequirePackage{exerquiz}[2021/05/29] +\RequirePackage{eq-save}[2021/04/27] \let\execjs\dl@YES \@ifundefined{CommentStream}{\newwrite\CommentStream}{} \def\csarg#1#2{\expandafter#1\csname#2\endcsname} @@ -342,14 +342,14 @@ new Array("PointsField.\currQuiz","EssayField.\currQuiz"));\r \addtocounter{questionno}{-1}}}}\global \let\qMark@Hook\qMark@HookSave}} \def\essayitem#1{\essayQ{#1}\item\PTs{#1}} -\begin{defineJS}[\catcode`\@=0\relax]{\pwdKeyJS} +\begin{defineJS}[\makeesc\@]{\pwdKeyJS} if (event.willCommit) { if (event.value==@p(3)) { @commonPassKey } } \end{defineJS} -\begin{defineJS}[\catcode`\@=0\relax]{\commonPassKey} +\begin{defineJS}[\makeesc\@\makecmt\%]{\commonPassKey} if(typeof aQuizzesInDoc=="undefined") var aQuizzesInDoc=new Array(); if (aQuizzesInDoc.indexOf("@oField")) @@ -358,8 +358,9 @@ if (typeof @oField=="undefined") var @oField=new Object; restoreQuizData(); this.calculate=true; +@ifthtestmode@else% var f=this.getField("postQzMsg"); -if (f!=null) f.display=display.hidden; +if (f!=null) f.display=display.hidden;@fi var f=this.getField("pbStuSvCl"); if (f!=null) f.display=display.hidden; var f=this.getField("ScoreField.@p(1)"); @@ -390,7 +391,7 @@ enter a nonnegative number only"} \def\TooMuchCreditMsg#1{\flJSStr*[noquotes]{\cTooMuchCredit}{#1}} \TooMuchCreditMsg{"You've assigned too much credit for this % problem, assigning the maximum instead"} -\begin{defineJS}[\makeesc\@\catcode`\%=14\relax]{\essayQKey} +\begin{defineJS}[\makeesc\@\makecmt\%]{\essayQKey} if (event.willCommit) { var qpts=(1*event.value); if (isNaN(qpts)) { @@ -496,7 +497,7 @@ cFilenameInit: cSave }); if(\instrAutoClose&&bOK) this.closeDoc(true); } \end{insDLJS} -\begin{defineJS}[\catcode`\@=0\relax]{\freezeQuizMU} +\begin{defineJS}[\makeesc\@]{\freezeQuizMU} var f, fname; var bOK=true; if(@instrAutoSave) { @@ -568,7 +569,8 @@ if(bOk)} \toks@=\expandafter{\postSubmitQuiz\t\t oRecordOfQuizData["ProbDist.\oField"]=ProbDist;\r\t\t oRecordOfQuizData["RightWrong.\oField"]=RightWrong;\r\t\t - var f=this.getField("postQzMsg");\r\t\t + \ifthtestmode\else + var f=this.getField("postQzMsg");\r\t\t\fi if (f!=null) f.display=display.visible;\r\t\t var f=this.getField("pbStuSvCl");\r\t\t if (\stuAutoSave&&f!=null)f.display=display.visible;} %\r\t\t @@ -579,7 +581,7 @@ any of your answers without starting the quiz over from the beginning.\n\n Press \\"Yes\\" to end the quiz."} \def\ThorsAlertTitle#1{\flJSStr*[noquotes]{\ThorsAlert@Title}{#1}} \ThorsAlertTitle{"Thor's Hammer"} -\begin{defineJS}[\makeesc\*\catcode`\%=14\relax]{\eq@EndQzBtnScript} +\begin{defineJS}[\makeesc\*\makecmt\%]{\eq@EndQzBtnScriptThor} if (!isQuizInitialized("*currQuiz")) eqAppAlert(InitMsg("*bqlabelISO"),3); else { @@ -590,7 +592,7 @@ cTitle: *ThorsAlert@Title, nIcon: 2, nType: 2}); *currQuiz.PtValues=(new % Array(*pointValuesArray)); ProbType=[*ptypeArray]; -*if@inclkey% +*if@inclkey *currQuiz.CorrAns=(new % Array(*corrAnsArray)); *fi% @@ -605,7 +607,10 @@ Array(*corrAnsArray)); } } \end{defineJS} -\def\eq@@EndQuizButtonActions{\A{\JS{\eq@EndQzBtnScript}}} +\def\eq@@EndQuizButtonActions{\A{\JS{\eq@EndQzBtnScriptThor}}} % dps0624 +\let\eq@@EndQuizButtonActionsThorSave\eq@@EndQuizButtonActions % dps0624 +\def\useEndQuizThor{\let\eq@@EndQuizButtonActions + \eq@@EndQuizButtonActionsThorSave} \let\stuASOn\ef@YES \def\stuAutoSaveOn{\let\stuASOn\ef@YES \def\stuAutoSaveScript{\t app.execMenuItem("SaveAs");\r}% @@ -630,7 +635,7 @@ Array(*corrAnsArray)); \newif\ifUseStuSaveAsDialog\UseStuSaveAsDialogfalse \def\useStuSaveAsDialogOn{\UseStuSaveAsDialogtrue} \def\useStuSaveAsDialogOff{\UseStuSaveAsDialogfalse} -\begin{defineJS}[\makeesc\*\catcode`\%=14\relax]{\autoSaveStuJS} +\begin{defineJS}[\makeesc\*\makecmt\%]{\autoSaveStuJS} var bOK=true; global.bOkClose=true; var _path=this.path; @@ -804,6 +809,7 @@ Array(*corrAnsArray)); \immediate\closeout\CommentStream}} \newcounter{th@qzCnt} \def\theth@qzCnt{\alph{th@qzCnt}} +\let\qzLtr\theth@qzCnt % dps5-29 \newcommand{\InputQuizBody}[1]{\newpage %\thPageOne \@ifundefined{thisQuizOrig}{\edef\thisQuizOrig{\thisQuiz} \let\Hy@EveryPageAnchor\relax}{}\stepcounter{th@qzCnt}% @@ -826,13 +832,15 @@ Array(*corrAnsArray)); \renewcommand\sqslsecrunhead{\eq@sqslsecrunhead}% \eq@noformstrue \immediate\openout \quiz@solns \jobname.qsl - \@ifundefined{ps@webheadings}{% - \def\th@QzHeaderL{\th@QzHeaderLQ}% - \def\th@QzHeaderC{\th@QzHeaderCQ}% - }{% - \lheader{\th@QzHeaderLQ}% - \cheader{\th@QzHeaderCQ}% - }% + \ifthordinary\else + \@ifundefined{ps@webheadings}{% + \def\th@QzHeaderL{\th@QzHeaderLQ}% + \def\th@QzHeaderC{\th@QzHeaderCQ}% + }{% + \lheader{\th@QzHeaderLQ}% + \cheader{\th@QzHeaderCQ}% + }% + \fi } \def\mkClFlsSpcls{\let\oct\eqbs\let\u\relax} \newenvironment{makeClassFiles}{% @@ -842,8 +850,7 @@ Array(*corrAnsArray)); \def\setArrayLength{\ifbasicmethods0\else lst.length\fi} \def\setfilesuffix{\ifuseclassOpt"-"+fN+"_"+lN\else \ifbasicmethods""\else"-"+(i+1)\fi\fi+".pdf"} -\begin{defineJS}[\def\defineJSjsR{^^J}\let\u\relax - \catcode`\@=0\relax]{\sadQuizzes} +\begin{defineJS}[\dfnJSCR{^^J}\let\u\relax\makeesc\@]{\sadQuizzes} if(@bFlattenState) this.addScript({ cName: "thorshammer: Do not flatten", -- cgit v1.2.3