summaryrefslogtreecommitdiff
path: root/texmf-dist/source/latex/acrotex/exerquiz.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'texmf-dist/source/latex/acrotex/exerquiz.dtx')
-rw-r--r--texmf-dist/source/latex/acrotex/exerquiz.dtx670
1 files changed, 369 insertions, 301 deletions
diff --git a/texmf-dist/source/latex/acrotex/exerquiz.dtx b/texmf-dist/source/latex/acrotex/exerquiz.dtx
index b2f61b78..275fffcb 100644
--- a/texmf-dist/source/latex/acrotex/exerquiz.dtx
+++ b/texmf-dist/source/latex/acrotex/exerquiz.dtx
@@ -21,15 +21,15 @@
%<eqexam>\ProvidesFile{eqexam.def}
%<randomize>\ProvidesFile{aebrandom.def}
%<sumrytbls>\ProvidesFile{aebsumrytbls.def}
-%<template>\ProvidesFile{template.def}
-%<package|driver|aebjs|eqexam|randomize|sumrytbls|template> [2019/08/13 v8.3 %
-%<package> Exerquiz: Exercises and Quizzes for LaTeX/PDF package (dps)]
-%<driver> Exerquiz documentation driver file (dps)]
-%<aebjs> Exerquiz document level JavaScript (dps)]
-%<eqexam> Exerquiz support file for eqexam (dps)]
+%<template>\ProvidesFile{template.`def}
+%<package|driver|aebjs|eqexam|randomize|sumrytbls|template> [2019/12/17 v8.5.5 %
+%<package> Exerquiz: Exercises and Quizzes for LaTeX/PDF package (dps)]
+%<driver> Exerquiz documentation driver file (dps)]
+%<aebjs> Exerquiz document level JavaScript (dps)]
+%<eqexam> Exerquiz support file for eqexam (dps)]
%<randomize> Exerquiz support for randomization (dps)]
%<sumrytbls> Exerquiz support for summary tables (dps)]
-%<template> Exerquiz template for language support (dps)]
+%<template> Exerquiz template for language support (dps)]
%<eqfr>\ProvidesFile{eqfr.def}
%<eqde>\ProvidesFile{eqde.def}
%<eqno>\ProvidesFile{eqno.def}
@@ -47,10 +47,11 @@
%<*driver>
\documentclass{ltxdoc}
\usepackage[colorlinks,hyperindex=false]{hyperref}
-\def\darg#1{\texttt{\{#1\}}}
+\gdef\darg#1{\texttt{\char123\relax#1\char125\relax}}
\let\env\texttt
\let\opt\texttt
\let\app\textsf
+\def\nmpsep#1{\hskip-\marginparsep\texttt{#1}}
\def\visispace{\symbol{32}}
\def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}}
\def\meta#1{\textsl{\texttt{#1}}}
@@ -795,7 +796,8 @@
\RequirePackage{verbatim}
\RequirePackage{hyperref}
\RequirePackage{amssymb}% used for return symbols
-\RequirePackage{eforms}[2012/06/20]
+\RequirePackage{eforms}[2019/10/23]
+\dlSetPkgInfo
% \end{macrocode}
% \begin{macrocode}
\@ifundefined{eq@drivernum}{%
@@ -3457,14 +3459,39 @@
\let\priorexsectitle\@empty
\let\priorexslinput\@empty
% \end{macrocode}
+% \DescribeMacro{\InputExrSolnsLevel}\nmpsep{*[\ameta{name}]\darg{\ameta{level}}} The solutions to the exercises
+% are in their own section, historically this has been \cs{section*}; however for some documents, it is
+% desirable to have a numbered section number \cs{section} or \cs{chapter}, or \cs{chapter*}. The
+% \cs{InputExrSolnsLevel} is designed to ease the task of changing how section-type. \ameta{level} is usually
+% \texttt{section} or \texttt{chapter}; use \texttt* if you want solutions to be in \cs{section*} or \cs{chapter*};
+% if the \ameta{name} is used, the beginning of the solutions is marked with \cs{label\darg{name}}.
+% \changes{v8.5.5}{2019/12/17}{Added \string\cs{InputQzSolnsLevel}}
+% \begin{macrocode}
+\def\InputExrSolnsLevel{\@ifstar
+ {\def\eq@ExrSolnsStar{*}\InputExrSolnsLevel@i}
+ {\let\eq@ExrSolnsStar\@empty\InputExrSolnsLevel@i}}
+\newcommand{\InputExrSolnsLevel@i}[2][]{%
+ \def\eq@ExrSolnsLabel{#1}\def\eq@ExrSolnsLevel{#2}}
+\InputExrSolnsLevel*{section}
+% \end{macrocode}
%\DescribeMacro{\exerSolnsHeadnToc} sets the section title for the solutions
% to the exercises. May be redefined, I suppose.
% \begin{macrocode}
-\def\exerSolnsHeadnToc{\section*{\exsectitle}%
- \addcontentsline{toc}{section}{%
- \@ifundefined{web@latextoc}{}{%
- \ifx\web@latextoc\eq@YES\else
- \protect\numberline{}\fi}\exsectitle}}
+\def\exerSolnsHeadnToc{%
+ \edef\eq@mkCmd{\expandafter\noexpand
+ \csname\eq@ExrSolnsLevel\endcsname\eq@ExrSolnsStar}%
+ \eq@mkCmd{\exsectitle}\if!\eq@ExrSolnsLabel!\else
+ \label{\eq@ExrSolnsLabel}\fi
+ \if\eq@ExrSolnsStar*%
+% \addtocontents{toc}{\protect\def\protect\web@finalDot{}}
+ \addcontentsline{toc}{\eq@ExrSolnsLevel}{%
+ \@ifundefined{web@latextoc}{}{%
+ \ifx\web@latextoc\eq@YES\else
+ \protect\numberline{}\fi
+ }\exsectitle
+ }%
+ \fi
+}
% \end{macrocode}
%\changes{v6.4q}{2012/03/23}{define \cs{eq@defaultlheader}}
% Determine whether \textsf{web} package is loaded, and define \cs{eq@normallheader}
@@ -3477,8 +3504,8 @@
{\let\eq@defaultlheader\relax}
% \end{macrocode}
% \DescribeMacro{\exerSolnInput} is the macro that formats the opening page
-% of the solutions page and inputs \cmd{\jobname.sol}. Defined \DescribeMacro\eqExSolFileName
-% \cs{eqExSolFileName} in support of the \texttt{solutionsonly} option and the \pkg{ci-solns} package.
+% of the solutions page and inputs \cmd{\jobname.sol}. \DescribeMacro\eqExSolFileName
+% \cs{eqExSolFileName} is defined in support of the \texttt{solutionsonly} option and the \pkg{ci-solns} package.
% \changes{v8.2.8}{2018/12/13}{Defined \string\cs{eqExSolFileName}}
% \begin{macrocode}
\newif\ifExSolutionsSet \ExSolutionsSetfalse
@@ -4201,8 +4228,8 @@
}
\def\eq@promoteNewPageHere#1{\par
\bgroup\@nobreakfalse\addpenalty{-500}%
- \setlength{\@tempdimb}{#1}%
- \@tempdima \pagegoal \advance \@tempdima -\pagetotal
+ \setlength{\@tempdimb}{#1}\@tempdima \pagegoal
+ \advance \@tempdima -\pagetotal
\ifdim \@tempdima<\@tempdimb\ifnum\col@number>\@ne\columnbreak
\else\newpage\penalty1\fi\fi\egroup
}
@@ -4362,13 +4389,39 @@
\let\priorsqslsectitle\@empty
\let\priorsqslinput\@empty
% \end{macrocode}
+% \DescribeMacro{\InputQzSolnsLevel}\nmpsep{*[\ameta{name}]\darg{\ameta{level}}} The solutions to the quizzes
+% are in their own section, historically this has been \cs{section*}; however for some documents, it is
+% desirable to have a numbered section number \cs{section} or \cs{chapter}, or \cs{chapter*}. The
+% \cs{InputQzSolnsLevel} is designed to ease the task of changing how section-type. \ameta{level} is usually
+% \texttt{section} or \texttt{chapter}; use \texttt* if you want solutions to be in \cs{section*} or \cs{chapter*};
+% if the \ameta{name} is used, the beginning of the solutions is marked with \cs{label\darg{name}}.
+% \changes{v8.5.5}{2019/12/17}{Added \string\cs{InputQzSolnsLevel}}
+% \begin{macrocode}
+\def\InputQzSolnsLevel{\@ifstar
+ {\def\eq@QzSolnsStar{*}\InputQzSolnsLevel@i}
+ {\let\eq@QzSolnsStar\@empty\InputQzSolnsLevel@i}}
+\newcommand{\InputQzSolnsLevel@i}[2][]{%
+ \def\eq@QzSolnsLabel{#1}\def\eq@QzSolnsLevel{#2}}
+\InputQzSolnsLevel*{section}
+% \end{macrocode}
% \DescribeMacro{\quizSolnsHeadnToc} sets up the quiz solution title.
% \begin{macrocode}
-\def\quizSolnsHeadnToc{\section*{\sqslsectitle}%
- \addcontentsline{toc}{section}{%
- \@ifundefined{web@latextoc}{}{%
- \ifx\web@latextoc\eq@YES\else
- \protect\numberline{}\fi}\sqslsectitle}}
+\def\quizSolnsHeadnToc
+{%
+ \edef\eq@mkCmd{\expandafter\noexpand
+ \csname\eq@QzSolnsLevel\endcsname\eq@QzSolnsStar}%
+ \eq@mkCmd{\sqslsectitle}\if!\eq@QzSolnsLabel!\else
+ \label{\eq@QzSolnsLabel}\fi
+ \if\eq@QzSolnsStar*%
+% \addtocontents{toc}{\protect\def\protect\web@finalDot{}}
+ \addcontentsline{toc}{\eq@QzSolnsLevel}{%
+ \@ifundefined{web@latextoc}{}{%
+ \ifx\web@latextoc\eq@YES\else
+ \protect\numberline{}\fi
+ }\sqslsectitle
+ }%
+ \fi
+}
% \end{macrocode}
% \DescribeMacro{\quizSolnInput} is the command that actually inputs
% the solutions file \cmd{\jobname.qsl}.
@@ -4914,19 +4967,27 @@
\def\eqButtonDefaults{%
\CA{\eq@local@CA}\AC{}\H{P}\W{1}\S{B}
\BC{1 0 0}\BG{.7529 .7529 .7529}}
-\def\@@eqButtonActions{%
- \A{\JS{if (isEndQuizPushed("\eqBaseName")){\jsR\jsT%
- correctQuiz("\eqBaseName",\thequestionno);%
- \ifusesumrytbls\jsR\jsT\else\jsR\fi
+% \end{macrocode}
+% \leavevmode\DescribeMacro\CorrBtnActionsJS is the JavaScript action
+% to support the \cs{eqButton}/\cs{CorrButton}. The macro may be redefined
+% using the \env{defineJS*} environment. Copy and pasted the contents into
+% a new \env{defineJS*} environment and modify the code.
+% \changes{v8.5}{2019/10/11}{Incorporated \string\env{defineJS} into
+% the action of \string\cs{eqButton}}
+% \begin{macrocode}
+\begin{defineJS}[\makeesc\@]{\CorrBtnActionsJS}
+if (isEndQuizPushed("@eqBaseName")){
+ correctQuiz("@eqBaseName",@thequestionno);
% \end{macrocode}
% (06/13/10) Added the quiz summary table, and the function
% \texttt{correctSumryTbl}. If a summary table is not present
% the function does nothing.
% \begin{macrocode}
- if (typeof correctSumryTbl == "function")\jsR\jsT\jsT
- correctSumryTbl("\eqBaseName",\thequestionno);\jsR
- }}}%
+ if (typeof correctSumryTbl == "function")
+ correctSumryTbl("@eqBaseName",@thequestionno);
}
+\end{defineJS}
+\def\@@eqButtonActions{\A{\JS{\CorrBtnActionsJS}}}
\newcommand\eqButton[2][]{%
% \end{macrocode}
% If nocorrections is true, then this button does not appear.
@@ -4953,8 +5014,8 @@
% green check or a red cross (by default).
% \begin{macrocode}
\def\rbMarkup@Defaults{%
- \BC{}\F{\FHidden}\Ff{\FfReadOnly}\textSize{12}
- \textColor{0 g}\symbolchoice{check}\W{}}
+ \BC{}\F{\FHidden}\Ff{\FfReadOnly}\textSize{12}
+ \textColor{0 g}\symbolchoice{check}\W{}}
\newcommand\rbMarkup[1][]{%
\ifx\grpquestions\eq@One
\def\Fld@name{%
@@ -4964,7 +5025,7 @@
{rbmarkup.\Fld@name}%
{\RadioFieldSize}{\RadioFieldSize}{Yes}{}%
{\eq@setWidgetProps\eq@Check@driver}%
- {\rbMarkup@Defaults\every@CheckBox\every@rbMarkup}}}%
+ {\rbMarkup@Defaults\every@CheckBox\every@rbMarkup}}}
% \end{macrocode}
% \end{macro}
%
@@ -8302,99 +8363,97 @@ if (_bOK) {\jsR\jsT
% Pick up any parameters that would modify the appearance of this text field.
% \begin{macrocode}
\def\RespBoxTxtOnBlur{OnBlurRespBox(%
- \if\@sqTurnOffAlerts1retn\else null\fi,"\curr@quiz");}
+ \if\@sqTurnOffAlerts1retn\else null\fi,"\curr@quiz");}
\def\eqObjAlert{%
- \ifx\eqQuizType\isQZ\ifx\eq@online\eq@YES\ifeq@noquizsolutions
- \else if (false) \fi\fi\fi}
+ \ifx\eqQuizType\isQZ\ifx\eq@online\eq@YES\ifeq@noquizsolutions
+ \else if (false) \fi\fi\fi}
\begin{defineJS}[%
\catcode`\@=0\relax\catcode`\%=14\relax]{\AAKqRespBoxTxt}
if(event.willCommit){
- RecordPointValue(@eqPTs,@thequestionno@ifx@grpquestions1,%
+ RecordPointValue(@eqPTs,@thequestionno@ifx@grpquestions1,%
@thegrpquestionno,@grpPointValue,@grpTotalWeight,%
"@grpEvalFunction"@fi);
- RecordProblemType("@eqQT",@thequestionno);
- var retn = ProcRespTxt(@rbTxtAlt);
- ProcUserResp(retn,event.value,@thequestionno,%
+ RecordProblemType("@eqQT",@thequestionno);
+ var retn = ProcRespTxt(@rbTxtAlt);
+ ProcUserResp(retn,event.value,@thequestionno,%
0@ifx@grpquestions1,@thegrpquestionno@fi);
}
if (!isQuizInitialized("@currQuiz")) {
- @eqObjAlert@space eqAppAlert(InitMsg("@bqlabelISO"),3);
- event.rc = false;
+ @eqObjAlert@space eqAppAlert(InitMsg("@bqlabelISO"),3);
+ event.rc = false;
}
\end{defineJS}
\def\RespBoxTxtDefaults
{%
- \BC{0 0 0}\W{1}\S{S}\textColor{0 g}\F{\FPrint}%
+ \BC{0 0 0}\W{1}\S{S}\textColor{0 g}\F{\FPrint}%
}
\def\moreRespBoxTxtDefaults
{%
- \edef\@moreRespBoxTxtDefaults{%
- \if\eqQuizType\isQZ\ifx\eq@online\eq@YES
- \ifeq@noquizsolutions\else
- \noexpand\Ff{\FfReadOnly}\fi\fi\fi
- }%
+ \edef\@moreRespBoxTxtDefaults{%
+ \if\eqQuizType\isQZ\ifx\eq@online\eq@YES
+ \ifeq@noquizsolutions\else
+ \noexpand\Ff{\FfReadOnly}\fi\fi\fi
+ }%
}
\def\@@RespBoxTxtActions
{%
- \AA{\if\eqQuizType\isQZ
+ \AA{\if\eqQuizType\isQZ
% \end{macrocode}
% Added \cs{eqAAKeystrokArg} to \cs{@@RespBoxTxtActions}
% \changes{v7.8i}{2017/07/21}{Added \string\cs{eqAAKeystrokArg} to \string\cs{@@RespBoxTxtActions}}
% \begin{macrocode}
- \AAKeystroke{\AAKqRespBoxTxt\eqAddAAKeystroke}
- \AAFormat{\eqAddAAFormat}
- \else
- \AAKeystroke{%
- if(event.willCommit) {\r\t
- retn = ProcRespTxt(\rbTxtAlt);\r
-\if\@sqTurnOffAlerts1
- \t\RespBoxTxtOnBlur\r
-\fi
- \eqAddAAKeystroke\r
- }%
- }
- \AAFormat{\eqAddAAFormat}
- \AAOnFocus{\JS{var retn = null;}}
+ \AAKeystroke{\AAKqRespBoxTxt\eqAddAAKeystroke}
+ \AAFormat{\eqAddAAFormat}
+ \else
+ \AAKeystroke{%
+ if(event.willCommit) {\r\t
+ retn = ProcRespTxt(\rbTxtAlt);\r
+ \if\@sqTurnOffAlerts1
+ \t\RespBoxTxtOnBlur\r\fi
+ \eqAddAAKeystroke\r
+ }%
+ }
+ \AAFormat{\eqAddAAFormat}
+ \AAOnFocus{\JS{var retn = null;}}
% \end{macrocode}
-% dps 2/12/05 A fix for Acro7.0, a change in the blur event, must
+% (2005/12/02) A fix for Acro7.0, a change in the blur event, must
% move this event to keystroke so behavior is the same as in previous
% versions.
% \begin{macrocode}
-\if\@sqTurnOffAlerts0
- \AAOnBlur{\JS{\RespBoxTxtOnBlur}}%
-\fi
- \fi
- }
+ \if\@sqTurnOffAlerts0%
+ \AAOnBlur{\JS{\RespBoxTxtOnBlur}}\fi
+ \fi
+ }
}
\def\annot@subtype@rbt{rbt}
\newcommand\@RespBoxTxt[1][]
{%
- \edef\annot@subtype{\annot@subtype@rbt}%
- \eq@AddProbToQzQuesList
- \ifx\grpquestions\eq@Zero\addtocounter{eqpointvalue}{\eqPTs}\fi
- \if\eqQuizType\isQZ
- \def\rbFlag{1}\global\IsRespBoxtrue
- \ifx\grpquestions\eq@One
- \stepcounter{grpquestionno}%
- \def\Fld@name{%
- grpobj.\curr@quiz.\thequestionno.\thegrpquestionno}%
- \else
- \eq@recordThesePTs\eq@recordProbType
- \edef\eqtmp{\aPointType}%
- \xdef\aPointType{\eqtmp,[\eqPTs,"text"]}%
- \stepcounter{questionno}%
- \def\Fld@name{obj.\curr@quiz.\thequestionno}%
- \fi
+ \edef\annot@subtype{\annot@subtype@rbt}%
+ \eq@AddProbToQzQuesList
+ \ifx\grpquestions\eq@Zero\addtocounter{eqpointvalue}{\eqPTs}\fi
+ \if\eqQuizType\isQZ
+ \def\rbFlag{1}\global\IsRespBoxtrue
+ \ifx\grpquestions\eq@One
+ \stepcounter{grpquestionno}%
+ \def\Fld@name{%
+ grpobj.\curr@quiz.\thequestionno.\thegrpquestionno}%
\else
- \stepcounter{questionno}%
- \def\Fld@name{obj.\oField.\thequestionno}%
+ \eq@recordThesePTs\eq@recordProbType
+ \edef\eqtmp{\aPointType}%
+ \xdef\aPointType{\eqtmp,[\eqPTs,"text"]}%
+ \stepcounter{questionno}%
+ \def\Fld@name{obj.\curr@quiz.\thequestionno}%
\fi
- \moreRespBoxTxtDefaults
- \leavevmode\hbox\bgroup\text@@Field{#1}{\Fld@name}%
- {\RBW}{\DefaultHeightOfWidget}%
- {\eq@protect\AA}{\eq@setWidgetProps\@@RespBoxTxt}%
- {\RespBoxTxtDefaults\@moreRespBoxTxtDefaults
- \@@RespBoxTxtActions\every@eqTextField\every@RespBoxTxt}%
+ \else
+ \stepcounter{questionno}%
+ \def\Fld@name{obj.\oField.\thequestionno}%
+ \fi
+ \moreRespBoxTxtDefaults
+ \leavevmode\hbox\bgroup\text@@Field{#1}{\Fld@name}%
+ {\RBW}{\DefaultHeightOfWidget}%
+ {\eq@protect\AA}{\eq@setWidgetProps\@@RespBoxTxt}%
+ {\RespBoxTxtDefaults\@moreRespBoxTxtDefaults
+ \@@RespBoxTxtActions\every@eqTextField\every@RespBoxTxt}%
}
% \end{macrocode}
% Now get the next two required parameters. Also, see if there is going to be a solution.
@@ -8406,35 +8465,36 @@ if (!isQuizInitialized("@currQuiz")) {
% |#1 = filter|, |#2 = comp|
% \begin{macrocode}
\def\@@RespBoxTxt#1#2{%
- \@ifnextchar[{\@@@RespBoxTxt{#1}{#2}}
- {\@ifstar{\@@@RespBoxTxt{#1}{#2}[\curr@quiz.\thequestionno]}%
- {\@@@RespBoxTxt{#1}{#2}[]}}}
+ \@ifnextchar[%]
+ {\@@@RespBoxTxt{#1}{#2}}
+ {\@ifstar{\@@@RespBoxTxt{#1}{#2}[\curr@quiz.\thequestionno]}%
+ {\@@@RespBoxTxt{#1}{#2}[]}}}
% \end{macrocode}
% |#1 = filter|, |#2 = comp|, |#3 = dest|, |#4 = num_alts|
% \begin{macrocode}
\def\eq@ZERO{0}\def\eq@ONE{1}\def\eq@TWO{2}
\def\@@@RespBoxTxt#1#2[#3]#4{%
- \xdef\@qzsolndest{#3}%
- \def\eq@argi{#1}\ifx\eq@argi\eq@ZERO\else
- \ifx\eq@argi\eq@ONE\else\ifx\eq@argi\eq@TWO\else
- \def\eq@argi{-1}\fi\fi\fi
- \def\eq@argii{#2}\ifx\eq@argii\eq@ONE\else\def\eq@argii{0}\fi
- \begingroup
- \ifnum\eq@argii=1\relax
+ \xdef\@qzsolndest{#3}%
+ \def\eq@argi{#1}\ifx\eq@argi\eq@ZERO\else
+ \ifx\eq@argi\eq@ONE\else\ifx\eq@argi\eq@TWO\else
+ \def\eq@argi{-1}\fi\fi\fi
+ \def\eq@argii{#2}\ifx\eq@argii\eq@ONE\else\def\eq@argii{0}\fi
+ \begingroup
+ \ifnum\eq@argii=1\relax
% \end{macrocode}
% local definitions: \DescribeMacro{\rexpStr}\cs{rexpStr},
% \DescribeMacro{\\<RegEXP>}|\\|, and \DescribeMacro{\word}\cs{word}.
% \begin{macrocode}
- \def\rexpStr##1{\eqbs\eqbs\eqbs\eqbs##1}%
- \def\\##1{\eqbs\eqbs\eqbs\eqbs##1}%
- \def\word##1{\\b##1\\b}\def\any{@any@}\fi
- \xdef\rbTxtAlt{\rbFlag,\eq@argi,\eq@argii}%
- \global\let\txtAltList\@empty
- \count0=#4 \ifnum\count0 > 0 \expandafter\@argRead\else
- \PackageError{exerquiz}{%
- The fourth required parameter of \string\RespBoxTxt\MessageBreak
- is required to be a positive integer. You entered\MessageBreak
- #4\space instead}{Enter a positive integer.}\fi
+ \def\rexpStr##1{\eqbs\eqbs\eqbs\eqbs##1}%
+ \def\\##1{\eqbs\eqbs\eqbs\eqbs##1}%
+ \def\word##1{\\b##1\\b}\def\any{@any@}\fi
+ \xdef\rbTxtAlt{\rbFlag,\eq@argi,\eq@argii}%
+ \global\let\txtAltList\@empty
+ \count0=#4 \ifnum\count0 > 0 \expandafter\@argRead\else
+ \PackageError{exerquiz}{%
+ The fourth required parameter of \string\RespBoxTxt\MessageBreak
+ is required to be a positive integer. You entered\MessageBreak
+ #4\space instead}{Enter a positive integer.}\fi
}
\def\@argRead#1{\xdef\jsTempArgs{\txtAltList}%
\ifx\txtAltList\@empty\xdef\txtAltList{"#1"}\else
@@ -8519,16 +8579,16 @@ if (!isQuizInitialized("@currQuiz")) {
\begin{defineJS}[%
\catcode`\@=0\relax\catcode`\%=14\relax]{\AAKqRespBoxTxtPC}
if(event.willCommit){
- RecordPointValue(@eqPTs,@thequestionno@ifx@grpquestions1,%
+ RecordPointValue(@eqPTs,@thequestionno@ifx@grpquestions1,%
@thegrpquestionno,@grpPointValue,@grpTotalWeight,%
"@grpEvalFunction"@fi);
- RecordProblemType("@eqQT",@thequestionno);
- var retn = ProcRespTxtPC(@rbTxtAlt);
+ RecordProblemType("@eqQT",@thequestionno);
+ var retn = ProcRespTxtPC(@rbTxtAlt);
@ifx@grpquestions1%
- ProbValue[@thequestionno][3+@thegrpquestionno]%
+ProbValue[@thequestionno][3+@thegrpquestionno]%
=ProcRespTxtPC.txtPCpCr;@else%
- ProbValue[@thequestionno]=ProcRespTxtPC.txtPCpCr;@fi
- ProcUserResp(retn,event.value,@thequestionno,0%
+ProbValue[@thequestionno]=ProcRespTxtPC.txtPCpCr;@fi
+ ProcUserResp(retn,event.value,@thequestionno,0%
@ifx@grpquestions1,@thegrpquestionno@fi);
}
if (!isQuizInitialized("@currQuiz")) {
@@ -8702,7 +8762,8 @@ if (!isQuizInitialized("@currQuiz")) {
\stepcounter{questionno}%
\xdef\@qzsolndest{#1}%
\edef\eqtmp{\aPointType}\xdef\aPointType{\eqtmp,[\eqPTs,"essay"]}%
- \expandafter\mbox\expandafter{\expandafter\text@@Field\expandafter{\rbe@rgi}{essay.\curr@quiz.\thequestionno}{#2}{#3}%
+ \expandafter\mbox\expandafter{\expandafter\text@@Field
+ \expandafter{\rbe@rgi}{essay.\curr@quiz.\thequestionno}{#2}{#3}%
{\eq@protect\AA}{\eq@setWidgetProps
\eq@TextField}{\RespBoxEssayDefaults\@@RespBoxEssayActions
\every@eqTextField}}%
@@ -9226,8 +9287,9 @@ if (!isQuizInitialized("@currQuiz")) {
% \end{macrocode}
% Cosmetic change replaced \cs{noexpand} with \cs{string}.
% \changes{v8.2.15}{2019/08/06}{replace \string\cs{noexpand} with \string\cs{string}}
+% \changes{v8.5.4}{2019/11/03}{Reverted to \string\cs{noexpand}}
% \begin{macrocode}
- \noexpand\eqQzQuesList{\string
+ \noexpand\eqQzQuesList{\noexpand
\@eqListExp{\@currentQues}{\the\c@page}}}%
% \@eqListExp{\@currentQues}{\thepage}}}%
% \end{macrocode}
@@ -10202,9 +10264,10 @@ if (!isQuizInitialized("@currQuiz")) {
% \begin{macrocode}
\begin{newsegment}{AeB: AcroTeX eDucation Bundle}
/*
- Document Level JavaScript
- AcroTeX eDucation Bundle
- D. P. Story copyright 2000-\the\year
+ Document Level JavaScript
+ AcroTeX eDucation Bundle
+ D. P. Story copyright 2000-\the\year
+ \dlPkgInfoPkg Dated \dlPkgInfoDate
*/
var exerquizLoaded = true;
this.disclosed = true;
@@ -11687,16 +11750,16 @@ function ProcUserResp(key,userresp,probno,notify)
% actual key is the first entry. The second entry, not used here, is 1
% if user has selected at least one correct answer, zero otherwise.
% \begin{macrocode}
- if ( typeof key == "object" ) {
- RightWrong[probno][0] = key[0];
- RightWrong[probno][1] = key[1];
- Responses[probno] = userresp;
- if (Responses[probno].length==0)
- Responses[probno]=undefined;
- } else {
- RightWrong[probno] = (!!key)?1:0;
- Responses[probno] = userresp;
- }
+ if ( typeof key == "object" ) {
+ RightWrong[probno][0] = key[0];
+ RightWrong[probno][1] = key[1];
+ Responses[probno] = userresp;
+ if (Responses[probno].length==0)
+ Responses[probno]=undefined;
+ } else {
+ RightWrong[probno] = (!!key)?1:0;
+ Responses[probno] = userresp;
+ }
}
% \end{macrocode}
% \texttt{ProcUserResp()} is also called by a link, so we'll skip this code.
@@ -11709,29 +11772,29 @@ function ProcUserResp(key,userresp,probno,notify)
}
function ProcUserNoResp(key,userresp,probno,notify)
{
- if ( arguments.length > 4 ) {
- RightWrong[probno][arguments[4]] = undefined;
- Responses[probno][arguments[4]] = undefined;
- var bVoidArray=true;
- for (var i=0; i<Responses[probno].length; i++) {
- if ( typeof Responses[probno][i] != "undefined") {
- bVoidArray=false;
- break;
- }
- }
+ if ( arguments.length > 4 ) {
+ RightWrong[probno][arguments[4]] = undefined;
+ Responses[probno][arguments[4]] = undefined;
+ var bVoidArray=true;
+ for (var i=0; i<Responses[probno].length; i++) {
+ if ( typeof Responses[probno][i] != "undefined") {
+ bVoidArray=false;
+ break;
+ }
+ }
if (bVoidArray) {
Responses[probno]=undefined;
RightWrong[probno]=undefined;
- ProbValue[probno]=undefined;
+ ProbValue[probno]=undefined;
}
- } else {
- RightWrong[probno] = undefined;
- Responses[probno] = undefined;
- }
- if ( typeof fieldPopTbl == "function" ) {
- var a=reExtractBaseName.exec(event.target.name);
- fieldPopTbl(a[1]);
- }
+ } else {
+ RightWrong[probno] = undefined;
+ Responses[probno] = undefined;
+ }
+ if ( typeof fieldPopTbl == "function" ) {
+ var a=reExtractBaseName.exec(event.target.name);
+ fieldPopTbl(a[1]);
+ }
}
function InitializeQuiz(qtfield,mark) {
var oQName=eval(qtfield);
@@ -11852,29 +11915,31 @@ function resetQuiz(qtfield)
aQuizControl[qtfield] = -1;
}
% \end{macrocode}
-% The function RecordPointValue has two required parameters. For a grouped question,
-% there are three more parameters, they are, in order (2) grpquestionno (3) grpPointValue
-% (4) total weight (5) grpEvalFunction, a JS function that evaluates the group.
-% The elements of the ProbValue array are as follows:
+% \leavevmode\IndexJS{RecordPointValue}\hskip-\marginparsep\texttt{(\ameta{ptValue},\ameta{probno}}\\
+% \texttt{[,grpquestionno,grpPointValue,\ameta{total-weight},\ameta{grpEvalFunction}])}\\
+% The function \texttt{RecordPointValue} has two required parameters. For a grouped question,
+% there are four \emph{more} parameters, they are, in order (2) \texttt{grpquestionno} (3) \texttt{grpPointValue}
+% (4) total weight (5) \texttt{grpEvalFunction}, a JS function that evaluates the group.\par\medskip\noindent
+% The elements of the \texttt{ProbValue} array are as follows:
%\begin{enumerate}
% \item If multiple choice, then the entry is \texttt{[0, point value, partial credit]}
% \item If objective type question that is not part of a group, the entry is a number \texttt{point value}
% \item total weight of the group, significant only if greater than point value
% \item If objective grouped-type question, the entry is\\
-% \texttt{[1, EvalJS, grpPointValue, <list of points for each part>]}
+% \texttt{[1, EvalJS, grpPointValue, \ameta{list of points for each part}]}
%\end{enumerate}
% \begin{macrocode}
function RecordPointValue(ptvalue,probno)
{
- if (arguments.length > 2) {
- if ( typeof ProbValue[probno] == "undefined" ) {
- ProbValue[probno]=[1,arguments[5],arguments[3],arguments[4]];
- ProbValue[probno][3+arguments[2]] = ptvalue;
- } else ProbValue[probno][3+arguments[2]] = ptvalue;
- }
- else {
- ProbValue[probno]=ptvalue;
- }
+ if (arguments.length > 2) {
+ if ( typeof ProbValue[probno] == "undefined" ) {
+ ProbValue[probno]=[1,arguments[5],arguments[3],arguments[4]];
+ ProbValue[probno][3+arguments[2]] = ptvalue;
+ } else ProbValue[probno][3+arguments[2]] = ptvalue;
+ }
+ else {
+ ProbValue[probno]=ptvalue;
+ }
}
function RecordProblemType(qType,probno)
{
@@ -12055,51 +12120,62 @@ function ProcessQuestion (key,letterresp,probno,
% \begin{macrocode}
function correctQuiz(qtfield,nQuestions)
{
- var oQName=eval(qtfield);
- var defaultColor=(typeof oQName.DefaultColorJSLoc=="undefined")%
+% \end{macrocode}
+% (2019/10/14) If \texttt{oRecordOfQuizData} is present (from \pkg{eq-save}, we use that data from the quiz.
+% \changes{v8.5.1}{2019/10/14}{Incorporated oRecordOfQuizData into correctQuiz()}
+% \begin{macrocode}
+ var bROQD=(typeof oRecordOfQuizData=="object");
+ if(bROQD && %
+(typeof oRecordOfQuizData["RightWrong."+qtfield]!="undefined")) {
+ RightWrong=oRecordOfQuizData["RightWrong."+qtfield];
+ ProbDist=oRecordOfQuizData["ProbDist."+qtfield];
+ }
+ var oQName=eval(qtfield);
+ var defaultColor=(typeof oQName.DefaultColorJSLoc=="undefined")%
?\defaultColorJS:oQName.DefaultColorJSLoc;
- var rightColor=(typeof oQName.RightColorJSLoc=="undefined")%
+ var rightColor=(typeof oQName.RightColorJSLoc=="undefined")%
?\rghtColorJS:oQName.RightColorJSLoc;
- var wrongColor=(typeof oQName.WrongColorJSLoc=="undefined")%
+ var wrongColor=(typeof oQName.WrongColorJSLoc=="undefined")%
?\wrngColorJS:oQName.WrongColorJSLoc;
- var rightAnsSymb=(typeof oQName.RightAnsSymbJSLoc=="undefined")%
+ var rightAnsSymb=(typeof oQName.RightAnsSymbJSLoc=="undefined")%
?\rghtAnsSymbJS:oQName.RightAnsSymbJSLoc;
- var wrongAnsSymb=(typeof oQName.WrongAnsSymbJSLoc=="undefined")%
+ var wrongAnsSymb=(typeof oQName.WrongAnsSymbJSLoc=="undefined")%
?\wrngAnsSymbJS:oQName.WrongAnsSymbJSLoc;
% \end{macrocode}
% Implement a local version of fully correcting MC and MS questions.
% \changes{v8.1l}{2018/02/07}{Add local version of \string\cs{corrChoiceFullOn}}
% \begin{macrocode}
var bFullyCorrect=(typeof oQName.fullyCorrectLoc=="undefined")%
-?\eqCorrChoiceFully:oQName.fullyCorrectLoc; // dpsf07
+?\eqCorrChoiceFully:oQName.fullyCorrectLoc;
% \end{macrocode}
% MC or MS questions
% \begin{macrocode}
- var f = this.getField("mcq." + qtfield);
-% if ( f != null) f.display = display.visible;
+ var f = this.getField("mcq." + qtfield);
% \end{macrocode}
+% For MC question, show only the incorrect ones, depending on the
+% switch \texttt{bFullyCorrect}.
% \changes{v8.1f}{2017/12/04}{Added an option for MC question not to
% show the correct answer, but only the incorrect ones.}
% \begin{macrocode}
- if ( f != null) {
- if (bFullyCorrect) { // dpsf07
- f.display = display.visible;
- } else {
- for (var n=1; n<=nQuestions; n++) {
- var h=this.getField("mc."+qtfield+"."+n);
- var bOk=(h!=null);
- if(bOk) var choiceType="mc";
- else {
- h=this.getField("mck."+qtfield+"."+n);
- bOk=(h!=null);
- var choiceType="mck";
- }
- if (bOk) {
- var mcq=this.getField("mcq."+qtfield+"."+n);
- var g=mcq.getArray();
- if (choiceType=="mc") {
- for (var j=0; j< g.length; j++) {
- g[j].display=(h.isBoxChecked(j))?%
+ if ( f != null) {
+ if (bFullyCorrect) { // dpsf07
+ f.display = display.visible;
+ } else {
+ for (var n=1; n<=nQuestions; n++) {
+ var h=this.getField("mc."+qtfield+"."+n);
+ var bOk=(h!=null);
+ if(bOk) var choiceType="mc";
+ else {
+ h=this.getField("mck."+qtfield+"."+n);
+ bOk=(h!=null);
+ var choiceType="mck";
+ }
+ if (bOk) {
+ var mcq=this.getField("mcq."+qtfield+"."+n);
+ var g=mcq.getArray();
+ if (choiceType=="mc") {
+ for (var j=0; j< g.length; j++) {
+ g[j].display=(h.isBoxChecked(j))?%
display.visible:display.hidden;
}
} else {
@@ -12115,95 +12191,89 @@ display.visible:display.hidden;
}
f = this.getField("obj." + qtfield);
if ( f != null ) {
- var a = f.getArray();
- var re=/^obj\./;
- for (var i = 0; i < a.length; i++) {
- var probno = a[i].name.replace(/.*\./g,"");
- var rbmuname = a[i].name.replace(re,"rbmarkup\.");
- var oRBMarkup = this.getField(rbmuname);
- var bRBMU = ( oRBMarkup != null );
- if ( RightWrong[probno] == 1 ) {
- a[i].strokeColor = rightColor;
- if (bRBMU) {
- oRBMarkup.textColor=rightColor;
- oRBMarkup.style=rightAnsSymb;
- }
- } else {
- a[i].strokeColor = wrongColor;
- if (bRBMU) {
- oRBMarkup.textColor=wrongColor;
- oRBMarkup.style=wrongAnsSymb;
- }
- }
+ var a = f.getArray();
+ var re=/^obj\./;
+ for (var i = 0; i < a.length; i++) {
+ var probno = a[i].name.replace(/.*\./g,"");
+ var rbmuname = a[i].name.replace(re,"rbmarkup\.");
+ var oRBMarkup = this.getField(rbmuname);
+ var bRBMU = ( oRBMarkup != null );
+ if ( RightWrong[probno] == 1 ) {
+ a[i].strokeColor = rightColor;
+ if (bRBMU) {
+ oRBMarkup.textColor=rightColor;
+ oRBMarkup.style=rightAnsSymb;
+ }
+ } else {
+ a[i].strokeColor = wrongColor;
+ if (bRBMU) {
+ oRBMarkup.textColor=wrongColor;
+ oRBMarkup.style=wrongAnsSymb;
}
+ }
}
- f = this.getField("grpobj." + qtfield);
- var re=/^grpobj\./;
- if ( f != null ) {
- var a = f.getArray();
- for ( var i = 0; i < a.length; i++) {
- var rbmuname = a[i].name.replace(re,"rbmarkup\.");
- var oRBMarkup = this.getField(rbmuname);
- var bRBMU = ( oRBMarkup != null );
- var aX = a[i].name.split(".");
- var probno = 1*aX[aX.length-2];
- var grpProbno = 1*aX[aX.length-1];
- if ( ( RightWrong[probno] != undefined ) %
+ }
+ f = this.getField("grpobj." + qtfield);
+ var re=/^grpobj\./;
+ if ( f != null ) {
+ var a = f.getArray();
+ for ( var i = 0; i < a.length; i++) {
+ var rbmuname = a[i].name.replace(re,"rbmarkup\.");
+ var oRBMarkup = this.getField(rbmuname);
+ var bRBMU = ( oRBMarkup != null );
+ var aX = a[i].name.split(".");
+ var probno = 1*aX[aX.length-2];
+ var grpProbno = 1*aX[aX.length-1];
+ if ( ( RightWrong[probno] != undefined ) %
&& ( RightWrong[probno][grpProbno] == 1 ) ) {
- a[i].strokeColor = rightColor;
- if (bRBMU) {
- oRBMarkup.textColor=rightColor;
- oRBMarkup.style=rightAnsSymb;
- }
- } else {
- a[i].strokeColor = wrongColor;
- if (bRBMU) {
- oRBMarkup.textColor=wrongColor;
- oRBMarkup.style=wrongAnsSymb;
- }
- }
+ a[i].strokeColor = rightColor;
+ if (bRBMU) {
+ oRBMarkup.textColor=rightColor;
+ oRBMarkup.style=rightAnsSymb;
}
+ } else {
+ a[i].strokeColor = wrongColor;
+ if (bRBMU) {
+ oRBMarkup.textColor=wrongColor;
+ oRBMarkup.style=wrongAnsSymb;
+ }
+ }
}
- f=this.getField("rbmarkup."+qtfield);
- if ( f != null ) f.display = display.visible;
-% f = this.getField("Ans." + qtfield);
- % if ( f != null ) f.strokeColor = defaultColor;
- f = this.getField("promptButton." + qtfield)
- if ( f != null ) f.display = display.hidden;
- f = this.getField("corr." + qtfield);
- if ( f != null ) f.display = display.noPrint;
+ }
+ f=this.getField("rbmarkup."+qtfield);
+ if ( f != null ) f.display = display.visible;
+ f = this.getField("promptButton." + qtfield)
+ if ( f != null ) f.display = display.hidden;
+ f = this.getField("corr." + qtfield);
+ if ( f != null ) f.display = display.noPrint;
% \end{macrocode}
% dps (01/01/04) If there are qMark fields, then write marks for each question
% to them.
% \begin{macrocode}
- f = this.getField("qMark."+qtfield);
- if ( f != null )
- {
-% console.println("ProbDist = " + ProbDist.toSource() );
- for ( var i = 1; i <= nQuestions; i++)
- {
- if ( ProbValue[i] == undefined ) ProbValue[i]=0
- f = this.getField("qMark."+qtfield+"."+(i-1));
- if ( f != null )
- {
+ f = this.getField("qMark."+qtfield);
+ if ( f != null ) {
+ for ( var i = 1; i <= nQuestions; i++) {
+ if ( ProbValue[i] == undefined ) ProbValue[i]=0;
+ f = this.getField("qMark."+qtfield+"."+(i-1));
+ if ( f != null ) {
% \end{macrocode}
% (3/22/04) This is code to account for grouping
% \begin{macrocode}
- // find the next non-null field
- for ( var j=i; j <= nQuestions; j++)
- {
- var h = this.getField("qMark."+qtfield+"."+j);
- if ( h != null ) break;
- }
- var g = f.getArray();
- var qpts=(ProbDist[i]==undefined) ? 0 : ProbDist[i];
- if ( !negPointsMarkupAllowed && (qpts < 0) ) qpts=0;
- g[0].value = qpts + (( qpts == 1 ) ? " \eqptLabel\space"
- : " \eqptsLabel");
- }
+ // find the next non-null field
+ for ( var j=i; j <= nQuestions; j++)
+ {
+ var h = this.getField("qMark."+qtfield+"."+j);
+ if ( h != null ) break;
}
- this.getField("qMark."+qtfield).display = display.visible;
+ var g = f.getArray();
+ var qpts=(ProbDist[i]==undefined) ? 0 : ProbDist[i];
+ if ( !negPointsMarkupAllowed && (qpts < 0) ) qpts=0;
+ g[0].value = qpts + (( qpts == 1 ) ? " \eqptLabel\space"
+ : " \eqptsLabel");
+ }
}
+ this.getField("qMark."+qtfield).display = display.visible;
+ }
}
% \end{macrocode}
% When pdftex is used, the total tally box does not work because pdftex does not support
@@ -12384,27 +12454,26 @@ function notifyField(success, flag, fieldname) {
?\wrngColorJS:oQName.WrongColorJSLoc;
var wrongSymb=(typeof oQName.WrongAnsSymbJSLoc=="undefined")%
?\wrngAnsSymbJS:oQName.WrongAnsSymbJSLoc;
- if (success) {
- f.strokeColor = rightColor;
- if (isthereRBUP) {
- g.style = rightSymb;
- g.textColor=rightColor;
- g.display=display.visible;
- }
- return true;
- } else {
- updateTally.downState=false;
- updateTally(fieldname);
- f.strokeColor = wrongColor;
- if (isthereRBUP) {
- b2 = ( typeof oQName.WrongAnsSymbJSLoc == "undefined" );
- g.style = wrongSymb;
- g.textColor=wrongColor;
- g.display=display.visible;
- }
- return false;
+ if (success) {
+ f.strokeColor = rightColor;
+ if (isthereRBUP) {
+ g.style = rightSymb;
+ g.textColor=rightColor;
+ g.display=display.visible;
+ }
+ return true;
+ } else {
+ updateTally.downState=false;
+ updateTally(fieldname);
+ f.strokeColor = wrongColor;
+ if (isthereRBUP) {
+ b2 = ( typeof oQName.WrongAnsSymbJSLoc == "undefined" );
+ g.style = wrongSymb;
+ g.textColor=wrongColor;
+ g.display=display.visible;
}
-// return null; // remove ?
+ return false;
+ }
}
% \end{macrocode}
% \begin{macrocode}
@@ -12427,7 +12496,6 @@ function updateTally(fieldname)
if (!updateTally.downState) f.value += 1;
return true;
} else return false;
-
}
% \end{macrocode}
% Below is the \texttt{noPeek} JS function that has been part of \textsf{exerquiz} from the
@@ -12455,16 +12523,16 @@ var bNoPeekWait=false;
var oNoPeekTimer;
function noPeek(qtfield,rtnPage)
{
- if (!bNoPeekWait) {
- if ( (typeof (aQuizControl[qtfield]) == "undefined") %
+ if (!bNoPeekWait) {
+ if ( (typeof (aQuizControl[qtfield]) == "undefined") %
|| (aQuizControl[qtfield] != -1) ) {
- bNoPeekWait=true;
- oNoPeekTimer=app.setTimeOut("bNoPeekWait=false;%
+ bNoPeekWait=true;
+ oNoPeekTimer=app.setTimeOut("bNoPeekWait=false;%
app.clearTimeOut(oNoPeekTimer);",5);
- this.pageNum = rtnPage-1;
- \NoPeekAlert;
- }
- } else this.pageNum = rtnPage-1;
+ this.pageNum = rtnPage-1;
+ \NoPeekAlert;
+ }
+ } else this.pageNum = rtnPage-1;
}
% \end{macrocode}
% When the user exits a fill-in shortquiz field, this function is called.
@@ -14083,9 +14151,9 @@ function qRadioButtonMCFI(key,qname,n) {
\renewcommand\eq@Score{Skor:}
\renewcommand\eq@OutOf{\protect\374zerinden}
\renewcommand\eqQuizTotalMsg{%
- "\eqScore\space"+nQuestions+" \eqOutOf\space"+Score}
+ "\eqScore\space"+Score+" \eqOutOf\space"+nQuestions}
\renewcommand\eqQuizPointsMsg{%
- "\eqptScore\space"+nPointTotal+" \eqOutOf\space"+ptScore}
+ "\eqptScore\space"+ptScore+" \eqOutOf\space"+nPointTotal}
\renewcommand\eq@local@CorrAnsButton{Cevap}
\renewcommand\eqInitQuizMsg{%
"Kuizi Bitirdiniz. Do\protect\u011Fru cevaplar\protect\u0131