From 85afca4d393e935c93f01a4797141b0261d2743f Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 2 Oct 2019 10:10:53 +0900 Subject: eq-save (20191001) --- texmf-dist/doc/latex/eq-save/README.md | 4 +- texmf-dist/doc/latex/eq-save/eqsave-man.pdf | Bin 249427 -> 250534 bytes texmf-dist/doc/latex/eq-save/eqsave-man.tex | 2 +- .../doc/latex/eq-save/examples/eqsave-noname.pdf | Bin 108324 -> 189713 bytes texmf-dist/source/latex/eq-save/eq-save.dtx | 66 ++++++++++++++------- texmf-dist/tex/latex/eq-save/eq-save.sty | 39 ++++++++---- tlpkg/texlive.tlpdb | 6 +- 7 files changed, 78 insertions(+), 39 deletions(-) diff --git a/texmf-dist/doc/latex/eq-save/README.md b/texmf-dist/doc/latex/eq-save/README.md index 47c13ad8..7605893a 100644 --- a/texmf-dist/doc/latex/eq-save/README.md +++ b/texmf-dist/doc/latex/eq-save/README.md @@ -1,6 +1,6 @@ The eq-save Package Author: D. P. Story -Dated: 2018-04-07 +Dated: 2019-08-07 In the past, Adobe Reader did not save form data; consequently, work done by the student is lost when the AeB document is closed. In the more recent @@ -17,6 +17,8 @@ Interactive document, such as those produced by AeB (including exerquiz) require Adobe Reader. Any such AeB document must be viewed in AR, outside a browser. +What's New (2019-08-07) Minor reorganization of internal and public commands. + What's New (2018-04-07) Bug fix, occassionally the data was not being recorded correctly. diff --git a/texmf-dist/doc/latex/eq-save/eqsave-man.pdf b/texmf-dist/doc/latex/eq-save/eqsave-man.pdf index f7467bc9..183f77c7 100644 Binary files a/texmf-dist/doc/latex/eq-save/eqsave-man.pdf and b/texmf-dist/doc/latex/eq-save/eqsave-man.pdf differ diff --git a/texmf-dist/doc/latex/eq-save/eqsave-man.tex b/texmf-dist/doc/latex/eq-save/eqsave-man.tex index 5efff180..7aad833d 100644 --- a/texmf-dist/doc/latex/eq-save/eqsave-man.tex +++ b/texmf-dist/doc/latex/eq-save/eqsave-man.tex @@ -43,7 +43,7 @@ email={dpstory@acrotex.net}, subject=Documentation for the eq-save package, talksite={\url{www.acrotex.net}}, - version={1.1, 2018/04/07}, + version={1.2.5, 2019/08/07}, Keywords={LaTeX, form field, hints, AcroTeX}, copyrightStatus=True, copyrightNotice={Copyright (C) \the\year, D. P. Story}, diff --git a/texmf-dist/doc/latex/eq-save/examples/eqsave-noname.pdf b/texmf-dist/doc/latex/eq-save/examples/eqsave-noname.pdf index 5ec4b41a..06bdb163 100644 Binary files a/texmf-dist/doc/latex/eq-save/examples/eqsave-noname.pdf and b/texmf-dist/doc/latex/eq-save/examples/eqsave-noname.pdf differ diff --git a/texmf-dist/source/latex/eq-save/eq-save.dtx b/texmf-dist/source/latex/eq-save/eq-save.dtx index 180d42fe..dd2a1170 100644 --- a/texmf-dist/source/latex/eq-save/eq-save.dtx +++ b/texmf-dist/source/latex/eq-save/eq-save.dtx @@ -2,7 +2,7 @@ %<*copyright> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% eq-save package, %% -%% Copyright (C) 2017-2018 %% +%% Copyright (C) 2017-2019 %% %% dpstory@uakron.edu %% %% %% %% This program can redistributed and/or modified under %% @@ -14,7 +14,7 @@ % %\NeedsTeXFormat{LaTeX2e}[1997/12/01] %\ProvidesPackage{eq-save} -% [2018/04/07 v1.1 eq-save: save exerquiz quizzes and resume (dps)] +% [2019/08/07 v1.2.5 eq-save: save exerquiz quizzes and resume (dps)] %<*driver> \documentclass{ltxdoc} \usepackage[colorlinks,hyperindex=false]{hyperref} @@ -60,7 +60,6 @@ % \InputIfFileExists{aebdonotindex.def}{\PackageInfo{web}{Inputting aebdonotindex.def}} % {\PackageInfo{web}{cannot find aebdonotindex.def}} % \begin{macrocode} -% Begin Package %<*package> % \end{macrocode} % The option \IndexOpt{devmode}\opt{devmode} does not require the user to enter his or her name @@ -106,7 +105,7 @@ % % % \section{Commands of this package} -% The \DescribeMacro{\nameField}\cs{nameField} command insert a text field into which the student enters +% The \DescribeMacro{\nameField}\cs{nameField} command inserts a text field into which the student enters % his name; otherwise, he cannot continue to the next page. Changing your name after you've begun to work % on the questions clears the answer to all quizzes; this is an annoyance factor, a feeble attempt to reduce % cheating. When \cs{nameField} is used, the top of the next page should be \cs{BeginNoPeeking}. @@ -118,8 +117,7 @@ try{IhrNameFormat(event);}catch(e){} }]{#2}{#3}{#4}} % \end{macrocode} -% \DescribeMacro{\hiddenScoreData}\cs{hiddenScoreData} text field. -% It has zero dimensions, takes up no (horizontal) {\TeX} space, and is hidden. It is placed under the name field. +% \DescribeMacro{\hiddenScoreData}is a text field that has zero dimensions, it takes up no (horizontal) {\TeX} space, and is hidden. % This field, when the document is saved, receive all essential quiz data. It is read again when the document % is opened to restore the quiz data. We give this field an initial value, for otherwise, the PDF viewer will % not scan this field on opening. @@ -133,14 +131,14 @@ % We place this field on the first page, upper left corner. It will be scanned by the PDF viewer (Reader) % and it will define the object \texttt{oRecordOfQuizData} that will hold essential quiz data. % -% \paragraph*{Displaying and clearing results} As the user/student progresses through the documents, he +% \paragraph*{Displaying and clearing results} As the user/student progresses through the document, he % can see his success rate by viewing the text fields below. % % The \DescribeMacro{\sooField}\cs{sooField} (soo=score out of) displays the combined score: `12 out of 16', for example. -% The phase may be redefined for language purposes by redeclaring the command \cs{declareScorePhrase}, the English +% The phase may be redefined for language purposes by redeclaring the command \DescribeMacro{\declareScorePhrase}\cs{declareScorePhrase}, the English % declaration is \verb~\declareScorePhrase{#1+"\space\eqOutOf\space"+#2}~, see the documentation above for this command. % -% The \DescribeMacro{\sField}\cs{sField} is one that holds only the score, while +% The \DescribeMacro{\sField}\cs{sField} is one the field that holds only the score, while % \DescribeMacro{\ooField}\cs{ooField} holds the `out of' value. % \begin{macrocode} \newcommand{\sField}[3][]{\textField[\Ff{\FfReadOnly}#1]% @@ -152,7 +150,7 @@ % \end{macrocode} % Now we do the same thing for the points score. \DescribeMacro{\psField}\cs{psField} holds the total % number of points awarded; \DescribeMacro{\pooField}\cs{pooField} is the total number of points; -% \DescribeMacro{\psooField}\cs{psooField} +% \DescribeMacro{\psooField}\cs{psooField} is the `points out of' field. % \begin{macrocode} \newcommand{\psField}[3][]{\textField[\Ff{\FfReadOnly}#1]% {\eqsroot.ptScore}{#2}{#3}} @@ -215,11 +213,16 @@ } % \end{macrocode} % \paragraph*{Open Page Action} We add a page open event to restore the data as needed. We only do this once -% per document session. +% per document session. The script used in contained in the command \DescribeMacro\restoreQD\cs{restoreQD}. +% \changes{v1.2.3}{2019/27/07}{Made the open doc script into a macro \string\cs{resoreQD}} +% \changes{v1.2.4}{2019/08/01}{Changed to page open} +% \changes{v1.2.5}{2019/08/07}{added dirty=false to \string\cs{restoreQD}} % \begin{macrocode} -\thisPageAction{\JS{if(!restoreQuizData.hasRestoredData)\r\t - var rqdTO=(app.setTimeOut("restoreQuizData();app.clearTimeOut(rqdTO);% - restoreQuizData.hasRestoredData=true",1000));}}{} +\def\restoreQD{if(!restoreQuizData.hasRestoredData)\r\t + var\eqSP rqdTO=(app.setTimeOut("try{restoreQuizData()}catch(e){};% + app.clearTimeOut(rqdTO);% + restoreQuizData.hasRestoredData=true;dirty=false;",1000));} +\thisPageAction{\JS{\restoreQD}}{} % \end{macrocode} % \paragraph*{Action prior to saving} It is important to save the quiz data, we can only do that if we save % it to a field, the value of the field will be saved. We save the data to a hidden text field @@ -246,9 +249,13 @@ if (typeof oRecordOfQuizData !="undefined") collectQuizData(); this.pageNum=0;\r\t NoNameMsg=app.setTimeOut("app.alert('\EnterNameFirstMsg');% app.clearTimeOut(NoNameMsg);",25);}}}{}}% +% \end{macrocode} % Page option for this page +% \begin{macrocode} \IhrNamePO -% page open for all other pages +% \end{macrocode} +% Page open for all other pages +% \begin{macrocode} \AtBeginShipout{\IhrNamePO}% } % \end{macrocode} @@ -579,6 +586,8 @@ function collectQuizData() { % \end{macrocode} % \leavevmode\IndexJS{restoreQuizData()} is called when the document is opened and attempts to % transfer the value of \texttt{holdScoreData} back into \texttt{oRecordOfQuizData}. +% \changes{v1.2}{2019/07/02}{Added ProbDist array} +% \changes{v1.2.1}{2019/07/05}{Added RightWrong array} % \begin{macrocode} restoreQuizData.hasRestoredData=false; function restoreQuizData() { @@ -590,13 +599,26 @@ function restoreQuizData() { // name of field is endQuiz.qzname var pos=fname.indexOf("."); var qzName=fname.substring(pos+1); - lstOfQuizzes[qzName]=eval(qzName); - Score=1*oRecordOfQuizData[fname][0]; - NQuestions=1*oRecordOfQuizData[fname][1]; - ptScore=1*oRecordOfQuizData[fname][2]; - NPointTotal=1*oRecordOfQuizData[fname][3]; - var h=this.getField("ScoreData."+qzName); - h.value=Score+";"+NQuestions+";"+ptScore+";"+NPointTotal; + var qzRoot=fname.substring(0,pos); + switch(qzRoot) { + case "ScoreData": + lstOfQuizzes[qzName]=eval(qzName); + Score=1*oRecordOfQuizData[fname][0]; + NQuestions=1*oRecordOfQuizData[fname][1]; + ptScore=1*oRecordOfQuizData[fname][2]; + NPointTotal=1*oRecordOfQuizData[fname][3]; + var h=this.getField("ScoreData."+qzName); + h.value=Score+";"+NQuestions+";"+ptScore+";"+NPointTotal; + break; + case "ProbDist": + ProbDist=eval(oRecordOfQuizData[fname]); + break; + case "RightWrong": + RightWrong=eval(oRecordOfQuizData[fname]); + break; + default: + console.println("name not recognized:"+fname); + } } else f.isCorrect=oRecordOfQuizData[fname]; } } diff --git a/texmf-dist/tex/latex/eq-save/eq-save.sty b/texmf-dist/tex/latex/eq-save/eq-save.sty index 8bbaee95..59bf56de 100644 --- a/texmf-dist/tex/latex/eq-save/eq-save.sty +++ b/texmf-dist/tex/latex/eq-save/eq-save.sty @@ -8,7 +8,7 @@ %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% eq-save package, %% -%% Copyright (C) 2017-2018 %% +%% Copyright (C) 2017-2019 %% %% dpstory@uakron.edu %% %% %% %% This program can redistributed and/or modified under %% @@ -19,7 +19,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[1997/12/01] \ProvidesPackage{eq-save} - [2018/04/07 v1.1 eq-save: save exerquiz quizzes and resume (dps)] + [2019/08/07 v1.2.5 eq-save: save exerquiz quizzes and resume (dps)] \DeclareOption{devmode}{\def\devMode{true}} \DeclareOption{!devmode}{\def\devMode{false}} \def\devMode{false} @@ -83,9 +83,11 @@ [1*Score,1*NQuestions,1*ptScore,1*NPointTotal];\r\t\t cntCorrectResponses();\r } -\thisPageAction{\JS{if(!restoreQuizData.hasRestoredData)\r\t - var rqdTO=(app.setTimeOut("restoreQuizData();app.clearTimeOut(rqdTO);% - restoreQuizData.hasRestoredData=true",1000));}}{} +\def\restoreQD{if(!restoreQuizData.hasRestoredData)\r\t + var\eqSP rqdTO=(app.setTimeOut("try{restoreQuizData()}catch(e){};% + app.clearTimeOut(rqdTO);% + restoreQuizData.hasRestoredData=true;dirty=false;",1000));} +\thisPageAction{\JS{\restoreQD}}{} \begin{willSave} isAQuizUnfinishedAtSave(); if (typeof oRecordOfQuizData !="undefined") collectQuizData(); @@ -340,13 +342,26 @@ function restoreQuizData() { // name of field is endQuiz.qzname var pos=fname.indexOf("."); var qzName=fname.substring(pos+1); - lstOfQuizzes[qzName]=eval(qzName); - Score=1*oRecordOfQuizData[fname][0]; - NQuestions=1*oRecordOfQuizData[fname][1]; - ptScore=1*oRecordOfQuizData[fname][2]; - NPointTotal=1*oRecordOfQuizData[fname][3]; - var h=this.getField("ScoreData."+qzName); - h.value=Score+";"+NQuestions+";"+ptScore+";"+NPointTotal; + var qzRoot=fname.substring(0,pos); + switch(qzRoot) { + case "ScoreData": + lstOfQuizzes[qzName]=eval(qzName); + Score=1*oRecordOfQuizData[fname][0]; + NQuestions=1*oRecordOfQuizData[fname][1]; + ptScore=1*oRecordOfQuizData[fname][2]; + NPointTotal=1*oRecordOfQuizData[fname][3]; + var h=this.getField("ScoreData."+qzName); + h.value=Score+";"+NQuestions+";"+ptScore+";"+NPointTotal; + break; + case "ProbDist": + ProbDist=eval(oRecordOfQuizData[fname]); + break; + case "RightWrong": + RightWrong=eval(oRecordOfQuizData[fname]); + break; + default: + console.println("name not recognized:"+fname); + } } else f.isCorrect=oRecordOfQuizData[fname]; } } diff --git a/tlpkg/texlive.tlpdb b/tlpkg/texlive.tlpdb index 63104efa..dfe892fd 100644 --- a/tlpkg/texlive.tlpdb +++ b/tlpkg/texlive.tlpdb @@ -7,7 +7,7 @@ depend container_split_src_files/1 depend frozen/0 depend minrelease/2016 depend release/2019-nonfree -depend revision/239 +depend revision/241 name 00texlive.installation category TLCore @@ -1826,12 +1826,12 @@ catalogue-topics exam card-flash pdf-forms name eq-save category Package -revision 128 +revision 241 shortdesc Save exerquiz quizzes and resume longdesc The package has a scheme for saving data from exerquiz longdesc documents so the student can return later to continue with quiz longdesc results restored. -docfiles size=96 +docfiles size=117 texmf-dist/doc/latex/eq-save/README.md details="Readme" texmf-dist/doc/latex/eq-save/eqsave-man.pdf details="Package documentation" texmf-dist/doc/latex/eq-save/eqsave-man.tex -- cgit v1.2.3