diff options
Diffstat (limited to 'macros/latex/contrib/acrotex/exerquiz.dtx')
-rw-r--r-- | macros/latex/contrib/acrotex/exerquiz.dtx | 352 |
1 files changed, 270 insertions, 82 deletions
diff --git a/macros/latex/contrib/acrotex/exerquiz.dtx b/macros/latex/contrib/acrotex/exerquiz.dtx index 51a44283e2..d850fe27e9 100644 --- a/macros/latex/contrib/acrotex/exerquiz.dtx +++ b/macros/latex/contrib/acrotex/exerquiz.dtx @@ -22,7 +22,7 @@ %<randomize>\ProvidesFile{aebrandom.def} %<sumrytbls>\ProvidesFile{aebsumrytbls.def} %<template>\ProvidesFile{template.def} -%<package|driver|aebjs|eqexam|randomize|sumrytbls|template> [2021/05/29 v8.8.2 % +%<package|driver|aebjs|eqexam|randomize|sumrytbls|template> [2021/10/03 v8.8.5 % %<package> Exerquiz: Exercises and Quizzes for LaTeX/PDF package (dps)] %<driver> Exerquiz documentation driver file (dps)] %<aebjs> Exerquiz document level JavaScript (dps)] @@ -101,6 +101,9 @@ % {\PackageInfo{exerquiz}{aebdonotindex.def cannot be found}} % \begin{macrocode} % \end{macrocode} +%\changes{v8.8.5}{2021/10/03}{This version attempts to fix a problem induced to acrotex by displaying +%the export values of choice field. The export values secretly contain a zero (0) or one (1) to signal +%that the current choice is wrong or right.} %\changes{v8.6.3}{2021/01/31}{Updated documentation, informing users of \string\app{Acrobat DC} that % it is necessary to change their \string\uif{Security (Enhanced)} preferences.} %\changes{v8.2.8}{2018/12/13}{The SOL file is now written entirely when there is no solution option specified} @@ -3888,6 +3891,13 @@ % wherein we pass the key-value pairs defined above. % \begin{macrocode} \newenvironment{questions}[1][]{% +% \end{macrocode} +% Insert \cs{nopartquestion} to fix problem +% with \cs{multipartquestion} +% \changes{v8.8.4}{2021/10/02}{Insert \string\cs{nopartquestion} to fix problem +% with \string\cs{multipartquestion}} +% \begin{macrocode} + \nopartquestion \ifnum\@eqquestiondepth>\tw@\@toodeep\else \advance\@eqquestiondepth\@ne\fi \def\@quesctr{eqquestionno\romannumeral\the\@eqquestiondepth}% @@ -5208,6 +5218,14 @@ else { \BG{.7529 .7529 .7529}\W{1}\S{B}\H{P}} \def\eq@@EndQuizButtonActions{% \A{\JS{\eQzBtnActns}}} +% \end{macrocode} +% Save end quiz button action. The \DescribeMacro\restoreNormalEndQuiz\cs{restoreNormalEndQuiz} +% restores the action to its original definition. +% \changes{v8.8.3}{2021/06/24}{Added \string\cs{restoreNormalEndQuiz}} +% \begin{macrocode} +\let\eq@@EndQuizButtonActionsDefSave\eq@@EndQuizButtonActions % dps0624 +\def\restoreNormalEndQuiz % dps0624 + {\let\eq@@EndQuizButtonActions\eq@@EndQuizButtonActionsDefSave} \newcommand{\eq@hiddenScoreData}{\makebox[0pt][r]{% \textField[\BC{}\F{\FHidden}]{ScoreData.\curr@quiz}{2bp}{2bp}}} % \end{macrocode} @@ -5764,7 +5782,6 @@ if (isEndQuizPushed("@eqBaseName")){ % \begin{macro}{\aeb@creditmarkupfmt} % \begin{macro}{\ptsLabel} % \begin{macro}{\ptLabel} -% \begin{macro}{\multipartquestion} % \begin{macro}{\hideCreditMarkup} % \begin{macro}{\showCreditMarkup} % \cs{showCreditMarkup} will show points assigned to individual questions in a quiz. @@ -5784,7 +5801,23 @@ if (isEndQuizPushed("@eqBaseName")){ %} % \begin{macrocode} \newcounter{qMarkCnt} -\def\multipartquestion{\global\let\aeb@multipart\eq@One} +% \end{macrocode} +% When a question has multi-parts, use \DescribeMacro{\multipartquestion}\cs{multipartquestion} to suppress +% the partial credit markup. +% \begin{macrocode} +\def\multipartquestion{\global + \let\aeb@multipart\eq@One +} +% \end{macrocode} +% The default is that a question does not have multiple parts, use \DescribeMacro{\nopartquestion}\cs{nopartquestion} +% to return to this detault after a \cs{multipartquestion} has been expanded. +% \changes{v8.8.4}{2021/10/02}{Define \string\cs{nopartquestion} to recover from +% \string\cs{multipartquestion}} +% \begin{macrocode} +\def\nopartquestion{\global + \let\aeb@multipart\eq@Zero +} +\let\aeb@multipart\eq@Zero % \end{macrocode} % The labeling for the partial credit markup. These two commands are % are defined (identically) in the \textsf{eqexam} package, hence the @@ -5792,7 +5825,6 @@ if (isEndQuizPushed("@eqBaseName")){ % \begin{macrocode} \providecommand{\ptsLabel}[1]{\def\eqptsLabel{#1}}\ptsLabel{pts} \providecommand{\ptLabel}[1]{\def\eqptLabel{#1}}\ptLabel{pt} -\let\aeb@multipart\eq@Zero % \end{macrocode} % \DescribeMacro{\pcMarkupColor} is the named color in RGB color space to % use for the color of the partial credit markup. (2013/09/14). @@ -5828,7 +5860,7 @@ if (isEndQuizPushed("@eqBaseName")){ % it is zero. If zero we do place the markup, otherwise, no. % \begin{macrocode} \def\qMark{\if\aeb@multipart\eq@Zero\aeb@creditmarkup - \stepcounter{qMarkCnt}\else\global\let\aeb@multipart\eq@Zero\fi}% + \stepcounter{qMarkCnt}\else\nopartquestion\fi}% % \end{macrocode} % \cs{qMark@Hook} is a hook that is normally \cs{@empty}. The hook is strategically % placed at the beginning of each question \cs{item}. Here we define it to be @@ -5851,7 +5883,6 @@ if (isEndQuizPushed("@eqBaseName")){ % \end{macro} % \end{macro} % \end{macro} -% \end{macro} %\subsection{Filtering solutions to quizzes} % The \cs{eqQt} and \cs{eqSQt} commands have one argument designed to be used to filter % solutions to quizzes. The demo document is \texttt{filter\_quizzes.tex}, @@ -6262,24 +6293,32 @@ if (isEndQuizPushed("@eqBaseName")){ % For the link multiple choice type question. The driver independent stuff starts % here, then goes to |\Ans@sq@l@driver| the rest of the code that depends on the % driver. -% \begin{macrocode} -\def\sqWrongRespJS{OnBlurRespBox(false,"\oField");} -\def\sqRightRespJS{OnBlurRespBox(true,"\oField");} -\def\Ans@sq@l@Actions -{% - \A{\if\Ans@choice\eq@One\JS{\sqRightRespJS} - \ifx\@qzsolndest\@empty\else - \ifeq@solutionsafter\else - /Next <</S/GoTo/D(\@qzsolndest)>> - \fi +% \changes{v8.8.5}{2021/10/03}{Allow MC in short-quizzes to have check box to dismiss +% alert box.} +% \begin{macrocode} +\def\sqWrongRespJS{% dpsx + \ifx\@sqTurnOffAlerts\eq@One% + OnBlurRespBox(false,"\oField");\r\fi + this.getField("mc.\curr@quiz.\thequestionno").value="\alph{quizno}"; +} +\def\sqRightRespJS{% dpsx + \ifx\@sqTurnOffAlerts\eq@One% + OnBlurRespBox(true,"\oField");\r\fi + this.getField("mc.\curr@quiz.\thequestionno").value="\alph{quizno}"; +} +\def\Ans@sq@l@Actions{\A{% + \if\Ans@choice\eq@One\JS{\sqRightRespJS} + \ifx\@qzsolndest\@empty\else + \ifeq@solutionsafter\else + /Next <</S/GoTo/D(\@qzsolndest)>> \fi - \else - \JS{\sqWrongRespJS\jsR - \ifx\oField\@empty\else - updateTally("\oField.\thequestionno");\fi}% \fi - }% -} + \else + \JS{\sqWrongRespJS\jsR + \ifx\oField\@empty\else + updateTally("\oField.\thequestionno");\fi}% + \fi +}} % \end{macrocode} % \end{macro} % \begin{macrocode} @@ -6295,25 +6334,50 @@ if (isEndQuizPushed("@eqBaseName")){ %</eqexam> %<*package|eqexam> \def\linkContentWrapper{(\hfil\linkContentFormat\hfil)}% -\def\Ans@sq@l{% - \leavevmode\if\eq@listType\eq@One\stepcounter{quizno}\else - \@ifundefined{ifwithinsoldoc}{\refstepcounter{quizno}} - {\ifwithinsoldoc\stepcounter{quizno}\else - \refstepcounter{quizno}\fi}\fi\PBS\raggedright - \settowidth{\eq@tmplength}{\eq@lw@l}\sbox{\eq@tmpbox}{\eq@l@l}% - \eq@tmpdima=\wd\eq@tmpbox - \def\link@@Content{\linkContentWrapper}% - \hangindent=\eq@tmplength\hangafter=1\relax +\def\Ans@sq@l{\leavevmode + \if\eq@listType\eq@One\stepcounter{quizno}\else + \@ifundefined{ifwithinsoldoc}{\refstepcounter{quizno}} + {\ifwithinsoldoc\stepcounter{quizno}\else + \refstepcounter{quizno}\fi}\fi\PBS\raggedright + \settowidth{\eq@tmplength}{\eq@lw@l}\sbox{\eq@tmpbox}{\eq@l@l}% + \eq@tmpdima=\wd\eq@tmpbox + \def\link@@Content{\linkContentWrapper}% + \hangindent=\eq@tmplength\hangafter=1\relax %</package|eqexam> %<*eqexam> - \Ans@sq@l@driver + \Ans@sq@l@driver %</eqexam> %<*package> +% \end{macrocode} +% (2021/10/03) Move 0 and 1 to tooltip of underlying radio button that flags +% choice as incorrect and incorrect. +% \begin{macrocode} + \if\Ans@choice\eq@One % dpsx + \def\Ans@c@l@Choice{\TU{1}% + \BC{}\Ff{\FfReadOnly}}% + \def\rbf@Opts{\symbolchoice{\sq@corrsymch}% + \textColor{\sq@corrsymcol}}% + \else + \def\Ans@c@l@Choice{\TU{0}\DV{Yes}% + \Ff{\FfReadOnly}\BC{}}% + \def\rbf@Opts{\symbolchoice{\sq@wrgsymch}% + \textColor{\sq@wrgsymcol}}% + \fi + \makebox[0pt][l]{\expandafter\radio@@Button\expandafter{\rbf@Opts}% + {mc.\curr@quiz.\thequestionno}% +% \end{macrocode} +% (2021/10/03) Remove 0 and 1 from export value radio button +% \begin{macrocode} + {\eq@tmpdima}{\RadioFieldSize}{\alph{quizno}}% dpsx +% {\eq@tmpdima}{\RadioFieldSize}{\Ans@choice\alph{quizno}}% + {\eq@protect\A}{\eq@setWidgetProps\eq@l@check@driver}% + {\Ans@r@l@Defaults\every@RadioButton + \every@qRadioButton}}% \set@@Link{}{}{}% - {\makebox[\eq@tmpdima]{\color{\@linkcolor}\link@@Content}} - {\eq@protect\A}{\eq@setWidgetProps\setLink@driver}% - {\set@LinkTextDefaults\Ans@sq@l@Actions\every@Link}% - \Ans@proofing{\eq@tmpdima}% + {\makebox[\eq@tmpdima]{\color{\@linkcolor}\link@@Content}} + {\eq@protect\A}{\eq@setWidgetProps\setLink@driver}% + {\set@LinkTextDefaults\Ans@sq@l@Actions\every@Link}% + \Ans@proofing{\eq@tmpdima}% %</package> %<*package|eqexam> \eq@hspanner\ignorespaces} @@ -6341,14 +6405,22 @@ if (isEndQuizPushed("@eqBaseName")){ % driver. % \changes{v7.7d}{2015/11/15}{Changed mc.\string\cs{oFields} so it is printable} % \begin{macrocode} -\def\@@Ans@sq@f@Defaults -{% - \BC{0 0 0}\Ff{\FfNoToggleToOff}\W{1} -% \F{\FPrint} - \textSize{12}\textColor{0 g} +% \end{macrocode} +%\DescribeMacro{\TUChoice}\hskip-\marginparsep\texttt{\darg{\ameta{text}}} A generic +%tooltip for radio buttons and check boxes for MS and MS questions. The default +%is |\TUChoice{Choice}|. +%\changes{v8.8.5}{2021/10/03}{Added \string\cs{TUChoice}} +% \begin{macrocode} +\def\TUChoice#1{\def\TU@Choice{#1}} +\TUChoice{Choice} +% \end{macrocode} +% \begin{macrocode} +\def\@@Ans@sq@f@Defaults{% + \BC{0 0 0}\Ff{\FfNoToggleToOff}\W{1}%\F{\FPrint} + \textSize{12}\textColor{0 g}\TU{\TU@Choice} % dpsx } % \end{macrocode} -% For short quizzes, refine the type of responses: turn off the alert +% For short-quizzes, refine the type of responses: turn off the alert % message (the default is on); or have a (red) `\texttt{x}' make an % incorrect answer, and a (green) check mark a correct answer. % \begin{macrocode} @@ -6493,7 +6565,8 @@ updateTally("*oField.*thequestionno");% \mbox{\expandafter\radio@@Button\expandafter{\rbf@Opts}% {mc.\oField.\thequestionno}% {\RadioFieldSize}{\RadioFieldSize}% - {\Ans@choice\alph{quizno}}{\eq@protect\A}% + {\alph{quizno}}{\eq@protect\A}% +% {\Ans@choice\alph{quizno}}{\eq@protect\A}% {\eq@setWidgetProps\eq@Radio@driver}% {\@@Ans@sq@f@Defaults\Ans@sq@f@Actions\every@RadioButton \every@sqRadioButton}}% @@ -6509,14 +6582,13 @@ updateTally("*oField.*thequestionno");% % Created in support of \textsf{eqExam} to give multiple selection for the % online and email options. Otherwise, it defaults to a radio button field. % \begin{macrocode} -% %</package> %<*eqexam> \let\Ans@ck@sq@f\Ans@sq@f %</eqexam> %<*package> \def\@@Ans@ck@sq@f@Defaults{% - \BC{0 0 0}\Ff{\FfNoToggleToOff} + \BC{0 0 0}\Ff{\FfNoToggleToOff}\TU{\TU@Choice} % dpsx \F{\FPrint}\textSize{12}\textColor{0 g}\W{1} } \begingroup @@ -6529,11 +6601,18 @@ updateTally("*oField.*thequestionno");% % \begin{macrocode} \begin{defineJS}[\makeesc\*\makecmt\%]{\Ans@ck@sq@f@ActionsTrue} var fName=event.target.name; -var g=this.getField("mc.*oField.*thequestionno"); +var g=this.getField("mck.*oField.*thequestionno"); var a=g.getArray(); +% dpsx +var h=this.getField("mcq.*oField.*thequestionno"); +var b=h.getArray(); +% \end{macrocode} +% (2021/10/03) Work with the tooltop of \texttt{mcq} rather than the export value +% of \texttt{mck}. +% \begin{macrocode} for (var i=0; i<a.length; i++) - if ( (a[i].isBoxChecked(0)) && % -(a[i].value.charAt(0)==0) ) + if ( (a[i].isBoxChecked(0)) && (b[i].userName=="0" ) ) +%(a[i].value.charAt(0)==0) ) a[i].checkThisBox(0,false);% *ifx*@sqTurnOffAlerts*eq@One OnBlurRespBox(true,"*oField");*else @@ -6551,8 +6630,12 @@ var f=this.getField("corr.*oField.*thequestionno"); if (f==null) { if ( (qzSolnDest != "") && !solnAfter ) { for (var i=0; i<a.length; i++){ - if ((a[i].exportValues[0].charAt(0)==1) && % -(!a[i].isBoxChecked(0))) break; +% if ((a[i].exportValues[0].charAt(0)==1) && % dpsx % +% \end{macrocode} +% (2021/10/03) Work with the tooltop of \texttt{mcq} rather than the export value +% of \texttt{mck}. +% \begin{macrocode} + if ((b[i].userName=="1") && (!a[i].isBoxChecked(0))) break; } } if (i>=a.length) jmpToNamedDest("*oField","*@qzsolndest",% @@ -6567,10 +6650,18 @@ if (f==null) { % \begin{macrocode} \begin{defineJS}[\makeesc\*\makecmt\%]{\Ans@ck@sq@f@ActionsFalse} var fName=event.target.name; -var g=this.getField("mc.*oField.*thequestionno"); +var g=this.getField("mck.*oField.*thequestionno"); var a=g.getArray(); +% dpsx +var h=this.getField("mcq.*oField.*thequestionno"); +var b=h.getArray(); for (var i=0; i<a.length; i++) { - if (a[i].value.charAt(0)==0) { +% if (a[i].value.charAt(0)==0) { +% \end{macrocode} +% (2021/10/03) Work with the tooltop of \texttt{mcq} rather than the export value +% of \texttt{mck}. +% \begin{macrocode} + if (b[i].userName=="0") { if ( fName != a[i].name ) a[i].checkThisBox(0,false); } @@ -6609,14 +6700,25 @@ updateTally("*oField.*thequestionno");*fi% \hangindent\eq@tmplength\hangafter\@ne % dps \insertGrayLetters % 6.3d \mbox{\expandafter\check@@Box\expandafter{\rbf@Opts}% - {mc.\oField.\thequestionno.\arabic{quizno}}% + {mck.\oField.\thequestionno.\arabic{quizno}}% {\RadioFieldSize}{\RadioFieldSize} - {\Ans@choice\alph{quizno}}{\eq@protect\A}% + {\alph{quizno}}{\eq@protect\A}% +% {\Ans@choice\alph{quizno}}{\eq@protect\A}% dpsx {\eq@setWidgetProps\eq@Check@driver}% {\@@Ans@ck@sq@f@Defaults\Ans@ck@sq@f@Actions\every@CheckBox \every@sqCheckBox}}% - \Ans@proofing{\RadioFieldSize}% - \eq@hspanner\ignorespaces + \def\late@options{\BC{}}% + \if\Ans@choice\eq@One % dpsx + \eq@addExpandTo\late@options{\TU{1}}\else + \eq@addExpandTo\late@options{\TU{0}}\fi + \makebox[0pt][r]{\check@@Box{}% dpsx + {mcq.\oField.\thequestionno.\arabic{quizno}}% + {0pt}{0pt}{Yes}{}% \@tempdimb + {\eq@setWidgetProps\eq@Check@driver}% + {\Ans@c@f@Defaults\every@RadioButton + \every@qRadioButton\late@options}}% dpsx + \Ans@proofing{\RadioFieldSize}\eq@hspanner + \ignorespaces } % \end{macrocode} % \end{macro} @@ -6842,6 +6944,7 @@ updateTally("*oField.*thequestionno");*fi% % \end{macrocode} % \end{macro} % \subsubsection{Link Style} +% % \begin{macro}{\Ans@l} % For the forms version of the \texttt{quiz} environment. % dps 12/19/03 removed the notify because we are not embedding a radio button field @@ -6849,7 +6952,8 @@ updateTally("*oField.*thequestionno");*fi% \let\qRadionActionsHook\@empty \def\Ans@@l@Actions{\A{\JS{% this.getField("mc.\curr@quiz.\thequestionno").value\eqSP - =\eqSP"\Ans@choice\alph{quizno}";\jsR + =\eqSP"\alph{quizno}";\jsR +% =\eqSP"\Ans@choice\alph{quizno}";\jsR // dpsx RecordPointValue([0,\eqPTs,\eq@pPTs],\thequestionno);\jsR RecordProblemType("\eqQT",\thequestionno);\jsR ProcessQuestion(\Ans@choice,"\alph{quizno}",\thequestionno,% @@ -6858,9 +6962,26 @@ updateTally("*oField.*thequestionno");*fi% \ifeq@noquizsolutions\else,1\fi\fi\fi);\qRadionActionsHook}}% } \def\Ans@r@l@Defaults{% - \BC{}\S{S}\W{1}\Ff{\FfNoToggleToOff}\F{\FPrint} + \BC{}\S{S}\W{1}\Ff{\FfNoToggleToOff}\F{\FPrint}\TU{\TU@Choice} % dpsx \textSize{12}\textColor{0 g}\Ff{\FfReadOnly} } +% \end{macrocode} +% (2021/10/03) Changes are needed to radio buttons and checkboxes (Commands: \cs{Ans@l},\cs{Ans@ck@l}, \cs{Ans@@f}, and \cs{Ans@@ck@f}) +% of the \env{answers} and \env{manswers} environments. AA/AR has changed the way they display the tooltip: changed +% from `\ameta{tooltip}' to `\ameta{tooltip}\texttt:\,\ameta{export-value}'. Unfortunately, the \ameta{export-value} +% contains code that signals whether this field is a correct choice or not: an export value that begins with a +% one (1) indicates a correct choice, which one that begins with a zero (0) marks an incorrect choice. When the student passes +% his mouse cursor over a choice, he sees `1a' or `0b'; seeing enough of these patterns, their meaning will become known. +% +% The workaround is to move the binary flag to the tooltip of the underlying checkbox, which is readonly, hence, +% there is not over display of this field. In the fields listed above, we insert \cs{TU{1}} or \cs{TU{0}} +% into each of the checkboxes whose names begin with \texttt{mcq}. +% +% The final step is to change the JavaScript to look at the \texttt{mcq} fields rather than +% the \texttt{mc} or \texttt{mck} fields. +% \changes{v8.8.5}{2021/10/03}{Changes required by changes in the display of +% tooltip for choice fields} +% \begin{macrocode} \def\Ans@l{\leavevmode\if\eq@listType1\stepcounter{quizno}% \else\refstepcounter{quizno}\fi\PBS\raggedright \settowidth{\eq@tmplength}{\eq@lw@l}\sbox{\eq@tmpbox}{\eq@l@l}% @@ -6873,7 +6994,8 @@ updateTally("*oField.*thequestionno");*fi% \def\late@options{\BC{}}% \if\Ans@choice\eq@One\relax\eq@recordAnsChoice\fi \makebox[0pt][l]{\radio@@Button{}{mc.\curr@quiz.\thequestionno}% - {\eq@tmpdima}{\RadioFieldSize}{\Ans@choice\alph{quizno}}% + {\eq@tmpdima}{\RadioFieldSize}{\alph{quizno}}% dpsx +% {\eq@tmpdima}{\RadioFieldSize}{\Ans@choice\alph{quizno}}% {\eq@protect\A}{\eq@setWidgetProps\eq@l@check@driver}% {\Ans@r@l@Defaults\every@RadioButton \every@qRadioButton\late@options}}% @@ -6899,11 +7021,15 @@ updateTally("*oField.*thequestionno");*fi% \fi \def\late@options{\BC{}}% \if\Ans@choice\eq@One + \eq@addExpandTo\late@options{\TU{1}}% \ifx\@qzsolndest\@empty\else \ifeq@noquizsolutions\else - \edef\late@options{\noexpand\BC{\solution@Color}}% + \eq@addExpandTo\late@options{% + \BC{\solution@Color}}% \fi \fi + \else + \eq@addExpandTo\late@options{\TU{0}}% \fi \makebox[0pt][r]{\check@@Box{}% {mcq.\curr@quiz.\thequestionno.\arabic{quizno}}% @@ -6942,10 +7068,14 @@ updateTally("*oField.*thequestionno");*fi% \ifeq@noquizsolutions\else,1\fi\fi\fi);\jsR }}}% } +% \end{macrocode} +% \begin{macrocode} \def\Ans@ck@l@Defaults{% - \BC{}\S{S}\W{1}\H{N}\Ff{\FfNoToggleToOff} + \BC{}\S{S}\W{1}\H{N}\Ff{\FfNoToggleToOff}\TU{\TU@Choice} % dpsx \textSize{12}\textColor{0 g}\Ff{\FfReadOnly} } +% \end{macrocode} +% \begin{macrocode} \def\Ans@ck@l{\leavevmode \if\eq@listType1\stepcounter{quizno}% \else\refstepcounter{quizno}\fi @@ -6957,7 +7087,8 @@ updateTally("*oField.*thequestionno");*fi% \def\link@@Content{(\hfil\linkContentFormat\hfil)}% \makebox[0pt][l]{% \check@@Box{}{mck.\curr@quiz.\thequestionno.\arabic{quizno}}% - {\eq@tmpdima}{\RadioFieldSize}{\Ans@choice\alph{quizno}}% + {\eq@tmpdima}{\RadioFieldSize}{\alph{quizno}}% dpsx +% {\eq@tmpdima}{\RadioFieldSize}{\Ans@choice\alph{quizno}}% {\eq@protect\A}{\eq@setWidgetProps\eq@l@check@driver}% {\Ans@ck@l@Defaults\every@RadioButton \every@qckCheckbox}}% @@ -6967,7 +7098,7 @@ updateTally("*oField.*thequestionno");*fi% {\set@LinkTextDefaults\Ans@ck@@l@Actions\every@Link}% \ifnocorrections\else \if\Ans@choice\eq@One - \edef\Ans@c@l@Choice{\noexpand\DV{Yes}% + \edef\Ans@c@l@Choice{\noexpand\TU{1}\noexpand\DV{Yes}% \ifx\@qzsolndest\@empty\noexpand\BC{}% \noexpand\Ff{\FfReadOnly}% \else % there is a solution @@ -6980,7 +7111,7 @@ updateTally("*oField.*thequestionno");*fi% \fi }% \else - \def\Ans@c@l@Choice{\Ff{\FfReadOnly}\BC{}}% + \def\Ans@c@l@Choice{\TU{0}\Ff{\FfReadOnly}\BC{}}% \fi \makebox[0pt][r]{\check@@Box{}% {mcq.\curr@quiz.\thequestionno.\arabic{quizno}}% @@ -7005,7 +7136,7 @@ updateTally("*oField.*thequestionno");*fi% \refstepcounter{quizno}\fi \PBS\raggedright\Ans@@f} \def\Ans@r@f@Defaults{% - \BC{0 0 0}\S{S}\W{1}\Ff{\FfNoToggleToOff} + \BC{0 0 0}\S{S}\W{1}\Ff{\FfNoToggleToOff}\TU{\TU@Choice} % dpsx \F{\FPrint}\textSize{12}\textColor{0 g} } % \end{macrocode} @@ -7065,7 +7196,8 @@ updateTally("*oField.*thequestionno");*fi% \if\Ans@choice\eq@One\eq@recordAnsChoice\fi \mbox{\expandafter\radio@@Button\expandafter{\rbf@Opts}% {mc.\curr@quiz.\thequestionno}% - {\RadioFieldSize}{\RadioFieldSize}{\Ans@choice\alph{quizno}}% + {\RadioFieldSize}{\RadioFieldSize}{\alph{quizno}}% dpsx +% {\RadioFieldSize}{\RadioFieldSize}{\Ans@choice\alph{quizno}}% {\eq@protect\A}{\eq@setWidgetProps\eq@Radio@driver}% {\Ans@r@f@Defaults\Ans@r@f@Actions\every@RadioButton \every@qRadioButton\insert@circlesymbol}}% @@ -7089,11 +7221,15 @@ updateTally("*oField.*thequestionno");*fi% % \begin{macrocode} \ifaeb@usecircles\def\late@options{\BC{}}\fi \if\Ans@choice\eq@One + \eq@addExpandTo\late@options{\TU{1}}% \ifx\@qzsolndest\@empty\else \ifeq@noquizsolutions\else - \edef\late@options{\noexpand\BC{\solution@Color}}% + \eq@addExpandTo\late@options{% + \BC{\solution@Color}}% \fi \fi + \else + \eq@addExpandTo\late@options{\TU{0}}% \fi \makebox[0pt][r]{\check@@Box{}% {mcq.\curr@quiz.\thequestionno.\arabic{quizno}}% @@ -7120,8 +7256,11 @@ updateTally("*oField.*thequestionno");*fi% \else\refstepcounter{quizno}\fi \if\Ans@choice\eq@One\eq@recordAnsChoice\fi \PBS\raggedright\Ans@@ck@f} +% \end{macrocode} +% \begin{macrocode} \def\Ans@ck@f@Defaults{% \BC{0 0 0}\S{S}\W{1}\Ff{\FfNoToggleToOff} + \TU{\TU@Choice} % dpsx \textSize{12}\textColor{0 g} } % \end{macrocode} @@ -7178,7 +7317,8 @@ updateTally("*oField.*thequestionno");*fi% \textColor{\qz@chksymbcol}}% \mbox{\expandafter\check@@Box\expandafter{\cbf@Opts}% {mck.\curr@quiz.\thequestionno.\arabic{quizno}}% - {\RadioFieldSize}{\RadioFieldSize}{\Ans@choice\alph{quizno}}% + {\RadioFieldSize}{\RadioFieldSize}{\alph{quizno}}% dpsx +% {\RadioFieldSize}{\RadioFieldSize}{\Ans@choice\alph{quizno}}% {\eq@protect\A}{\eq@setWidgetProps\eq@Check@driver}% {\Ans@ck@f@Defaults\Ans@ck@f@Actions\every@RadioButton \every@qckCheckbox}}% @@ -7196,10 +7336,14 @@ updateTally("*oField.*thequestionno");*fi% \fi \let\late@options\@empty \if\Ans@choice\eq@One + \eq@addExpandTo\late@options{\TU{1}}% \ifx\@qzsolndest\@empty\else \ifeq@noquizsolutions\else - \edef\late@options{\noexpand\BC{\solution@Color}}\fi + \eq@addExpandTo\late@options{% + \BC{\solution@Color}}\fi \fi + \else + \eq@addExpandTo\late@options{\TU{0}}% \fi % \end{macrocode} % The top most checkbox @@ -8007,7 +8151,7 @@ updateTally("*oField.*thequestionno");*fi% % \end{macrocode} % \begin{macrocode} \let\insert@circlesymbol\@empty -\def\useMCCircles{\useForms +\def\useMCCircles{%\useForms \ifaeb@usecircles\else \global\aeb@usecirclestrue \gdef\insert@circlesymbol{\symbolchoice{circle}}% @@ -8144,14 +8288,25 @@ updateTally("*oField.*thequestionno");*fi% %{ % Added \string\cs{requireAlertBox} to turn off the ``Do not show this message again'' checkbox for objective questions. %} -%The alert box displays the message \cs{doNotShowAgainMsg} which by default is -%``Do not show this message again'' +%The alert box displays the message \DescribeMacro{\doNotShowAgainMsg}\cs{doNotShowAgainMsg}, which by default is +%``Do not show this message again''. This message appear when \DescribeMacro{\allowNoAlertBox}\cs{allowNoAlertBox} (the default) +% is in effect. % \begin{macrocode} \def\requireAlertBox{\def\bcheckboxused{false}} \def\allowNoAlertBox{\def\bcheckboxused{true}} \allowNoAlertBox % \end{macrocode} % \end{macro} +% When \DescribeMacro{\useCkBxAlertsOn}\cs{useCkBxAlertsOn} is expanded in the preamble, alerts +% generated by links (usually a short-quiz) uses a check box that allows its dismissal +% subsequently. \DescribeMacro{\useCkBxAlertsOff}\cs{useCkBxAlertsOff} reverts the behavior +% to alert boxes with no check box, the old default. +% \changes{v8.8.5}{2021/10/03}{Added \string\cs{useCkBxAlertsOn}} +% \begin{macrocode} +\def\useCkBxAlertsOn{\def\buseckbx{true}} % dpsx +\def\useCkBxAlertsOff{\def\buseckbx{false}} +\useCkBxAlertsOn +% \end{macrocode} % \subsection{Math Fill-In Questions} % \begin{macro}{\RespBox} % \begin{macro}{\RespBoxMath} @@ -9474,7 +9629,8 @@ if ( typeof *oField == "undefined" ) *oField = new Object; if (typeof appAlerts["*oField"] == "undefined") appAlerts["*oField"] = new Object; -this.resetForm(new Array("mc.*oField","obj.*oField",% +% dpsx +this.resetForm(new Array("mc.*oField","mck.*oField","obj.*oField",% "tally.*oField","grpobj.*oField")); var f = this.getField("obj.*oField"); if ( f != null ) f.strokeColor=*ifx*defaultColorJSLoc*@empty% @@ -10700,6 +10856,23 @@ aCorrectAns[!currQuiz.Grp["!thequestionno"].offset],!oField);!fi \def\every@eqIcon{} % \end{macrocode} % +% \subsection{Utility macro to dynamically modify appearances} +% +% This internal command is used to dynamically modify the appearance of form fields. +% \begin{macro}{\eq@addExpandTo}\hskip-\marginparsep\texttt{\darg{\ameta{\cs{CMD}}}\darg{\ameta{KVPs}}} +% The \cs{eq@addExpandTo} is a utility command that adds eforms key-value pairs to the +% end of the macro \texttt{\ameta{\cs{CMD}}}. The second argument of the KVP is expanded first. +% Used to dynamically modify appearances of a form field. +% \changes{v8.8.5}{2021/10/03}{Added \string\cs{eq@addExpandTo}} +% \begin{macrocode} +\def\eq@addExpandTo#1#2{\bgroup\let\protect\noexpand + \toks@=\expandafter{#1}\protectedKeys*{p@Keys}{#2}% + \edef\x{\@nameuse{p@Keys}}\toks2=\expandafter{\x}% + \xdef#1{\the\toks@\the\toks2}\egroup +} +% \end{macrocode} +% \end{macro} + % \subsection{Additional Format and Action keys} % % \begin{macro}{\AddAAFormat} @@ -13061,7 +13234,8 @@ function clearAllSubQuizzes() { \begin{newsegment}{Eq: Support for Multi-Selection} function ProcessMultiSelection(key,letterresp,probno,% quizno,qtfield,pts,ppts) { - var f = this.getField("mck."+qtfield+"."+probno); +% var f = this.getField("mck."+qtfield+"."+probno); // dpsx + var f = this.getField("mcq."+qtfield+"."+probno); % \end{macrocode} % For the multiple selection problem, the formats for the \texttt{RightWrong} and \texttt{ProbValue} % arrays are as follows: @@ -13092,7 +13266,12 @@ quizno,qtfield,pts,ppts) { % \begin{macrocode} var nTotalCorrect = 0; for ( var i=0; i<g.length; i++ ) - nTotalCorrect += (1*g[i].exportValues[0].charAt(0)); +% \end{macrocode} +% (2021/10/03) Work with the tool tip of \texttt{mcq} rather than the export value +% of \texttt{mck}. +% \begin{macrocode} + nTotalCorrect += (1*g[i].userName); +% nTotalCorrect += (1*g[i].exportValues[0].charAt(0)); // dpsx ProbValue[probno] = new Array(); RightWrong[probno] = new Array(); ProbValue[probno] = [nTotalCorrect,pts,[]]; @@ -13295,11 +13474,15 @@ app.clearTimeOut(oNoPeekTimer);",5); } else this.pageNum = rtnPage-1; } % \end{macrocode} -% When the user exits a fill-in shortquiz field, this function is called. +% When the user exits a fill-in short-quiz field, this function is called. % It immediately notifies user of whether their answer is right % or wrong, and changes the color of the boundary field. % \begin{macrocode} -var oCB=\bcheckboxused +var bCB=\bcheckboxused +% \end{macrocode} +% (2021/10/03) Boolean to use extended alert boxes for MC and MS, short-quiz. +% \begin{macrocode} +var bUseCkBx=\buseckbx; // dpsx function OnBlurRespBox (retn) { var qname = arguments[1]; @@ -13311,7 +13494,11 @@ function OnBlurRespBox (retn) appAlerts[qname] = {bAfterValue: false, % cMsg: "\doNotShowAgainMsg"}; var respMsg = (retn) ? \eqsqrtmsg\space : \eqsqwgmsg; - if ( (event.target == this) || !oCB) +% \end{macrocode} +% If \texttt{event.target} is the Doc object, the function has been called from +% a link; if called from a field action \texttt{event.target} is a Field object. +% \begin{macrocode} + if ( !bUseCkBx && ( (event.target == this) || !bCB ) ) // dpsx eqAppAlert({ cMsg: respMsg, nIcon: 3, cTitle: cTitle }); else { if ( ! appAlerts[arguments[1]].bAfterValue ) @@ -13335,11 +13522,12 @@ oCheckbox: appAlerts[qname]}); } } function jmpToNamedDest(fName,cDest,bAlert) { - if ( (typeof appAlerts[fName]!="undefined" % + if (cDest == "") return; + if ( (typeof appAlerts[fName]!="undefined" % && appAlerts[fName].bAfterValue) || bAlert==0) - app.setTimeOut("this.gotoNamedDest(\""+cDest+"\")",500); - else - this.gotoNamedDest(cDest); + app.setTimeOut("this.gotoNamedDest(\""+cDest+"\")",500); + else + this.gotoNamedDest(cDest); } % \end{macrocode} % Description: This is the default function for determining whether |