summaryrefslogtreecommitdiff
path: root/texmf-dist/source/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2018-06-11 12:19:19 +0900
committerNorbert Preining <norbert@preining.info>2018-06-11 12:19:19 +0900
commit17e285e7733468f00b6e8d096fdd7ffe818f09c8 (patch)
treebb187730b3d22ed29ef7e36594f2fb4bf867e437 /texmf-dist/source/latex
parent147631b4e676c1f18156ef3dcdee9a5838c0d93d (diff)
acrotex update
Diffstat (limited to 'texmf-dist/source/latex')
-rw-r--r--texmf-dist/source/latex/acrotex/dljslib.dtx251
-rw-r--r--texmf-dist/source/latex/acrotex/doc/aeb_man.tex368
-rw-r--r--texmf-dist/source/latex/acrotex/doc/eformman.tex395
-rw-r--r--texmf-dist/source/latex/acrotex/eforms.dtx501
-rw-r--r--texmf-dist/source/latex/acrotex/eforms.ins1
-rw-r--r--texmf-dist/source/latex/acrotex/exerquiz.dtx2025
-rw-r--r--texmf-dist/source/latex/acrotex/insdljs.dtx10
-rw-r--r--texmf-dist/source/latex/acrotex/web.dtx12
8 files changed, 2601 insertions, 962 deletions
diff --git a/texmf-dist/source/latex/acrotex/dljslib.dtx b/texmf-dist/source/latex/acrotex/dljslib.dtx
index cb974275..9d1d1dfe 100644
--- a/texmf-dist/source/latex/acrotex/dljslib.dtx
+++ b/texmf-dist/source/latex/acrotex/dljslib.dtx
@@ -2,7 +2,7 @@
%<*copyright>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% dljsLib.sty package, %%
-%% Copyright (C) 2001-2016 D. P. Story %%
+%% Copyright (C) 2001-2018 D. P. Story %%
%% dpstory@uakron.edu %%
%% %%
%% This program can redistributed and/or modified under %%
@@ -14,7 +14,7 @@
%</copyright>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{dljslib}
-%<package> [2014/10/05 v2.0 Manage a Library of Document Level JavaScripts (dps)]
+%<package> [2017/08/11 v2.1 Manage a Library of Document Level JavaScripts (dps)]
%<*driver>
\documentclass{ltxdoc}
\usepackage[colorlinks,hyperindex=false]{hyperref}
@@ -49,6 +49,8 @@
% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{dljslib}{Inputting aebdonotindex.def}}
% {\PackageInfo{dljslib}{aebdonotindex.def cannot be found}}
%
+% \changes{v2.1}{2017/08/11}{Corresponding to exerquiz v8.0, dljslib is modified to
+% conform to multi-letter variables.}
% \changes{v1.3}{2005/08/27}{Added new user contributed routines for unordered,
% interval, point and factored responses. Added a feature whereby you
% can create a file called libcusopt.opt to declare your own options
@@ -151,6 +153,7 @@
% \textsf{dvipdfm}.
%
% \begin{macrocode}
+\RequirePackage{exerquiz}[2017/08/04]
\RequirePackage{insdljs}
% \end{macrocode}
% After inputting \textsf{insdljs}, we define |\setdecimalpoint|, which populates
@@ -265,15 +268,18 @@ var dljslib = true;
\fi
\begin{library@holding}{equations}
\begin{newsegment}{dljslib: Equation Handling}
-function ProcRespEq(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
+function ProcRespEq(flag,CorrAns,n,epsilon,domain,indepVars,oComp)
{
if (!ProcessIt) return null;
ok2Continue = true;
var success;
var fieldname = event.target.name;
- var UserAns = event.value;
% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+ var UserAns=(bSubstVars)?arguments[7]:event.value;
var CorrExpressions = CorrAns.split("=");
var zCorrAns = "("+CorrExpressions[0]+")-("+CorrExpressions[1] +")";
UserAns = stripWhiteSpace (UserAns);
@@ -334,13 +340,13 @@ function ProcRespEq(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
zUserAns = ParseInput(zUserAns);
if (!ok2Continue) return null;
% convert vars to new format, if needed
- indepVar = TypeParameters(indepVar);
- var lambda = getNonZeroRatio (domain, indepVar, zCorrAns, zUserAns);
+ indepVars = TypeParameters(indepVars);
+ var lambda = getNonZeroRatio (domain, indepVars, zCorrAns, zUserAns);
if ( lambda == null ) {
eqAppAlert(\eqSyntaxErrorUndefVar,3); return null; };
if ( !ok2Continue ) return notifyField(false, flag, fieldname);
zCorrAns = lambda + "*(" + zCorrAns + ")";
- success=randomPointCompare (n,domain,indepVar,epsilon,
+ success=randomPointCompare (n,domain,indepVars,epsilon,
zCorrAns,zUserAns,comp)
if ( success == null ) { eqAppAlert(\eqSyntaxErrorUndefVar,3);
return null; }
@@ -419,7 +425,7 @@ function getNonZeroRatio (_a, _v, _F, _G)
\fi
\begin{library@holding}{vectors}
\begin{newsegment}{dljslib: Vector Handling}
-function ProcVec (flag,CorrAns,n,epsilon,domain,indepVar,oComp)
+function ProcVec (flag,CorrAns,n,epsilon,domain,indepVars,oComp)
{
% \end{macrocode}
% This function attempts to process questions that have vectors
@@ -498,7 +504,7 @@ typeof oComp.priorParse != "undefined" ) {
return null;
}
// convert to new format, if needed
- indepVar = TypeParameters(indepVar);
+ indepVars = TypeParameters(indepVars);
for (i=0; i<aCorrAns.length; i++) {
aCorrAns[i] = ParseInput(aCorrAns[i]);
if (!ok2Continue) {
@@ -511,7 +517,7 @@ typeof oComp.priorParse != "undefined" ) {
return null;
}
if (!ok2Continue) return null;
- success=randomPointCompare (n,domain,indepVar,epsilon,
+ success=randomPointCompare (n,domain,indepVars,epsilon,
aCorrAns[i],aUserAns[i],comp)
if ( success == null ) {
eqAppAlert(\eqSyntaxErrorUndefVar,3); return null; }
@@ -552,12 +558,17 @@ typeof oComp.priorParse != "undefined" ) {
%\end{verbatim}
%\end{flushleft}
% \begin{macrocode}
-function ProcRespSetNum(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
+function ProcRespSetNum(flag,CorrAns,n,epsilon,domain,indepVars,oComp)
{
ok2Continue = true;
if (!ProcessIt) return null;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+ var UserAns=(bSubstVars)?arguments[7]:event.value;
UserAns = stripWhiteSpace(UserAns);
CorrAns = stripWhiteSpace(CorrAns);
if (!ok2Continue) return null;
@@ -594,7 +605,7 @@ function ProcRespSetNum(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
return notifyField(false, flag, fieldname);
for ( var i=0; i< aCorrAns.length; i++) {
var retn = _ProcResp(%
-flag,aCorrAns[i],aUserAns[i],n,epsilon,domain,indepVar,oComp);
+flag,aCorrAns[i],aUserAns[i],n,epsilon,domain,indepVars,oComp);
if ( retn == -1 ) return null;
if ( retn == null ) return syntaxError(), null;
numCorrect += (retn) ? 1 : 0;
@@ -649,12 +660,17 @@ function formatAsVector() {
%\end{verbatim}
% \end{flushleft}
% \begin{macrocode}
-function ProcRespSetSym(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
+function ProcRespSetSym(flag,CorrAns,n,epsilon,domain,indepVars,oComp)
{
ok2Continue = true;
if (!ProcessIt) return null;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+ var UserAns=(bSubstVars)?arguments[7]:event.value;
UserAns = stripWhiteSpace(UserAns);
CorrAns = stripWhiteSpace(CorrAns);
if (!ok2Continue) return null;
@@ -674,7 +690,7 @@ function ProcRespSetSym(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
var retn=ck4Braces(UserAns);
if (retn==null) return null;
var aUserAns = UserAns.split(",");
- var _V = indepVar.split(",");
+ var _V = indepVars.split(",");
for ( var _i=0; _i < _V.length; _i++) {
eval ( "var "+ _V[_i] + " = \"" + _i + "\";");
}
@@ -691,8 +707,8 @@ function ProcRespSetSym(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
for ( var _i=0; _i < aCorrAns.length; _i++) {
try {
if (isNaN(eval(aCorrAns[_i])))
- return eqAppAlert(
- "Author error, recheck your code",3), null;
+ return eqAppAlert(%
+"Author error, recheck your code",3), null;
aCorrAns[_i] = eval(aCorrAns[_i]);
} catch(e) { return eqAppAlert(
"Author error, recheck your code",3), null; }
@@ -722,11 +738,16 @@ flag,aCorrAns[_i],aUserAns[_i],n,epsilon,"[0,1]","i:_x",oComp);
% \emph{ordered} list of expressions.
% \begin{macrocode}
function ProcRespListFormula(flag,CorrAns,n,epsilon,domain,%
-indepVar,oComp) {
+indepVars,oComp) {
ok2Continue = true;
if (!ProcessIt) return null;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+ var UserAns=(bSubstVars)?arguments[7]:event.value;
UserAns = stripWhiteSpace(UserAns);
CorrAns = stripWhiteSpace(CorrAns);
if (!ok2Continue) return null;
@@ -748,7 +769,7 @@ indepVar,oComp) {
UserAns = UserAns.replace(/,+/g, ",");
UserAns = UserAns.replace(/,$/, "");
UserAns = UserAns.replace(/^,/, "");
- event.value = UserAns;
+% event.value = UserAns; % dps17
CorrAns = stripWhiteSpace(CorrAns);
if (!ok2Continue) return null;
var aUserAns = UserAns.split(",");
@@ -758,7 +779,7 @@ indepVar,oComp) {
return notifyField(false, flag, fieldname);
for ( var i=0; i< aCorrAns.length; i++) {
var retn =_ProcResp(flag,aCorrAns[i],aUserAns[i],%
-n,epsilon,domain,indepVar,oComp);
+n,epsilon,domain,indepVars,oComp);
if ( retn == -1 ) return null;
if ( retn == null ) return syntaxError(), null;
numCorrect += (retn) ? 1 : 0;
@@ -785,11 +806,16 @@ n,epsilon,domain,indepVar,oComp);
%\end{flushleft}
% \begin{macrocode}
function ProcRespSetFormula(flag,CorrAns,n,epsilon,%
-domain,indepVar,oComp) {
+domain,indepVars,oComp) {
ok2Continue = true;
if (!ProcessIt) return null;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+ var UserAns=(bSubstVars)?arguments[7]:event.value;
UserAns = stripWhiteSpace(UserAns);
CorrAns = stripWhiteSpace(CorrAns);
if (!ok2Continue) return null;
@@ -811,7 +837,7 @@ domain,indepVar,oComp) {
UserAns = UserAns.replace(/,+/g, ",");
UserAns = UserAns.replace(/,$/, "");
UserAns = UserAns.replace(/^,/, "");
- event.value = UserAns;
+% event.value = UserAns; % dps17
CorrAns = stripWhiteSpace(CorrAns);
if (!ok2Continue) return null;
var aUserAns = UserAns.split(",");
@@ -823,7 +849,7 @@ domain,indepVar,oComp) {
match = 0;
for ( var j=i; j< aUserAns.length; j++) {
var retn = _ProcResp(%
-flag,aCorrAns[i],aUserAns[j],n,epsilon,domain,indepVar,oComp);
+flag,aCorrAns[i],aUserAns[j],n,epsilon,domain,indepVars,oComp);
if ( retn == -1 ) return null;
if ( retn == null ) return syntaxError(), null;
if (retn==1) {
@@ -883,17 +909,22 @@ flag,aCorrAns[i],aUserAns[j],n,epsilon,domain,indepVar,oComp);
function cis(x,i) { return Math.cos(x) + i*Math.sin(x); }
JSfCustom.push("cis");
JSf = JSf.concat(JSfBuiltIn, JSfCustom);
-function ProcRespComplex(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
+function ProcRespComplex(flag,CorrAns,n,epsilon,domain,indepVars,oComp)
{
if (!ProcessIt) return null;
ok2Continue = true;
var i, success;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+ var UserAns=(bSubstVars)?arguments[7]:event.value;
CorrAns = stripWhiteSpace (CorrAns);
UserAns = stripWhiteSpace (UserAns); // sets ok2Continue
if ( !ok2Continue ) return null;
- indepVar+="i";
+ indepVars+="i";
domain+="x[0,1]";
% \end{macrocode}
% We don't support powers of i
@@ -957,10 +988,10 @@ function ProcRespComplex(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
% \begin{macrocode}
UserAns = ParseInput(UserAns);
CorrAns = ParseInput(CorrAns);
- indepVar = TypeParameters(indepVar);
+ indepVars = TypeParameters(indepVars);
if (!ok2Continue) return null;
success=randomPointCompare(
- n,domain,indepVar,epsilon,CorrAns,UserAns,comp);
+ n,domain,indepVars,epsilon,CorrAns,UserAns,comp);
if ( success == null ) { eqAppAlert(%
\eqSyntaxErrorUndefVar,3); return null; }
return notifyField(success, flag, fieldname);
@@ -975,11 +1006,16 @@ function ProcRespComplex(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
%\end{verbatim}
% \begin{macrocode}
function ProcRespListComplex(flag,CorrAns,n,epsilon,%
-domain,indepVar,oComp) {
+domain,indepVars,oComp) {
ok2Continue = true;
if (!ProcessIt) return null;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+ var UserAns=(bSubstVars)?arguments[7]:event.value;
UserAns = stripWhiteSpace(UserAns);
CorrAns = stripWhiteSpace(CorrAns); // sets ok2Continue
if ( !ok2Continue ) return null;
@@ -999,7 +1035,7 @@ domain,indepVar,oComp) {
UserAns = UserAns.replace(/,+/g, ",");
UserAns = UserAns.replace(/,$/, "");
UserAns = UserAns.replace(/^,/, "");
- event.value = UserAns;
+% event.value = UserAns; % dps17
var aUserAns = UserAns.split(",");
var aCorrAns = CorrAns.split(",");
if ( aUserAns.length != aCorrAns.length )
@@ -1008,10 +1044,10 @@ domain,indepVar,oComp) {
var match = 0;
for ( var i=0; i< aCorrAns.length; i++) {
match = 0;
- event.value = aUserAns[i];
- var retn = ProcRespComplex(
- flag,aCorrAns[i],n,epsilon,domain,indepVar,oComp);
- event.value = UserAns;
+% event.value = aUserAns[i]; % dps17
+ var retn = ProcRespComplex(%
+flag,aCorrAns[i],n,epsilon,domain,indepVars,oComp,aUserAns[i]);
+% event.value = UserAns; dps17
if ( retn == null ) return null;
numCorrect += (retn) ? 1 : 0;
}
@@ -1028,11 +1064,16 @@ domain,indepVar,oComp) {
%\end{verbatim}
% \begin{macrocode}
function ProcRespSetComplex(flag,CorrAns,n,epsilon,%
-domain,indepVar,oComp) {
+domain,indepVars,oComp) {
ok2Continue = true;
if (!ProcessIt) return null;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+ var UserAns=(bSubstVars)?arguments[7]:event.value;
UserAns = stripWhiteSpace(UserAns);
CorrAns = stripWhiteSpace(CorrAns); // sets ok2Continue
if ( !ok2Continue ) return null;
@@ -1064,10 +1105,10 @@ domain,indepVar,oComp) {
for ( var i=0; i< aCorrAns.length; i++) {
match = 0;
for ( var j=i; j< aUserAns.length; j++) {
- event.value = aUserAns[j];
+% event.value = aUserAns[j]; dps17
var retn = ProcRespComplex(%
-flag,aCorrAns[i],n,epsilon,domain,indepVar,oComp);
- event.value = UserAns;
+flag,aCorrAns[i],n,epsilon,domain,indepVars,oComp,aUserAns[j]);
+% event.value = UserAns; dps17
if ( retn == null ) return null;
if (retn==1) {
var temp=aUserAns[j];
@@ -1144,8 +1185,14 @@ function changeArgs4Cis(str) {
% a problem posed by David Arnold.}
% \begin{macrocode}
var bNotifyWrngNumEntries=\satisfyEqNotify;
-function ProcRespEvalEq(flag,CorrAns,n,epsilon,domain,indepVar,oComp){
- var retn=_ProcRespEvalEq(true,flag,CorrAns,n,epsilon,indepVar);
+function ProcRespEvalEq(flag,CorrAns,n,epsilon,domain,indepVars,oComp){
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% dps17
+ var UserAns=(arguments.length>7)?arguments[7]:event.value;
+ var retn=_ProcRespEvalEq(true,flag,CorrAns,n,epsilon,%
+indepVars,UserAns);
return retn;
}
% \end{macrocode}
@@ -1153,18 +1200,29 @@ function ProcRespEvalEq(flag,CorrAns,n,epsilon,domain,indepVar,oComp){
% all entries to be nonzero.
% \begin{macrocode}
function ProcRespEvalEqNonZero(flag,CorrAns,n,epsilon,%
-domain,indepVar,oComp) {
- var retn=_ProcRespEvalEq(false,flag,CorrAns,n,epsilon,indepVar);
+domain,indepVars,oComp) {
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% dps17
+ var UserAns=(arguments.length>7)?arguments[7]:event.value;
+ var retn=_ProcRespEvalEq(false,flag,CorrAns,n,epsilon,
+indepVars,UserAns);
return retn;
}
% \end{macrocode}
% \begin{macrocode}
-function _ProcRespEvalEq(allowzero,flag,CorrAns,n,epsilon,indepVar)
+function _ProcRespEvalEq(allowzero,flag,CorrAns,n,epsilon,indepVars)
{
ok2Continue = true;
if (!ProcessIt) return null;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>6); // dps17
+ var UserAns=(bSubstVars)?arguments[6]:event.value;
UserAns = stripWhiteSpace(UserAns);
if (!ok2Continue) return null;
if ( (UserAns.charAt(0) != "\(") || %
@@ -1182,7 +1240,7 @@ function _ProcRespEvalEq(allowzero,flag,CorrAns,n,epsilon,indepVar)
return eqAppAlert(\eqNonzeroEntries,3), null;
} catch(e) { return syntaxError(), null; }
}
- var _v = TypeParameters(indepVar);
+ var _v = TypeParameters(indepVars);
var _V = _v.split(","); // e.g. _V[0] = "i:x"
var _n = _V.length;
if ( aUserAns.length != _n) {
@@ -1211,21 +1269,38 @@ function _ProcRespEvalEq(allowzero,flag,CorrAns,n,epsilon,indepVar)
% The \texttt{CorrAns} parameter is of the form \texttt{n\_pairs; F-G}
% \begin{macrocode}
function ProcRespEvalEqList(flag,CorrAns,n,epsilon,domain,%
-indepVar,oComp) {
- var retn=_ProcRespEvalEqList(true,flag,CorrAns,n,epsilon,indepVar);
+indepVars,oComp) {
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% dps17
+ var UserAns=(arguments.length>7)?arguments[7]:event.value;
+ var retn=_ProcRespEvalEqList(true,flag,CorrAns,n,epsilon,%
+indepVars,UserAns);
return retn;
}
function ProcRespEvalEqListNonZero(flag,CorrAns,n,epsilon,domain,%
-indepVar,oComp){
- var retn=_ProcRespEvalEqList(false,flag,CorrAns,n,epsilon,indepVar);
+indepVars,oComp){
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% dps17
+ var UserAns=(arguments.length>7)?arguments[7]:event.value;
+ var retn=_ProcRespEvalEqList(false,flag,CorrAns,n,epsilon,%
+indepVars,UserAns);
return retn;
}
-function _ProcRespEvalEqList(allowzero,flag,CorrAns,n,epsilon,indepVar)
+function _ProcRespEvalEqList(allowzero,flag,CorrAns,n,epsilon,indepVars)
{
ok2Continue = true;
if (!ProcessIt) return null;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>6); // dps17
+ var UserAns=(bSubstVars)?arguments[6]:event.value;
UserAns = stripWhiteSpace(UserAns);
if (!ok2Continue) return null;
var success;
@@ -1255,7 +1330,7 @@ function _ProcRespEvalEqList(allowzero,flag,CorrAns,n,epsilon,indepVar)
% \begin{macrocode}
if (l > aUserAns.length )
return eqAppAlert(\eqTooFewEntries,3), null;
- var _v = TypeParameters(indepVar);
+ var _v = TypeParameters(indepVars);
var _V = _v.split(","); // e.g. _V[0] = "i:x"
% \end{macrocode}
% \texttt{\_n} is the number of variables
@@ -1389,23 +1464,28 @@ return syntaxError(), null;
% this is named \texttt{ProcRespNumsDe}.
% \begin{macrocode}
function ProcRespNumsDe (flag,CorrAns,n,epsilon,%
-domain,indepVar,oComp) {
+domain,indepVars,oComp) {
if (!ProcessIt) return null;
ok2Continue = true;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+ var UserAns=(bSubstVars)?arguments[7]:event.value;
% \end{macrocode}
% This is the only change over the \texttt{ProcResp}, we call
% \texttt{\_ProcRespNumsDe}.
% \begin{macrocode}
var success = _ProcRespNumsDe(flag,CorrAns,UserAns,n,%
-epsilon,domain,indepVar,oComp);
+epsilon,domain,indepVars,oComp);
if ( success == -1 || !ok2Continue ) return null;
if ( success == null ) { return syntaxError(), null; }
return notifyField(success, flag, fieldname);
}
function _ProcRespNumsDe(flag,CorrAns,UserAns,n,epsilon,%
-domain,indepVar,oComp) {
+domain,indepVars,oComp) {
ok2Continue = true;
CorrAns = ParseInput(CorrAns);
if (!ok2Continue) {
@@ -1447,9 +1527,9 @@ domain,indepVar,oComp) {
return -1;
}
UserAns = ParseInput(UserAns);
- indepVar = TypeParameters(indepVar);
+ indepVars = TypeParameters(indepVars);
if (!ok2Continue) return null;
- var success=randomPointCompare(n,domain,indepVar,%
+ var success=randomPointCompare(n,domain,indepVars,%
epsilon,CorrAns,UserAns,comp);
if ( success && (typeof(oComp)=="object") %
&& (typeof(oComp.postParse)!="undefined") )
@@ -1514,16 +1594,21 @@ epsilon,CorrAns,UserAns,comp);
% parsing and error feedback.}
% \begin{macrocode}
\begin{newsegment}{dljslib: Contrib - Processing Factors as Responses}
-function ProcRespFactors(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
+function ProcRespFactors(flag,CorrAns,n,epsilon,domain,indepVars,oComp)
{
ok2Continue = true;
if (!ProcessIt) return null;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+ var UserAns=(bSubstVars)?arguments[7]:event.value;
UserAns = stripWhiteSpace(UserAns);
if (!ok2Continue) return null;
var retn = _ProcResp(flag,CorrAns,UserAns,n,epsilon,%
-domain,indepVar,oComp);
+domain,indepVars,oComp);
if ( retn == -1 ) return null;
if ( retn == null ) return syntaxError(), null;
if ( retn == 0 ) {
@@ -1555,7 +1640,7 @@ the proper form");
match = 0;
for ( var j=i; j< aUserAns.length; j++) {
var retn = _ProcResp(flag,aCorrAns[i],aUserAns[j],%
-n,epsilon,domain,indepVar,oComp);
+n,epsilon,domain,indepVars,oComp);
if ( retn == -1 ) return null;
if ( retn == null ) return syntaxError(), null;
if (retn==1) {
@@ -1566,7 +1651,7 @@ n,epsilon,domain,indepVar,oComp);
}
else {
var retn = _ProcResp(flag,aNegCorrAns[i],aUserAns[j],%
-n,epsilon,domain,indepVar,oComp);
+n,epsilon,domain,indepVars,oComp);
if ( retn == -1 ) return null;
if ( retn == null ) return syntaxError(), null;
if (retn==1) {
@@ -1729,14 +1814,19 @@ function getFactorArray(str) {
%\end{flushleft}
% \begin{macrocode}
\begin{newsegment}{dljslib: Contrib - Processing a Point Response}
-function ProcPoint(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
+function ProcPoint(flag,CorrAns,n,epsilon,domain,indepVars,oComp)
{
if (!ProcessIt) return null;
ok2Continue = true;
var i, success, truthCnt=1;
var aScalar, scalar = 1;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+ var UserAns=(bSubstVars)?arguments[7]:event.value;
UserAns = stripWhiteSpace (UserAns); // sets ok2Continue
CorrAns = stripWhiteSpace(CorrAns);
if ( !ok2Continue ) return null;
@@ -1801,7 +1891,7 @@ function ProcPoint(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
eqAppAlert(\pointErrorMsgiii,3);
return null;
}
- indepVar = TypeParameters(indepVar);
+ indepVars = TypeParameters(indepVars);
for (i=0; i<aCorrAns.length; i++) {
aCorrAns[i] = ParseInput(aCorrAns[i]);
if (!ok2Continue) {
@@ -1815,7 +1905,7 @@ function ProcPoint(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
}
if (!ok2Continue) return null;
success=randomPointCompare (
- n,domain,indepVar,epsilon,aCorrAns[i],aUserAns[i],comp)
+ n,domain,indepVars,epsilon,aCorrAns[i],aUserAns[i],comp)
if ( success == null ) {
eqAppAlert(\eqSyntaxErrorUndefVar,3); return null; }
truthCnt *= (success) ? 1 : 0;
@@ -1857,7 +1947,7 @@ function ProcPoint(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
% Usage:
%\begin{verbatim}
%\def\intervalbox#1{\RespBoxMath{#1}(infU){10}
-% {1.0E-4}{[0,1]x[0,1]x[0,1]x[0,1]}*{ProcRespIntervals}}
+% {1.0E-4}{\viidna}*{ProcRespIntervals}}
%Some question requiring an interval or union of intervals
%\intervalbox{(-inf,4]U[5,inf)}
%\end{verbatim}
@@ -1871,18 +1961,23 @@ function ProcPoint(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
%\end{flushleft}
% \begin{macrocode}
\begin{newsegment}{dljslib: Contrib - Processing Interval Responses}
-function ProcRespIntervals(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
+function ProcRespIntervals(flag,CorrAns,n,epsilon,domain,indepVars,oComp)
{
ok2Continue = true;
if (!ProcessIt) return null;
var fieldname = event.target.name;
- var UserAns = event.value;
+% \end{macrocode}
+% Modified for multi-letter variables: remove one line, insert two. (2017/08/09)
+% \begin{macrocode}
+% var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+ var UserAns=(bSubstVars)?arguments[7]:event.value;
UserAns = stripWhiteSpace(UserAns);
CorrAns = stripWhiteSpace(CorrAns);
if (!ok2Continue) return null;
UserAns = UserAns.replace(/inf/g, "x");
CorrAns = CorrAns.replace(/inf/g, "x");
- indepVar = "x";
+ indepVars = "x";
domain="[0,1]";
var aUserAns = UserAns.split("U");
var aCorrAns = CorrAns.split("U");
@@ -1912,12 +2007,12 @@ function ProcRespIntervals(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
if (aCorrInt[0] == aUserInt[0]) matchparts+=1;
if (aCorrInt[3] == aUserInt[3]) matchparts+=1;
var retn1 = _ProcResp(flag,aCorrInt[1],aUserInt[1],%
-n,epsilon,domain,indepVar,oComp);
+n,epsilon,domain,indepVars,oComp);
if (retn1 == -1 ) return null;
if (retn1 == null) return syntaxError(), null;
if (retn1 == 1) matchparts+=1;
var retn2 = _ProcResp(flag,aCorrInt[2],aUserInt[2],%
-n,epsilon,domain,indepVar,oComp);
+n,epsilon,domain,indepVars,oComp);
if (retn2 == -1 ) return null;
if (retn2 == null) return syntaxError(), null;
if (retn2 == 1) matchparts+=1;
diff --git a/texmf-dist/source/latex/acrotex/doc/aeb_man.tex b/texmf-dist/source/latex/acrotex/doc/aeb_man.tex
index 55eef8df..d379907c 100644
--- a/texmf-dist/source/latex/acrotex/doc/aeb_man.tex
+++ b/texmf-dist/source/latex/acrotex/doc/aeb_man.tex
@@ -14,10 +14,17 @@
\usepackage{longtable,colortbl}
\usepackage{graphicx}
\usepackage{multicol}
+\usepackage{collectbox}
+
+\newbox\aebbox
\usepackage{acroman}
\usepackage[active]{srcltx}
+\setcounter{secnumdepth}{4}
+\setcounter{tocdepth}{4}
+
+
\def\AcroBlog{{Acro\!\TeX} Blog}
\makeatletter
@@ -219,10 +226,10 @@
\university{{\AcroT} Software Development Team}
\email{dpstory@acrotex.net}
\versionLabel{Dated:}
-\version{2017/03/16}
+\version{2018/03/01}
\copyrightyears{1999-\the\year}
\nocopyright
-\prepared{2017/03/20}
+\prepared{2018/03/22}
\revisionLabel{Distribution Dated:}
\copyrightStatus{True}
@@ -305,7 +312,7 @@ function indefCompare(a,b,c,F,G) {
\part{Forward}
-\newtopic For the past several years (this year is 2016), I've been writing a book
+\newtopic For the past several years (this year is \the\year), I've been writing a book
titled,
\begin{quote}
\AEBBook.
@@ -323,10 +330,10 @@ the features by studying the DTX documentation of the program files. Sorry,
it took me three years to write the book, I don't want to spend another year
on this documentation. \verb!:-{)!
-As noted in the part of this manual titled \textbf{\nhnameref{eq2db}} on
-page~\pageref{eq2db}, I've set up two websites that highlight the server-side
-scripts developed for the book (and available on the accompanying CD-ROM).
-You are invited to visit them and comment on them, if the spirit moves.
+As noted in \textbf{\nhnameref{eq2db}} on page~\pageref{eq2db}, I've set up a
+website that highlights the server-side scripts developed for the book (and
+available on the accompanying CD-ROM). You are invited to visit them and
+comment on them, if the spirit moves.
\begin{flushright}
Dr. D. P. Story\\[3pt]
@@ -4690,6 +4697,16 @@ exercise. You'll note that I have moved the solutions in this
file \emph{before} the \nameref{references} section, as indicated, for
example, by its position in the table of contents.
+\subsubsection{Grouping the solutions at end}\label{ss:grpEx}
+
+Historically, solutions to exercises appearing at the end of the file
+\emph{are not grouped}. This means that a color change or a definition made
+in one solution, for example, may affect all subsequent solutions.
+
+You can now declare \cs{makeExSolnsLocalOn} or \cs{makeExSolnsLocalOff}
+anywhere in the document to turn on grouping for all exercises that follow,
+or to turn off this feature again. The default is \cs{makeExSolnsLocalOff}.
+
\subsection{Redesigning the
\texorpdfstring{\protect\texttt{exercise}}{exercise}
@@ -5668,6 +5685,17 @@ have moved the solutions in this file before the
\nameref{references} section, as indicated, for example, by its
position in the table of contents.
+\subsubsection{Grouping the solutions at end}\label{ss:grpQzs}
+
+Historically, solutions to quizzes (created by the \env{shortquiz} and
+\env{quiz} environments) appearing at the end of the file \emph{are not
+grouped}. This means that a color change or a definition made in one solution
+may affect all subsequent solutions.
+
+You can now declare \cs{makeQzSolnsLocalOn} or \cs{makeQzSolnsLocalOff}
+anywhere in the document to turn on grouping for all quizzes that follow, or
+to turn off this feature again. The default is \cs{makeQzSolnsLocalOff}.
+
\subsection{Redesigning the
\texorpdfstring{\protect\texttt{shortquiz}}{shortquiz}
Environment}\label{sss:redefinesq}
@@ -7630,8 +7658,9 @@ The code for the above example is
\noindent The \cs{RespBoxMath} need not appear in math mode. The definition
of the \cs{redpoint} command, a command written for this document follows.
\begin{Verbatim}[xleftmargin=\amtIndent]
-\newcommand\redpoint{\par\removelastskip\vskip\medskipamount\noindent
- \makebox[\parindent][l]{\large\color{red}$\blacktriangleright$}}
+\newcommand\redpoint{\par\removelastskip\vskip\medskipamount
+ \noindent\makebox[\parindent][l]{\large
+ \color{red}$\blacktriangleright$}}
\end{Verbatim}
\newtopic You can also pose multivariate questions as well, for example
@@ -7693,14 +7722,60 @@ of the section below and see the demo file \texttt{integer\_test.tex} to
demonstrate the new method for specifying variables, found in the
\texttt{dljslib\_examples} folder.
-%\item[\ttfamily\#3 :] An optional parameter, \textit{delimited by parentheses},
-%that defines the independent variable; \texttt{x}, is the default value. Note
-%that this parameter is set of by parentheses.
+\textbf{Multi-letter variables.} Beginning with v8.0 (2017/08/08) support for
+multi-letter variables and appearance replacement is added. Within the
+\texttt{\#3}, use the following notation:
+\begin{Verbatim}[xleftmargin=\amtIndent]
+(x\rpl{alpha}{y}z)
+\end{Verbatim}
+This declares three variables, \texttt{x}, \texttt{alpha}, and \texttt{z}.
+What in fact is taking place is that \texttt{alpha} is replaced by \texttt{y}
+and processing continues from there.
+
+\textbf{Alternate appearances.} Additionally, there is now a scheme for
+replacing the variables with alternate appearances.
+\begin{Verbatim}[xleftmargin=\amtIndent]
+(x\rpl{alpha->\\u03B1}{y}z)
+\end{Verbatim}
+The arrow notation (\texttt{->}) tells \pkg{exerquiz} to replace
+\texttt{alpha} with the unicode character \verb~\u03B1~ (note the double
+backslash above), which is the Greek letter alpha ($\alpha$). You can
+separate the variables with commas and use the type specification as well.
+But as noted above, use either the old style (no commas) or the new style
+(with commas), \emph{never mix the two together in one argument.}
+
+Below is a simple example of multi-letter variables with appearance replacement. Enter
+\texttt{alpha} for $\alpha$ and \texttt{theta} for $\theta$.
+\begin{oQuestion}{oQ2}
+\begin{equation*}
+ \dfrac{\partial}{\partial\theta}\alpha \sin(\theta)=
+ \RespBoxMath[\rectW{1.5in}]{alpha cos(theta)}(\rpl{alpha->\\u03B1}{x}\rpl{theta->\\u03B8}{y})
+ {3}{0.0001}{[0,3.14]x[0,3.14]}
+\end{equation*}
+\end{oQuestion}
+The verbatim listing for this question follows:
+\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
+\begin{oQuestion}{oQ2}
+\begin{equation*}
+ \dfrac{\partial}{\partial\theta}\alpha \sin(\theta)=
+ \RespBoxMath[\rectW{1.5in}]
+ {alpha cos(theta)}
+ (\rpl{alpha->\\u03B1}{x}\rpl{theta->\\u03B8}{y})
+ {3}{0.0001}{[0,3.14]*2}
+\end{equation*}
+\end{oQuestion}
+\end{Verbatim}
+
+\exAeBBlogPDF{p=1330} See the file
+\texttt{\href{\urlAcroTeXBlog/?p=1330}{ml-vars.pdf}} for a demonstration of
+multi-letter variables and alternate appearances.
+
\item[\ttfamily\#4 :] Optional, a named destination to the solution to the
-question. There are two forms: the \texttt{[mydest]} an explicit destination for the solution to the problem, or
-a `\texttt*', in which case, the name is
-\texttt{[\string\curr@quiz.\string\thequestionno]} is automatically assigned.
+ question. There are two forms: the \texttt{[mydest]} an explicit
+ destination for the solution to the problem, or a `\texttt*', in which
+ case, the name is \texttt{[\string\curr@quiz.\string\thequestionno]} is
+ automatically assigned.
If this parameter appears, a solution must follow the
question, enclosed in a \texttt{solution} environment.
@@ -7708,20 +7783,46 @@ question, enclosed in a \texttt{solution} environment.
\item[\ttfamily\#5 :] The number of samples points to be used, usually 3 or 4 is
sufficient.
-\item[\ttfamily\#6 :] Precision required, a \emph{non-negative} ``$\epsilon$'' value, if you will. If the precision
-is set to zero, \texttt{reldiffCompare} is used as the default compare, and the precision
-is set to a small positive value, \text{1E-14}, by default. The small value is may reset with
-\cs{defaultRDPrecision}. The default definition, \verb!\defaultRDPrecision{1E-14}!.
-
-\item[\ttfamily\#7 :] Parameters \#7 and \#8 are used to define the interval from
-which to draw the sample points. There are two forms: (1) \#7 is the left-hand endpoint
-of the interval and \#8 is the right-hand endpoint (the use of \#7 and \#8 in this form
-is deprecated); (2) the interval is defined by standard interval notation, \texttt{[a,b]}.
-For a multivariate question---one where parameter \#2 lists more than one variable,
-separate the intervals for each variable by a `\texttt{x}', \texttt{[0,2]x[1,2]x[3,4]}.
-\item[\ttfamily\#8 :] (1) \#8 is the right-hand endpoint of the interval (the use of this
-parameter is deprecated); (2) in the second
-case, \#8 is not used.
+\item[\ttfamily\#6 :] Precision required, a \emph{non-negative}
+ ``$\epsilon$'' value, if you will. If the precision is set to zero,
+ \texttt{reldiffCompare} is used as the default compare, and the precision
+ is set to a small positive value, \text{1E-14}, by default. The small
+ value is may reset with \cs{defaultRDPrecision}. The default definition,
+ \verb!\defaultRDPrecision{1E-14}!.
+
+\item[\ttfamily\#7 :] Parameters \#7 and \#8 are used to define the interval
+ from which to draw the sample points. There are two forms: (1) \#7 is the
+ left-hand endpoint of the interval and \#8 is the right-hand endpoint
+ (the use of \#7 and \#8 in this form is deprecated); (2) the interval is
+ defined by standard interval notation, \texttt{[a,b]}. For a multivariate
+ question---one where parameter \#2 lists more than one variable---separate
+ the intervals for each variable by a `\texttt{x}',
+ \texttt{[0,2]x[1,2]x[3,4]}.
+
+
+\textbf{Interval repetition.} Beginning with v8.0 (2017/08/08),
+\pkg{exerquiz} allows \emph{interval repetition}. It is not unusual that the
+cartesian product of the same interval is needed, eg,
+\texttt{[0,1]x[0,1]x[0,1]}; rather than typing those repetitive interval
+specifications, you can simple use the notation \texttt{[0,1]*3}. The general
+syntax for an interval is now \texttt{\ameta{interval}*\ameta{num}}; the
+`\texttt{*\ameta{num}}' portion is optional, \ameta{num} is an positive
+integer. Note that `\texttt{*\ameta{num}}' follows the interval
+specification, this is \emph{vitally important} for the correct parsing of
+the expression.
+
+The notation may be mixed in with additional interval
+ specifications; thus, for example, `\texttt{[0,1]*3x[1,2]x[2,3]*2}' expands to
+ `\texttt{[0,1]x[0,1]x[0,1]x[1,2]\penalty0x\penalty0[2,3]x[2,3]}'.
+
+\exAeBBlogPDF{p=1330} See the file
+\texttt{\href{\urlAcroTeXBlog/?p=1330}{ml-vars.pdf}} for a demonstration of
+interval repetition.
+
+
+\item[\ttfamily\#8 :] (1) \#8 is the right-hand endpoint of the interval (the
+ use of this parameter is deprecated); (2) in the second case, \#8 is not
+ used.
\item[\ttfamily\#9 :]\label{paraRespBoxNine} This optional parameter is the name of a customized
comparison function.
@@ -8580,7 +8681,7 @@ code of this example, as well as more technical details of the
All form elements have a first optional parameter for modifying their appearance,
and they have an associated ``every'' command for global modifications as well.
-\begingroup
+\begin{center}
\setlength{\extrarowheight}{1mm}
\setlength{\tabcolsep}{2mm}
\begin{longtable}{|>{\ttfamily}l|>{\PBS\raggedright}p{.5\linewidth}|}
@@ -8615,9 +8716,8 @@ and they have an associated ``every'' command for global modifications as well.
\cs{RespBoxTxt}&\cs{everyRespBoxTxt}\\
\cs{CorrAnsButton}&\cs{everyCorrAnsButton}
\end{longtable}
-\par\endgroup
+\end{center}
-\bigskip
\handpoint In additional to these, there are other ``every'' commands that effect
the appearance of the various buttons and text fields. The two commands
\cs{everyCorrButtonField} and \cs{every\-eqText\-Field} are executed before every
@@ -8631,6 +8731,169 @@ in appearance.
modify a field using the optional first argument, and how to use the
``every'' mechanism.
+\subsection{Inserting additional action and format scripts}\label{ss:AddActScripts}
+
+Global changes in \emph{appearance}, as just discussed, is accomplished using
+any of the \cs{every\ameta{cmdname}} family of commands; however, that device
+cannot, by design, change any of the actions \pkg{exerquiz} has defined.
+S everal key-value pairs are used to insert JavaScript code into response
+boxes, multiple choice, and multiple selection fields.
+\settowidth{\aebdimen}{\cs{addToAction*\darg{\ameta{key}}\darg{\ameta{code}}}}%
+\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
+\AddAAFormat{!ameta(code)}
+\AddAAKeystroke{!ameta(code)}
+\AddAAMouseUpMC{!ameta(code)}
+\AddAAMouseUpMS{!ameta(code)}
+\setActionKeys{!ameta(KV-pairs)}
+\addToAction*{!ameta(key)}{!ameta(code)}
+\end{dCmd}
+\newtopic
+The command \cs{setActionKeys} is a special command used to process the
+KV-pairs of the \pkg{eforms} package. It only accepts these four keys:
+\cs{AddAAFormat}, \cs{AddAAKeystroke}, \cs{AddAAMouseUpMC}, and
+\cs{AddAAMouseUpMC}.
+
+
+\begin{description}
+ \item[\cs{AddAAFormat\darg{\ameta{code}}}] This is an \pkg{eforms} KV,
+ discussed an some detail on page~\pageref{para:ProcRespSetNum} that can be
+ specified in the optional argument of any response boxes to affect the
+ field locally, or globally through the \cs{setActionKeys} command.
+ \item[\cs{AddAAKeystroke\darg{\ameta{code}}}] Text fields have a keystroke
+ event (or trigger) that executes JavaScript each time a keystroke is
+ made into the field. The \pkg{exerquiz} key \cs{AddAAKeystroke} adds
+ its argument (\ameta{code}) to the keystroke event of all response boxes
+ (\cs{RespBoxMath}, \cs{RespBoxTxt}, and \cs{RespBoxTxtPC}).
+
+ To distinguish between \env{shortquiz} (and \env{oQuestions}) and
+ \env{quiz} environments, use the methods explained below in the
+ description of the \cs{AddAAMouseUpMC} key.
+
+ Should you want code that is specialized to these individual types, you can use
+ some internal macros to distinguish these three cases.
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!(),fontsize=\small]
+\setActionKeys{\AddAAKeystroke{%
+ \ifx\annot@subtype\annot@subtype@rbm!ameta(rbm-code)\else
+ \ifx\annot@subtype\annot@subtype@rbt!ameta(rbt-code)\else
+ \ifx\annot@subtype\annot@subtype@rbtpc!ameta(rbtpc-code)\fi
+ \fi\fi}}
+\end{Verbatim}
+ Within the argument of \cs{setActionKeys} the character `\texttt{@}' is an ordinary letter,
+ so it can be used freely.
+
+ Within this keystroke event, script executed prior this additional
+ \ameta{code} defines a JavaScript variable \texttt{retn}, which has a value
+ of \texttt{true} (if the response is judged correct), \texttt{false} (if
+ the response is judged incorrect), or \texttt{null} (if there is a syntax
+ error). The \ameta{code} may use this variable.
+
+ \item[\cs{AddAAMouseUpMC\darg{\ameta{code}}}] This key adds its
+ \ameta{code} to the mouse up event of items (\cs{Ans}) of a multiple
+ choice (MC) question. Both \env{shortquiz} and \env{quiz} environments
+ are affected.
+
+ You can distinguish between the \env{shortquiz} and \env{quiz}
+ environments by comparing \cs{eqQuizType} with \cs{isSQZ} or \cs{isQZ}.
+ For example,
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+\setActionKeys{\AddAAMouseUpMC{%
+ \if\eqQuizType\isQZ!ameta(qz-code)\else!ameta(sqz-code)\fi}}
+\end{Verbatim}
+
+ \item[\cs{AddAAMouseUpMS\darg{\ameta{code}}}] This key adds its
+ \ameta{code} to the mouse up event of items (\cs{Ans}) of a multiple
+ selection (MS) question. Both \env{shortquiz} and \env{quiz}
+ environments are affected. As with \cs{AddAAMouseUpMC}, distinguish
+ between the environments \env{shortquiz} and \env{quiz} by comparing
+ \cs{eqQuizType} with \cs{isSQZ} or \cs{isQZ}, as shown above.
+\end{description}
+ In the case of both \cs{AddAAMouseUpMC} and \cs{AddAAMouseUpMS}, you
+ can distinguish between a correct response and an incorrect response
+ using the command \cs{Ans@choice}, which expands to 1 when correct
+ alternative (radio button or check box) is pressed, and expands to 0
+ otherwise. For example,
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+\setActionKeys{\AddAAMouseUpMC{%
+ \if\Ans@choice1!ameta(true-code)\else!ameta(false-code)\fi}}
+\end{Verbatim}
+\cs{AddAAKeystroke}, \cs{AddAAMouseUpMC}, and \cs{AddAAMouseUpMC} don't work
+as local arguments of \cs{RespBoxMath}, \cs{RespBoxTxt}, and
+\cs{RespBoxTxtPC}; however, \cs{AddAAFormat} can be passed within the option
+list of these response box commands, the local option command over rights the
+global command.
+
+Remove any of the actions earlier declared by passing the empty argument,
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+\setActionKeys{\AddAAMouseUpMC{}}
+\end{Verbatim}
+Now, there is no added code to the mouse up action of the multiple choice
+fields that appear afterwards.
+
+The only command yet to be discussed is \cs{addToAction*}. Suppose we earlier
+declared,
+\begin{quote}\ttfamily
+\cs{setActionKeys\darg{\string\AddAAFormat}\darg{\ameta{code\SUB1}}}
+\end{quote}
+and later in the document we want to \emph{append}
+additional script (\ameta{code\SUB2}). To accomplish this, expand the command,
+\begin{quote}\ttfamily
+\cs{addToAction\darg{\string\AddAAFormat}\darg{\ameta{code\SUB2}}}
+\end{quote}
+Now the code executed for each response box
+is \ameta{code\SUB1}\ameta{code\SUB2}. However, if you wish to \emph{prepend} the \ameta{code\SUB2}, then
+expand \cs{addToAction} using the star-option,
+\begin{quote}\ttfamily
+\cs{addToAction*\darg{\string\AddAAFormat}\darg{\ameta{code\SUB2}}}
+\end{quote}
+The code executed for any response box is \ameta{code\SUB2}\ameta{code\SUB1}.
+
+It should ever be kept in mind that changing the value of a key with
+\cs{setActionKeys} is \cs{addToAction} affects all response boxes thereafter,
+\emph{unless these changes occur in a group}. Thus, the following change,
+\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
+\begin{oQuestion}{oQ1}
+\addToAction{\AddAAFormat}{\r!ameta(code)}%
+It is well known that
+ $ 1 + 16 = \RespBoxMath{17}{1}{.0001}{[0,1]}$
+\end{oQuestion}
+\end{Verbatim}
+only affects that problem, and none other.
+
+\newtopic
+\textbf{Important/A little beg.} Any changes to the action script passed to
+the component elements of the \env{oQuestion}, \env{shortquiz}, and
+\env{quiz} environments \emph{should not impact} the basic functionality of the
+environments.
+
+\subsection{The correct-type math problem}
+
+The traditional way of posing a mathematical objective-style question is to use
+the \cs{RespBoxMath} command, which presents an empty text field for the student to enter
+the answer. However, an alternate approach is to pre-populate the field and ask the student
+to edit the expression provided to obtain a correct answer.
+\collectboxto{\aebbox}{}\bgroup
+\begin{minipage}{\linewidth-\mathindent}
+\begin{Verbatim}[fontsize=\small,commandchars={!@$}]
+\RespBoxMath[!textbf@\DV{cos(4x)}\V{cos(4x)}$]
+ {4xcos(2x^2)}{2}{.001}{[0,1]}
+\end{Verbatim}
+\end{minipage}\egroup
+
+\medskip\noindent\begin{oQuestion}{}
+Edit the expression to obtain the correct answer:
+\begin{align*}
+ &\dfrac{d}{dx}\sin(2x^2)=\RespBoxMath[\DV{cos(4x)}\V{cos(4x)}]{4xcos(2x\string^2)}{2}{.001}{[0,1]}\\[3pt]
+ &\usebox{\aebbox}
+\end{align*}
+\end{oQuestion}
+The field is initially populated by an incorrect answer (a very common mistake), the student needs to
+correct the answer.
+
+\exAeBBlogPDF{p=1335} Refer to the {\AcroTeX} Blog article
+\href{\urlAcroTeXBlog/?p=1335}{Correcting a math problem} for additional
+examples. The article also discusses the use of multi-letter variables in
+this context of a correct-type question.
+
\subsection{Evaluating Equivalent Expressions}
The \hypertarget{EquivExpr}{\cs{RespBoxMath}} macro, and its underlying JavaScript code, is designed to
@@ -9828,21 +10091,34 @@ an ASP (Active Server Page) that I have written. This ASP, named naturally,
\texttt{eqRecord.asp}, takes the data and stores it to a database, such as
Microsoft Access.
-You can also submit your form data as HTML, as the the two websites
-demonstrate.\footnote{These websites were prepared as a script demonstration
-site that is referenced in my yet-to-be submitted book \AEBBook~\cite{book:AEBB}.}
-\begin{quote}
-\url{http://faculty.nwfsc.edu/web/math/storyd/dps/}
-\end{quote}
-The above Web page is on a \app{Windows} server hosted by Northwest Florida State
-College (NWFSC). The server-side
-script is written as ASP pages using VBScript.
+%You can also submit your form data as HTML, as the two websites
+%demonstrate.\footnote{These websites were prepared as a script demonstration
+%site that is referenced in my yet-to-be submitted book \AEBBook~\cite{book:AEBB}.}
+%\begin{quote}
+%\url{http://faculty.nwfsc.edu/web/math/storyd/dps/}
+%\end{quote}
+%The above web page is on a \app{Windows} server hosted by Northwest Florida State
+%College (NWFSC). The server-side
+%script is written as ASP pages using VBScript.
+
+There is a website that you can experience submitting form data from a
+PDF.\footnote{This website was prepared as a script demonstration site that
+is referenced in my yet-to-be submitted book \AEBBook~\cite{book:AEBB}.}
\begin{quote}
\url{http://www.acrotex.net/dps/}
\end{quote}
-This Web page is on a \app{Linux} server hosted by {\AcroTeX.Net}. The
+This web page is on a \app{Linux} server hosted by {\AcroTeX.Net}. The
server-side script is written with PHP.
+\redpoint In recent years, the browser technology has evolved in an unwelcome
+direction. Most web browsers do not support the Adobe Reader plug-in, hence,
+Reader no longer appears in the browser window, so essential for a good user
+experience. Most browsers use their own `native' PDF viewer, which does
+respond to links, but knows nothing about JavaScript. The only browser, as of
+this writing, that still supports the Adobe Reader plug-in (or ActiveX) is
+Microsoft Internet Explorer~11. For online, interactive work with PDF, the
+document consumer must use Microsoft Internet Explorer~11.
+
\redpoint For more details, see the package documentation,
\texttt{eq2dbman.pdf}.\footnote{The absolute URL is
\url{\bUrl/acrotex/eq2dbman.pdf}} The \textsf{eq2db} package is available
@@ -10156,7 +10432,7 @@ handle (math fill-in) questions whose answers are a \textit{set of
numbers (symbols)} or a comma delimited \emph{list of numbers
(symbols)}.
-\paragraph*{ProcRespSetNum:} The function can handle (math fill-in)
+\paragraph*{ProcRespSetNum:}\label{para:ProcRespSetNum} The function can handle (math fill-in)
questions whose answers are a \textit{set of numbers} or a
comma delimited \textit{list of numbers}.
@@ -10168,7 +10444,7 @@ JavaScript does after the comma-delimited list is entered and
committed.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
$(x+1)^2 (x+3) = 0$, $S = \RespBoxMath[\AddAAFormat{\formatAsSet}
- \rectW{.75in}\textSize{0}]{-1,-3}{1}{.0001}{[0,1]}*{ProcRespSetNum}$
+ \rectW{.75in}\textSize{0}]{-1,-3}{1}{.0001}{[0,1]}*{ProcRespSetNum}$
\end{Verbatim}
\noindent The formatting of answer is accomplished by passing
\verb!\AddAAFormat{\formatAsSet}! as an optional argument of
@@ -10197,7 +10473,7 @@ be the ``universal set'' of the problem.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\def\U{a,b,c,d,e,f,g} % define a universal set
$A \cap B = \RespBoxMath[\AddAAFormat{\formatAsSet}
- \rectW{.75in}\textSize{0}]{c,d}(\U){1}{.0001}{[0,1]}*{ProcRespSetSym}$
+ \rectW{.75in}\textSize{0}]{c,d}(\U){1}{.0001}{[0,1]}*{ProcRespSetSym}$
\end{Verbatim}
\paragraph*{ProcRespListFormula:} This function can handle a (math fill-in)
@@ -10323,7 +10599,7 @@ are recognized by this procedure.
\begin{Verbatim}[xleftmargin=\amtIndent]
\RespBoxMath{(-inf,4]U[5,inf)}{10}
- {.0001}{[0,1]x[0,1]x[0,1]x[0,1]}*{ProcRespIntervals}
+ {.0001}{\viidna}*{ProcRespIntervals}
\end{Verbatim}
\Important Problems with unbalanced parentheses while
authoring and building the PDF file. The code below
diff --git a/texmf-dist/source/latex/acrotex/doc/eformman.tex b/texmf-dist/source/latex/acrotex/doc/eformman.tex
index 51d9f00f..ccc6476c 100644
--- a/texmf-dist/source/latex/acrotex/doc/eformman.tex
+++ b/texmf-dist/source/latex/acrotex/doc/eformman.tex
@@ -6,7 +6,7 @@
forcolorpaper,latextoc,pro,useui},
exerquiz,aebxmp
]{aeb_pro}
-\usepackage{aeb_mlink}
+\usepackage[dblevel=1]{aeb_mlink}
\usepackage[altbullet]{lucidbry}
%\usepackage{myriadpro}
@@ -63,14 +63,17 @@
subject={Documentation for the eforms and insdljs packages},
talksite={\url{www.acrotex.net}},
version={2.0},
+ prepared={2018/03/22},
+ preparedLabel={Distribution Dated:},
keywords={LaTeX, hyperref, PDF, exercises, quizzes},
copyrightStatus=True,
copyrightNotice={Copyright (C) \the\year, D. P. Story},
copyrightInfoURL={http://www.acrotex.net}
}
-
+%\revisionLabel{Distribution Dated:}
\def\AEBBook{\textsl{{Acro\!\TeX} eDucation System Tools: {\LaTeX} for interactive PDF documents}}
+\setlength{\marginparwidth}{31.25pt}
\renewcommand\hproportionwebtitle{.75}
\universityLayout{fontsize=Large,fontfamily=sffamily}
@@ -167,6 +170,7 @@
\def\FitItIn{\eq@fititin}
\def\endredpoint{\FitItIn{{\large\ifusebw\color{black}\else\color{red}\fi$\blacktriangleleft$}}}
+\advance\marginparwidth16pt
\makeatother
@@ -201,7 +205,7 @@
\makeatletter
\let\web@copyright\@gobble
-\let\web@revision\@gobble
+%\let\web@revision\@gobble
\renewcommand\webdirectory
{%
\par\ifeqforpaper\else\minimumskip\fi\vspace{\stretch{1}}%
@@ -217,12 +221,21 @@
\end{itemize}
\end{flushleft}
}
-\renewcommand\titlepageTrailer
+%\renewcommand\titlepageTrailer
+%{%
+% \web@copyright\ \copyright\ \webcopyrightyears\ \webversion
+% \hfill\url{http://www.acrotex.net}\\
+% \web@revision\ \@date \hfill\href{mailto:\webemail}{\webemail}
+%}
+\DesignTitlePageTrailer
{%
- \web@copyright\ \copyright\ \webcopyrightyears\ \webversion
- \hfill\url{http://www.acrotex.net}\\
- \web@revision\ \@date \hfill\href{mailto:\webemail}{\webemail}
+ ul=Copyright \copyright\ \webcopyrightyears,
+ ur=\thewebemail,
+ lr=\url{http://www.acrotex.net},
+ ll={\web@revision\ \aeb@prepared},
+ raise=-25pt
}
+
\makeatother
\newcounter{exampleno}
@@ -237,6 +250,9 @@
\everyCheckBox{\BC{.690 .769 .871}\BG{.941 1 .941}\textColor{1 0 0}}
\everyRadioButton{\BC{.690 .769 .871}\BG{.941 1 .941}\textColor{0 0 1}\symbolchoice{star}}
+\reversemarginpar
+\mlMarksOff
+
\chngDocObjectTo{\newDO}{doc}
\begin{docassembly}
var titleOfManual="The AeB eforms MANUAL";
@@ -286,7 +302,7 @@ _path=_path.substring(0,pos)+"/"+manualfilename;
%\section{Introduction}
-In \hypertarget{eformsPkg}{this} document we describe the support for Acrobat form elements
+In \hypertarget{eformsPkg}{this} document we describe the support for \app{Acrobat} form elements
in an {\cAcroT} document. The \textit{PDF Reference} indicates there
are four different categories of fields for a total of seven types
of fields.
@@ -312,9 +328,9 @@ of fields.
\end{questions}
The {\cAcroB} now supports \textit{signature fields}. Using the
command \cs{sigField}, an unsigned signature field is created.
-The field can be signed, either by using Acrobat, or programmatically
+The field can be signed, either by using \app{Acrobat}, or programmatically
from a {\LaTeX} source, but you need to use \textsf{aeb\_pro} and to
-create the PDF using Acrobat Distiller.
+create the PDF using \app{Acrobat} Distiller.
The \textsf{hyperref} Package (Rahtz, Oberdiek \textit{et al})
provides support for the same set of form fields; however, not all
@@ -327,7 +343,7 @@ commands, in this way, there is a uniform treatment of all form
fields in the \cAcroB.
\redpoint The demo files for {\eForm} support are
-\texttt{eqform.tex}, for those using the \textsf{Acrobat
+\texttt{eqform.tex}, for those using the \textsf{\app{Acrobat}
Distiller} to create a PDF document, and \texttt{eqform\_pd.tex},
for those who use \textsf{pdftex} or \textsf{dvipdfm}.
@@ -337,7 +353,7 @@ resources are recommended:
\item \href{https://developer.mozilla.org/en/JavaScript}{Core JavaScript Reference} at
Mozilla Developer Center.
\item \href{http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp/wwhelp/wwhimpl/js/html/wwhelp.htm?&accessible=true}
- {\emph{JavaScript for Acrobat API Reference}} at the Acrobat Developer Center. In the navigation panel
+ {\emph{JavaScript for \app{Acrobat} API Reference}} at the \app{Acrobat} Developer Center. In the navigation panel
on the left, select JavaScript.
\item \href{\urlAcroTeXBlog/?cat=5}{PDF Blog},
by D. P. Story.
@@ -745,11 +761,11 @@ variables.
\redpoint \cs{Ff} \textbf{Field flags.} Values appropriate to a
list box are \Cs{FfCommitOnSelChange} (commits
immediately after selection, PDF 1.5); \Cs{FfSort} (sorts\footnote
-{This flag really is not useful unless you have the full Acrobat application, the
+{This flag really is not useful unless you have the full \app{Acrobat} application, the
\texttt{Sort} \texttt{items} check box is checked in the Options
tab of the Fields Properties dialog for the field.
Initially, the items are listed in the same order as listed in the
-\texttt{\#5} argument; the Acrobat application will sort the list
+\texttt{\#5} argument; the \app{Acrobat} application will sort the list
if you view the \textit{Fields Properties} for the field and click
\texttt{OK}. Be sure to save the changes.\label{FfSortfoot}}the
items); \Cs{FfMultiSelect} (allows more than one value to be
@@ -1022,7 +1038,7 @@ descriptions and notes on each of these variables.
\verb! {mySig}{2in}{4\baselineskip}!
\end{minipage}
-\newtopic To sign this field, use the Acrobat user interface, or use the
+\newtopic To sign this field, use the \app{Acrobat} user interface, or use the
package \textsf{aeb\_pro}, and the following \texttt{docassembly} code:
\begin{Verbatim}[xleftmargin=\amtIndent]
@@ -1059,13 +1075,13 @@ The \texttt{appearance} is important, through it, you can choose a particular ap
for the digital signature, including a custom signature that you've created. In the example
above, we have \texttt{appearance: "My Signature"}. \texttt{My Signature} is the name I've
given a particular digital ID of mine. If the \texttt{appearance} property is not
-included in \texttt{oInfo}, Acrobat will use the one named \texttt{"Standard Text"}.
+included in \texttt{oInfo}, \app{Acrobat} will use the one named \texttt{"Standard Text"}.
\end{itemize}
\Important Additional information on signatures can be found
-at the \mlhref{http://www.adobe.com/go/acrobat_developer}{Acrobat Developer Center};
+at the \mlhref{http://www.adobe.com/go/acrobat_developer}{\mbox{\app{Acrobat}} Developer Center};
or go to the \href{http://www.adobe.com/go/acrobat_security}{Security page};
-in particular, see the document \textit{Digital Signature User Guide for Acrobat 9.0
+in particular, see the document \textit{Digital Signature User Guide for \app{Acrobat} 9.0
and Adobe Reader 9.0}. Other comments on the topic of signature fields:
\begin{itemize}
\item The open key \cs{textSize} is recognized, but is change to 0.
@@ -1129,9 +1145,9 @@ package to create multiple-line links.
\settowidth{\aebdimen}{\cs{setLinkText[\meta{options}]\darg{\meta{link\_text}}}}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\setLink[!meta(options)]{!meta(link_text)}
-\setLinkText[!meta(options)]{!meta(link_text)}
+!grayV(\setLinkText[!meta(options)]{!meta(link_text)})
\end{dCmd}
-\newtopic Both link commands are the same, the use of the second one, \cs{setLink}, is
+\newtopic Both link commands are the same, the use of the second one, \cs{setLinkText} (grayed out), is
discouraged in favor of the use of \cs{setLink}.
\PD The command has two arguments, the first is optional. The first
@@ -1195,7 +1211,7 @@ A form field may simply gather data from the user; additionally,
it may perform one or more \textit{actions}. Actions include
execute JavaScript code, going to a particular page in a document,
open a file, execute a menu item, reset a form, play media or a
-sound, and so on. Beginning with Acrobat~5.0, most actions can be
+sound, and so on. Beginning with \app{Acrobat}~5.0, most actions can be
performed using JavaScript methods.
An action is initiated by a \textit{trigger}, a field may have
@@ -1479,7 +1495,7 @@ for details of the syntax.
\noindent See section~8.5.3, `URI Actions', of the \textit{PDF
Reference}~\cite{tech:PDFRef} for details of the syntax.
-Acrobat (Adobe Reader) also support open parameters, using these key-value pairs,
+\app{Acrobat} (Adobe Reader) also support open parameters, using these key-value pairs,
we can go to a specific page in a PDF on the web, and even search for words, for example
\pushButton[\CA{Go & Search}\A{/S/URI/URI(http://www.math.uakron.edu/~dpstory/acrotex/aeb_man.pdf#page=8&search=AcroTeX web exerquiz)}]{myButton4a}{}{10bp}
opens the AeB Manual on the Internet, goes to page 8, and searches for the words
@@ -1497,7 +1513,7 @@ item). Named actions listed in the \textit{PDF Reference} are
\texttt{NextPage}, \texttt{PrevPage}, \texttt{FirstPage} and
\texttt{LastPage}. A complete list of named actions can be
obtained by executing the code \texttt{app.listMenuItems()} in
-the JavaScript console of Acrobat (Pro).
+the JavaScript console of \app{Acrobat} (Pro).
\pushButton[\CA{Go}\AC{Previous!}\RC{To}\A{/S/Named/N/PrevPage}]{myButton5}{}{10bp}
\begin{Verbatim}[xleftmargin=\amtIndent]
\pushButton[\CA{Go}\AC{Previous!}\RC{To}
@@ -1510,7 +1526,7 @@ actions listed in the PDF Reference are \texttt{NextPage},
In theory, any menu item can be executed as a named actions; there
are several factors to be taken into consideration: (1) Not all menu
-items available to Acrobat are listed on the menu bar of Adobe
+items available to \app{Acrobat} are listed on the menu bar of Adobe
Reader, when choosing a name event to use, you should decide if the
application executing the named action supports that action; (2) In
recent versions, starting with version 7, there have been security
@@ -1563,7 +1579,7 @@ CollectionHome & GoBackDoc & rolReadPage\\
CollectionPreview & GoForwardDoc & ZoomDragMenuItem\\
\end{longtable}
\end{small}
-\newtopic As mentioned before, some of these are for Acrobat only, others are available for Adobe Reader. I'll
+\newtopic As mentioned before, some of these are for \app{Acrobat} only, others are available for Adobe Reader. I'll
let you sort them out. If you try to execute a named action that is not on the white list, the action will
silently fail.
@@ -1636,24 +1652,24 @@ command \cs{JS}, defined in the \textsf{insldjs} package, it expands to the corr
of \cs{JS}.
Most all actions can be performed using JavaScript, the reader is
-referred to the \textit{JavaScript for Acrobat API
+referred to the \textit{JavaScript for \app{Acrobat} API
Reference}~\cite{tech:AcroJSRef}.
\section{JavaScript}
-Acrobat JavaScript is the cross-platform scripting language of the
-Acrobat suite of products. For Acrobat 5.0 or later, Acrobat
+\app{Acrobat} JavaScript is the cross-platform scripting language of the
+\app{Acrobat} suite of products. For \app{Acrobat} 5.0 or later, \app{Acrobat}
JavaScript based on JavaScript version 1.5 of ISO-16262 (formerly
known as ECMAScript), and adds extensions to the core language to
-manipulate Acrobat forms, pages, documents, and even the viewer
+manipulate \app{Acrobat} forms, pages, documents, and even the viewer
application.
Web-based references to core JavaScript are the \textit{Core
JavaScript Guide}~\cite{tech:NetscapeJSGuide} and the \textit{Core
-JavaScript Reference}~\cite{tech:NetscapeJSReference}. For Acrobat
-JavaScript, we refer you to the \textit{Developing Acrobat
+JavaScript Reference}~\cite{tech:NetscapeJSReference}. For \app{Acrobat}
+JavaScript, we refer you to the \textit{Developing \app{Acrobat}
Applications using JavaScript}~\cite{tech:AcroJSGuide} and the
-\textit{JavaScript for Acrobat API Reference}~\cite{tech:AcroJSRef}.
+\textit{JavaScript for \app{Acrobat} API Reference}~\cite{tech:AcroJSRef}.
\verygoodbreak
@@ -1736,9 +1752,9 @@ literal double quotes \texttt{"}, to avoid \texttt{"} being
interpreted as the end of the string (or the beginning of a string)
we have to double escape the double quotes, as in \verb+\\"+. (This
is not necessary when entering code in the JavaScript editor if you
-have the Acrobat application.) I try to write JavaScript that I can easily
+have the \app{Acrobat} application.) I try to write JavaScript that I can easily
read, edit, and debug in the JavaScript editor (available in
-the full Acrobat application); for this reason, I've added in new
+the full \app{Acrobat} application); for this reason, I've added in new
lines and tabbing (\cs{r} and \cs{t}). Many people, however, have
only the Adobe Reader and cannot see their code to debug it; in this
case, the formatting is really not needed.
@@ -1828,7 +1844,7 @@ The syntax for this command is
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\defineJSStr{\!anglemeta(CMD)}{!anglemeta(JS_string)}
\end{dCmd}
-\PD The parameter \cs{\anglemeta{CMD}} is a command to be define by
+\PD Where \cs{\anglemeta{CMD}} is a command to be defined by
\cs{defineJSStr}, for example, \cs{myMessage}, and \anglemeta{JS\_string} is
the JavaScript string to be defined as the expansion of the
\cs{\anglemeta{CMD}}.
@@ -1957,61 +1973,72 @@ Later, a push button can use this preset, like so,
\newtopic You can mix your \cs{myFavFive} with different key-value pairs, such as a JavaScript action.
+\handpoint In each of the subsequent subsections, the \pkg{eforms} key to its user-friendly counterpart is
+displayed in the margin. Some of the user-friendly are a combination of
+\pkg{eforms} KVs and are not represented in the margin in this case.
+
\subsection{The Appearance Tab}
-We set these key-value pairs to model the user interface of Acrobat.
+We present these key-value pairs to model the user-interface of \app{Acrobat}.
-The key is \texttt{border}. In the case of a link, this is the Link Type: \textsf{Visible Rectangle}
-or \textsf{Invisible Rectangle}. For forms, this key has no counterpart
-in the user interface. If you set border equal to \texttt{invisible}, that
-will set border line width to zero \verb!\W{0}!.
\settowidth{\aebdimen}{\ttfamily border=visible|invisible}
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
border=visible|invisible
\end{dCmd}
-\CmdDescription Used with link annotations and determines whether the border surrounding the bounding
-box of the link is visible. If this key is not specified, the \textsf{eforms}
+\CmdDescription Used with link annotations and determines whether the border
+surrounding the bounding box of the link is visible. In the case of a link,
+this is the Link Type: \textsf{Visible Rectangle} or \textsf{Invisible
+Rectangle}. If you set border equal to \texttt{invisible}, that will set
+border line width to zero \verb!\W{0}!. For forms, this key has no
+counterpart in the user interface.
+
+If this key is not specified, the \textsf{eforms}
follows the rule: If \texttt{colorlinks} option of \textsf{hyperref} is used, the border is invisible;
otherwise, it is visible (and the default \texttt{linewidth} is 1). Use the border key to override
this behavior.
-\settowidth{\aebdimen}{\ttfamily linewidth=thin|medium|thick}
+\settowidth{\aebdimen}{\ttfamily linewidth=thin|medium|thick}%
+\def\1{\llap{\Cs{W}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-linewidth=thin|medium|thick
+!1linewidth=thin|medium|thick
\end{dCmd}
\CmdDescription The \texttt{linewidth} of the border around a link
or a form. The user interface choices are \texttt{thin},
\texttt{medium}, and \texttt{thick}. This key-value is ignored if the
document author has set the border to \texttt{invisible}.
-\settowidth{\aebdimen}{\ttfamily highlight=none|invert|outline|inset|push}
+\settowidth{\aebdimen}{\ttfamily highlight=none|invert|outline|inset|push}%
+\def\1{\llap{\Cs{H}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-highlight=none|invert|outline|inset|push
+!1highlight=none|invert|outline|inset|push
\end{dCmd}
\CmdDescription The highlight type for links and forms, choices are
\texttt{none}, \texttt{invert}, \texttt{outline}, \texttt{inset} and
\texttt{push}. The term \texttt{inset} is used with links, and
\texttt{push} is used with forms. They each have the same key value pair.
-\settowidth{\aebdimen}{\ttfamily bordercolor=\anglemeta{num}\hardspace\anglemeta{num}\hardspace\anglemeta{num}}
+\settowidth{\aebdimen}{\ttfamily bordercolor=\anglemeta{num}\hardspace\anglemeta{num}\hardspace\anglemeta{num}}%
+\def\1{\llap{\smash{\parbox[c]{\marginparwidth}{\raggedright\shortstack[l]{\Cs{BC}\,(forms) or\\\Cs{Color}\,(links)}}}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-bordercolor=!anglemeta(num)!hardspace!anglemeta(num)!hardspace!anglemeta(num)
+!1bordercolor=!anglemeta(num)!hardspace!anglemeta(num)!hardspace!anglemeta(num)
\end{dCmd}
\CmdDescription The color of the border, when visible, in RGB color space.
For example, \texttt{bordercolor=1 0 0}, is the color red.
-\settowidth{\aebdimen}{\ttfamily linestyle=solid|dashed|underlined|beveled|inset}
+\settowidth{\aebdimen}{\ttfamily linestyle=solid|dashed|underlined|beveled|inset}%
+\def\1{\llap{\Cs{S}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-linestyle=solid|dashed|underlined|beveled|inset
+!1linestyle=solid|dashed|underlined|beveled|inset
\end{dCmd}
\CmdDescription The line style of the border, possible values are \texttt{solid},\texttt{dashed},
\texttt{underlined}, \texttt{beveled},and \texttt{inset}. Links do not support
the \texttt{beveled} option.
-\settowidth{\aebdimen}{\ttfamily dasharray=\anglemeta{num}[\hardspace\anglemeta{num}]}
+\settowidth{\aebdimen}{\ttfamily dasharray=\anglemeta{num}[\hardspace\anglemeta{num}]}%
+\def\1{\llap{\Cs{D}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-dasharray=!anglemeta(num)[!hardspace!anglemeta(num)]
+!1dasharray=!anglemeta(num)[!hardspace!anglemeta(num)]
\end{dCmd}
\CmdDescription When a line style of \texttt{dashed} is chosen, you can specify a dash array.
The default is 3.0, which means a repeating pattern of 3 points of line, followed by 3 points of space.
@@ -2019,9 +2046,12 @@ A value of \texttt{dasharray=3~2} means three points of line, followed
by two points of space. When this key is used without a value, the value is 3.0.
When the \texttt{dashed} key is not present, 3.0 is used.
-\settowidth{\aebdimen}{\ttfamily linktxtcolor=\anglemeta{named\_color}}
+linktxtcolor
+
+\settowidth{\aebdimen}{\ttfamily linktxtcolor=\anglemeta{named\_color}}%
+\def\1{\llap{\Cs{linktxtcolor}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-linktxtcolor=!anglemeta(named_color)
+!1linktxtcolor=!anglemeta(named_color)
\end{dCmd}
\CmdDescription Set the color of the link text. Ignored if the
\texttt{colorlinks} option of hyperref has not been taken. The
@@ -2032,9 +2062,10 @@ redefining \cs{defaultlinkcolor}. If \verb!linktxtcolor={}! (an
empty argument), or simply \texttt{linktxtcolor}, no color is
applied to the text, the color of the text will be whatever the current color is.
-\settowidth{\aebdimen}{\ttfamily annotflags=hidden|print|-print|noview|lock}
+\settowidth{\aebdimen}{\ttfamily annotflags=hidden|print|-print|noview|lock}%
+\def\1{\llap{\Cs{F}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-annotflags=hidden|print|-print|noview|lock
+!1annotflags=hidden|print|-print|noview|lock
\end{dCmd}
\CmdDescription This is a bit field, possible values are \texttt{hidden}, \texttt{print},
@@ -2045,9 +2076,10 @@ For example, \verb|annotflags={-print,lock}| makes the field not printable and i
locked, so the field cannot be moved through the UI.
-\settowidth{\aebdimen}{\ttfamily fieldflags=readonly|required|noexport|multiline|password|}
+\settowidth{\aebdimen}{\ttfamily fieldflags=readonly|required|noexport|multiline|password|}%
+\def\1{\llap{\Cs{Ff}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-fieldflags=readonly|required|noexport|multiline|password|
+!1fieldflags=readonly|required|noexport|multiline|password|
notoggleoff|radio|pushbutton|combo|edit|
sort|fileselect|multiselect|nospellcheck|
noscrolling|comb|radiosinunison|commitonchange|
@@ -2057,20 +2089,25 @@ fieldflags=readonly|required|noexport|multiline|password|
number of properties of a field. This is a multiple-selection key as well. The
values are ``or-ed'' together.
-Normally, a document author would not specify \texttt{radio}, \texttt{pushbutton} or \texttt{combo}. These properties are used by \textsf{eforms} to construct a radio button field, a push button and a combo box. The others can be used as appropriate.
+Normally, a document author would not specify \texttt{radio},
+\texttt{pushbutton} or \texttt{combo}. These properties are used by
+\textsf{eforms} to construct a radio button field, a push button and a combo
+box. The others can be used as appropriate.
-\settowidth{\aebdimen}{\ttfamily maxlength=\anglemeta{num}}
+\settowidth{\aebdimen}{\ttfamily maxlength=\anglemeta{num}}%
+\def\1{\llap{\Cs{MaxLen}\hspace{\marginparsep}}}%%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-maxlength=!anglemeta(num)
+!1maxlength=!anglemeta(num)
\end{dCmd}
\CmdDescription Use \texttt{maxlength} to limit the number of characters input into a text field.
Example: \texttt{maxlength=12}. When the \texttt{fieldflags} is set to \texttt{comb}, the value
of \texttt{maxlength} determines the number of combs in the field.
-\settowidth{\aebdimen}{\ttfamily tooltip=\anglemeta{string}}
+\settowidth{\aebdimen}{\ttfamily tooltip=\anglemeta{string}}%
+\def\1{\llap{\Cs{TU}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-tooltip=!anglemeta(string)
+!1tooltip=!anglemeta(string)
\end{dCmd}
\CmdDescription Enter a text value to appear as a tool tip. A tool
tip is text that appears in a frame when the user hovers the mouse
@@ -2084,10 +2121,12 @@ tooltip = {J\"{u}rgen, press me and see what happens!}
\end{Verbatim}
\noindent yields a tool tip of ``J\"{u}rgen, press me and see what happens!''
-\settowidth{\aebdimen}{\ttfamily default=\anglemeta{string}}
+\settowidth{\aebdimen}{\ttfamily default=\anglemeta{string}}%
+\def\1{\llap{\Cs{DV}\hspace{\marginparsep}}}%
+\def\2{\llap{\Cs{V}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-default=!anglemeta(string)
-value=!anglemeta(string)
+!1default=!anglemeta(string)
+!2value=!anglemeta(string)
\end{dCmd}
\CmdDescription Set default value of a field (text, list, combobox)
using the \texttt{default} key. The default value is the value used
@@ -2103,24 +2142,29 @@ If the unicode option of hyperref is in effect, then setting
``\char1 \ 1 000 000''.
\settowidth{\aebdimen}{\ttfamily rotate=0|90|180|270}
+\def\1{\llap{\Cs{R}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-rotate=0|90|180|270
+!1rotate=0|90|180|270
\end{dCmd}
\CmdDescription Set the orientation of the field, values are 0, 90, 180 and 270. If 90 or 270
are chosen, the height and width of the field need to be reversed. This is not
done automatically by \textsf{eforms}
\settowidth{\aebdimen}{\ttfamily bgcolor=\anglemeta{num}\hardspace\anglemeta{num}\hardspace\anglemeta{num}}
+\def\1{\llap{\Cs{BG}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-bgcolor=!anglemeta(num)!hardspace!anglemeta(num)!hardspace!anglemeta(num)
+!1bgcolor=!anglemeta(num)!hardspace!anglemeta(num)!hardspace!anglemeta(num)
\end{dCmd}
\CmdDescription The background color of a form field. This is a RGB color value.
\settowidth{\aebdimen}{\ttfamily rollovertxt=\anglemeta{string}}
+\def\1{\llap{\Cs{CA}\hspace{\marginparsep}}}%
+\def\2{\llap{\Cs{AC}\hspace{\marginparsep}}}%
+\def\3{\llap{\Cs{RC}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-uptxt=!anglemeta(string)
-downtxt=!anglemeta(string)
-rollovertxt=!anglemeta(string)
+!1uptxt=!anglemeta(string)
+!2downtxt=!anglemeta(string)
+!3rollovertxt=!anglemeta(string)
\end{dCmd}
\CmdDescription The normal (mouse up), mouse down and rollover text
for a button field. All three of these keys obey the \texttt{unicode} option.
@@ -2131,21 +2175,24 @@ If the \opt{unicode} option of \pkg{hyperref} is in effect, then setting
\newtopic \textbf{Push buttons only.} The following list of keys are used for
-creating custom appearances on button faces. Acrobat Distiller required for
+creating custom appearances on button faces. \app{Acrobat} Distiller required for
this set. The example files
\marginpar{\mbox{\makebox[0pt][l]{\textcolor{blue}{\Pisymbol{webd}{254}}}\raisebox{-2pt}{\color{red}{{\zqacr
b\hspace{9.5pt}}}}}}\texttt{\href{\urlAcroTeXBlog/?p=879}{eqforms.pdf}} and
\texttt{\href{\urlAcroTeXBlog/?p=1291}{eqforms\_pro.pdf}} illustrate the
creation of icons as button appearances. In the latter PDF,
-\texttt{eqforms\_pro.pdf}, \textsf{Acrobat Distiller} is required to be the
+\texttt{eqforms\_pro.pdf}, \textsf{\app{Acrobat} Distiller} is required to be the
PDF creator.
\begin{itemize}
\item[]
\settowidth{\aebdimen}{\ttfamily normappr=\anglemeta{string}}
+\def\1{\llap{\Cs{I}\hspace{\marginparsep}}}%
+\def\2{\llap{\Cs{RI}\hspace{\marginparsep}}}%
+\def\3{\llap{\Cs{IX}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-normappr=!anglemeta(string)
-rollappr=!anglemeta(string)
-downappr=!anglemeta(string)
+!1normappr=!anglemeta(string)
+!2rollappr=!anglemeta(string)
+!3downappr=!anglemeta(string)
\end{dCmd}
\item[]\CmdDescription The normal, rollover, and down appearances of the button face icon. The value of each
key is an indirect reference to a form XObject. Normally, you can use the \texttt{graphicxsp} package
@@ -2153,8 +2200,9 @@ to embed graphics and give a symbolic name which is used as the value of these k
\item[]
\settowidth{\aebdimen}{\ttfamily layout=labelonly|icononly|icontop|iconbottom|}
+\def\1{\llap{\Cs{TP}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-layout=labelonly|icononly|icontop|iconbottom|
+!1layout=labelonly|icononly|icontop|iconbottom|
iconleft|iconright|labelover
\end{dCmd}
\item[]\CmdDescription The value of this key determines the layout of the icon relative to the label (or caption).
@@ -2163,8 +2211,9 @@ layout=labelonly|icononly|icontop|iconbottom|
\item[]
\settowidth{\aebdimen}{\ttfamily scalewhen=always|never|iconbig|iconsmall}
+\def\1{\llap{\Cs{SW}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-scalewhen=always|never|iconbig|iconsmall
+!1scalewhen=always|never|iconbig|iconsmall
\end{dCmd}
\item[]\CmdDescription The value of this key tells when to scale the icon. The \texttt{iconbig}
scales the icon when it is too big for the bounding rectangle; while
@@ -2173,8 +2222,9 @@ scalewhen=always|never|iconbig|iconsmall
\item[]
\settowidth{\aebdimen}{\ttfamily scale=proportional|nonproportional}
+\def\1{\llap{\Cs{ST}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-scale=proportional|nonproportional
+!1scale=proportional|nonproportional
\end{dCmd}
\item[]\CmdDescription This parameter sets the scale type, either \texttt{proportional} scaling, where
the aspect ratio of the icon is preserved; or \texttt{nonproportional} scaling is used. The
@@ -2182,8 +2232,9 @@ default is \texttt{proportional}.
\item[]
\settowidth{\aebdimen}{\ttfamily position=\anglemeta{x}\hardspace\anglemeta{y})}
+\def\1{\llap{\Cs{PA}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-position=!anglemeta(x)!hardspace!anglemeta(y)
+!1position=!anglemeta(x)!hardspace!anglemeta(y)
\end{dCmd}
\item[]\CmdDescription Both \anglemeta{x} and \anglemeta{y} are numbers
between 0 and 1, inclusive, and separated by a space (not a comma). They
@@ -2195,8 +2246,9 @@ position=!anglemeta(x)!hardspace!anglemeta(y)
\item[]
\settowidth{\aebdimen}{\ttfamily fitbounds=true|false}
+\def\1{\llap{\Cs{FB}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-fitbounds=true|false
+!1fitbounds=true|false
\end{dCmd}
\item[]\CmdDescription A Boolean value, if \texttt{true}, indicates
that the button appearance should be scaled to fit fully
@@ -2208,19 +2260,20 @@ fitbounds=true|false
\newtopic \textbf{Check boxes and Radio Buttons Only.} The following
list of keys are used for creating custom appearances on check boxes and
-radio buttons. Acrobat Distiller required for this set. The example files
+radio buttons. \app{Acrobat} Distiller required for this set. The example files
\marginpar{\mbox{\makebox[0pt][l]{\textcolor{blue}{\Pisymbol{webd}{254}}}\raisebox{-2pt}{\color{red}{{\zqacr
b\hspace{9.5pt}}}}}}\texttt{\href{\urlAcroTeXBlog/?p=879}{eqforms.pdf}} and
\texttt{\href{\urlAcroTeXBlog/?p=1291}{eqforms\_pro.pdf}} illustrate the
-creation of these appearances.. In the latter PDF, \texttt{eqforms\_pro.pdf},
-\textsf{Acrobat Distiller} is required to be the PDF creator.
+creation of these appearances. In the latter PDF, \texttt{eqforms\_pro.pdf},
+\textsf{\app{Acrobat} Distiller} is required to be the PDF creator.
\begin{itemize}
\item[]
\settowidth{\aebdimen}{\ttfamily appr=\darg{ norm=\darg{on=\darg\anglemeta{normOnAppr}},off=\darg{\anglemeta{normOffAppr}}},}
+\def\1{\llap{\Cs{AP}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-appr={ norm={on={!anglemeta(normOnAppr)},off={!anglemeta(normOffAppr)}},
+!1appr={ norm={on={!anglemeta(normOnAppr)},off={!anglemeta(normOffAppr)}},
down={on={!anglemeta(downOnAppr)},off={!anglemeta(downOffAppr)}},
roll={on={!anglemeta(rollOnAppr)},off={!anglemeta(rollOffAppr)}}}
\end{dCmd}
@@ -2231,26 +2284,30 @@ appr={ norm={on={!anglemeta(normOnAppr)},off={!anglemeta(normOffAppr)}},
have the same structure as \texttt{norm} does.
\item[] If \texttt{appr} is not specified, then, by default, the usual appearances of the
- buttons are used, as provided by Acrobat/AR.
+ buttons are used, as provided by \app{Acrobat}/AR.
\item[] The \texttt{down} and \texttt{roll} are optional, if you use \texttt{appr} at all, you should
specify the norm appearance, both \texttt{on} and \texttt{off} appearances.
\end{itemize}
-\settowidth{\aebdimen}{\ttfamily align=left|centered|right}
+\settowidth{\aebdimen}{\ttfamily align=left|centered|right}%
+\def\1{\llap{\Cs{Q}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-align=left|centered|right
+!1align=left|centered|right
\end{dCmd}
\CmdDescription The type of alignment of a text field. Permitted values are
\texttt{left}, \texttt{centered}, and \texttt{right}.
-\settowidth{\aebdimen}{\ttfamily textcolor=\anglemeta{num}[\hardspace\anglemeta{num}\hardspace\anglemeta{num}[\hardspace\anglemeta{num}]]}
+\settowidth{\aebdimen}{\ttfamily textcolor=\anglemeta{num}[\hardspace\anglemeta{num}\hardspace\anglemeta{num}[\hardspace\anglemeta{num}]]}%
+\def\1{\llap{\Cs{textFont}\hspace{\marginparsep}}}%
+\def\2{\llap{\Cs{textSize}\hspace{\marginparsep}}}%
+\def\3{\llap{\Cs{textColor}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-textfont=!anglemeta(font_name)
-textsize=!anglemeta(num)
-textcolor=!anglemeta(num)[!hardspace!anglemeta(num)!hardspace!anglemeta(num)[!hardspace!anglemeta(num)]]
+!1textfont=!anglemeta(font_name)
+!2textsize=!anglemeta(num)
+!3textcolor=!anglemeta(num)[!hardspace!anglemeta(num)!hardspace!anglemeta(num)[!hardspace!anglemeta(num)]]
\end{dCmd}
\CmdDescription
The key \texttt{textfont} is the text font to be used with the text of the field,
@@ -2258,17 +2315,34 @@ while \texttt{textsize} is the text size to be used. A value of 0 means auto siz
The color of the text in the field. This can be in \textsf{G}, \textsf{RGB} or \textsf{CMYK} color
space by specifying 1, 3 or 4 numbers between 0 and 1.
-\settowidth{\aebdimen}{\ttfamily autocenter=yes|no}
+\settowidth{\aebdimen}{\ttfamily autocenter=yes|no}%
+\def\1{\llap{\Cs{autoCenter}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-autocenter=yes|no
+!1autocenter=yes|no
\end{dCmd}
\CmdDescription This is a feature of \textsf{eforms}. Use
\texttt{autocenter=yes} (the default) to moderately center the bounding box,
and use \texttt{autocenter=no} otherwise.
+\settowidth{\aebdimen}{\ttfamily inline=yes|no}%
+\def\1{\llap{\Cs{inline}\hspace{\marginparsep}}}%
+\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
+!1inline=yes|no
+\end{dCmd}
+\CmdDescription Same as \cs{autoCenter} (\texttt{autocenter}), but the algorithm
+for positioning the field is more sophisticated. The default is \verb|autocenter=no|
+
+To compare the last two (\texttt{autocenter} and \texttt{inline}), we present the following example:
+\begin{quote}\settowidth{\dimen0}{Enter your first name:\ }%
+\underbar{Enter your name:\ \textField[\V{D. P. Story}\DV{D. P. Story}\inline{y}]{ILtxt}{1.25in}{14bp}}\cgBdry[3bp](\texttt{inline=yes})\\[6bp]
+\underbar{Enter your name:\ \textField[\V{D. P. Story}\DV{D. P. Story}]{ACtxt}{1.25in}{14bp}}\cgBdry[3bp](\texttt{autoCenter=yes})
+\end{quote}
+
+
\settowidth{\aebdimen}{\ttfamily presets=\meta{\string\CMD}}
+\def\1{\llap{\Cs{presets}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-presets=!meta(\CMD)
+!1presets=!meta(\CMD)
\end{dCmd}
\CmdDescription Set presets from inside a \cs{ui} argument. The value of \cs{ui} must be a user defined
command, which expands to a comma-delimited list of ui-key-value pairs.
@@ -2289,9 +2363,10 @@ Later, we can type,
\setLink[\ui{presets={\myUIOpts}}]{Press Me Again!!}
\end{dCmd*}
-\settowidth{\aebdimen}{\ttfamily symbolchoice=check|circle|cross|diamond|square|star}
+\settowidth{\aebdimen}{\ttfamily symbolchoice=check|circle|cross|diamond|square|star}%
+\def\1{\llap{\Cs{symbolchoice}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-symbolchoice=check|circle|cross|diamond|square|star
+!1symbolchoice=check|circle|cross|diamond|square|star
\end{dCmd}
\CmdDescription Used with a checkbox or radio button field. This sets the symbol
that appears in the field when the box is checked. Choices are
@@ -2339,7 +2414,7 @@ and to pages and destinations to another PDF file. these are
\item \texttt{view}: The view can be set when the \texttt{page} key is used.
Possible values are \texttt{fitpage}, \texttt{actualsize},
\texttt{fitwidth}, \texttt{fitvisible}, and \texttt{inheritzoom}.
- These terms correspond to Acrobat's UI. When jumping to a
+ These terms correspond to \app{Acrobat}'s UI. When jumping to a
destination, the view is set by the destination code.
\item \texttt{open}: This key is used when you specify the \texttt{file} key. The
@@ -2376,9 +2451,10 @@ these are handled by the \textsf{eforms} package.
\end{itemize}
-\settowidth{\aebdimen}{\ttfamily js=\darg{\anglemeta{script}}}
+\settowidth{\aebdimen}{\ttfamily js=\darg{\anglemeta{script}}}%
+\def\1{\llap{\ttfamily\Cs{A}\darg{\Cs{JS}\darg{\anglemeta{script}}}\hspace{\marginparsep}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-js={!anglemeta(script)}
+!1js={!anglemeta(script)}
\end{dCmd}
\CmdDescription A general purpose key to execute JavaScript actions on a mouse up trigger.
The argument is a JavaScript text string, for example,
@@ -2436,8 +2512,9 @@ JavaScript code (\anglemeta{script}).
as readonly (locked). The locked key controls that option.
\settowidth{\aebdimen}{\ttfamily lock=\darg{\anglemeta{PDF KV-pairs}}}
+\def\1{\llap{\Cs{Lock}\hspace{\marginparsep}}}%Lock
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
-lock={!anglemeta(PDF KV-pairs)}
+!1lock={!anglemeta(PDF KV-pairs)}
\end{dCmd}
\CmdDescription The \texttt{lock} key is used with signature fields, currently, there is
@@ -2577,7 +2654,7 @@ The syntax for \cs{setStructTabOrder} is
of a previously defined PDF object, such as a form field (widget), a link, or an annotation. The
optional argument takes two optional key-value pairs: (1) The type is a declaration of the type
the PDF object is, the default is \texttt{Form} (you can use \texttt{Link} if its a link, and \texttt{Annot} if its a comment);
-(2) \texttt{title} is the title of the structure, the value of title appears in the Tags panel of the Acrobat
+(2) \texttt{title} is the title of the structure, the value of title appears in the Tags panel of the \app{Acrobat}
user interface. The default title is to have no title.
\newtopic The demo file is \marginpar{\mbox{\makebox[0pt][l]{\textcolor{blue}{\Pisymbol{webd}{254}}}\raisebox{-2pt}{\color{red}{{\zqacr
@@ -2624,32 +2701,33 @@ b\hspace{9.5pt}}}}}}\texttt{\href{\urlAcroTeXBlog/?p=334}{settaborder1.pdf}} for
The \hypertarget{\pkg{insdljs}}{insdljsPkg} package provides support to {\LaTeX} in four areas:
\begin{enumerate}
- \item for embedding document level JavaScript into the PDF file created from a {\LaTeX} source,
- the \texttt{insDLJS} environment.
- \item for creating open page actions that are executed when the document is first opened to the first
- page, the \cs{OpenAction} command.
- \item for writing JavaScript code in an environment that preserves the formatting of the code,
- this is the \texttt{defineJS} environment.
- \item for executing JavaScript code once to perform post
- distill tasks, this is the \texttt{execJS} environment. This environment works only for document
- authors that use Acrobat/Acrobat Distiller to create PDF files.
+ \item for embedding document level JavaScript into the PDF file created
+ from a {\LaTeX} source, the \texttt{insDLJS} environment.
+ \item for creating open page actions that are executed when the document
+ is first opened to the first page, the \cs{OpenAction} command.
+ \item for writing JavaScript code in an environment that preserves the
+ formatting of the code, this is the \texttt{defineJS} environment.
+ \item for executing JavaScript code once to perform post-distillation
+ tasks, this is the \texttt{execJS} environment. This environment
+ works only for document authors that use \app{Acrobat}/\app{Acrobat}
+ Distiller to create PDF files.
\end{enumerate}
\newtopic This package defines a new environment, \texttt{insDLJS}, used
-for inserting Acrobat JavaScript into a PDF file created from a \LaTeX{}
-source. This package works correctly for users of \textsf{pdftex} (and
-luatex), \textsf{dvipdfm}, \textsf{dvipdfmx}, and \texttt{xetex}. For
-those that use the \textsf{Acrobat Distiller} (specifically, those that
-use either \textsf{dvips} or \textsf{dvipsone} to produce a postscript
-file, which is then distilled), you are required to have Acrobat~5.0 (or
-later).
+for inserting \app{Acrobat} JavaScript into a PDF file created from a
+\LaTeX{} source. This package works correctly for users of \textsf{pdftex}
+(and \app{luatex}), \textsf{dvipdfm}, \textsf{dvipdfmx}, and \texttt{xetex}.
+For\marginpar{\small\raggedleft\app{Acrobat} required for
+\app{dvips}} those who use either \app{dvips} or
+\app{dvipsone} to produce a postscript file, which is then distilled, you are
+required to have \app{Acrobat}~5.0 (or later).
\section{Package Options}
The \textsf{insdljs} supports five common ``drivers'': \texttt{dvipsone},
\texttt{dvips}, \texttt{pdftex} (including the executable \textsf{lu(la)tex}), \texttt{dvipdfm},
\texttt{dvipdfmx}, \texttt{xetex}, and \texttt{tex\-tures}. When using
-\texttt{dvipsone} or \texttt{dvips}, Acrobat Distiller and Acrobat
+\texttt{dvipsone} or \texttt{dvips}, \app{Acrobat} Distiller and \app{Acrobat}
(version 5.0 or later) are required to embed the JavaScripts at the
document level. The other drivers have primitives that allow the embedding
of the JavaScripts.
@@ -2662,7 +2740,7 @@ of the JavaScripts.
\item\NH\texttt{execJS} is a very useful option/feature if you know how to use
it. Any JavaScript that is written in an \env{execJS} environment is
- executed once when the document is first opened in Acrobat, then
+ executed once when the document is first opened in \app{Acrobat}, then
discarded. AeB uses this for post-distillation document processing. The
default is that the JavaScript in an \texttt{execJS} environment is not
executed; using this option turns on this feature.
@@ -2745,14 +2823,14 @@ braces are set to normal characters, so the commands can't have any
argument, they should be just text macros.
\PD The environment takes three parameters, the first is optional, but required
-when using the Acrobat Distiller.
+when using the \app{Acrobat} Distiller.
\begin{description}\def\NH{\hspace{-\labelsep}}%
\item\NH\texttt{[\meta{js\_var}]} is an
optional parameter \emph{was required} for the \texttt{dvipsone}
and \texttt{dvips} options; otherwise it is ignored. Its value
must be the name of one of the functions or JavaScript variables
defined in the environment. This is used to detect whether the
- \textsf{DLJS} has already been loaded by Acrobat.
+ \textsf{DLJS} has already been loaded by \app{Acrobat}.
\handpoint The \texttt{[\meta{js\_var}]} is now optional even for
users of \textsf{dvipsone} and \textsf{dvips}. If one is not
@@ -2767,7 +2845,7 @@ when using the Acrobat Distiller.
\item\NH\meta{script\_name} is the name of the JavaScript that you are
embedding in the document. This title will appear in the document
- JavaScript dialog in Acrobat; unless you use Acrobat, you can't
+ JavaScript dialog in \app{Acrobat}; unless you use \app{Acrobat}, you can't
see this name in the user interface anyway. The
\meta{script\_name} should be a string that is descriptive of
the functionality of the code.
@@ -2835,7 +2913,7 @@ The \texttt{insDLJS*} environment can be used to better organize,
edit and debug your JavaScript. It is suitable for package
developers who write a large amount of code package application.
-If you have the full Acrobat product, you can open the DLJS edit
+If you have the full \app{Acrobat} product, you can open the DLJS edit
dialog. There you will see a listing of all DLJS contained in the
document. When you double click on one of the \textit{script names},
you enter the edit window, where you can edit all JavaScript
@@ -2860,7 +2938,7 @@ contained under that name.
\end{dCmd}
\egroup
\PD The environment takes two parameters, the first is optional, but required
-when using the Acrobat Distiller. The nested environment \texttt{newsegment} takes
+when using the \app{Acrobat} Distiller. The nested environment \texttt{newsegment} takes
one required parameter.
\begin{description}\def\NH{\hspace{-\labelsep}}
\item\NH\texttt{[\meta{js\_var}]} is an optional parameter, its use is discouraged.
@@ -2869,7 +2947,7 @@ one required parameter.
limited to eight characters. It is used to build the names of auxiliary
files and to build the names of macros used by the environment.
\item\NH\meta{script\_name\_i} is the script name (title) that appears in
- the Document level JavaScript dialog of Acrobat.
+ the Document level JavaScript dialog of \app{Acrobat}.
\end{description}
\subsection{Escaping}
@@ -2935,29 +3013,31 @@ and returns \texttt{true} if such a pattern is found, \texttt{false}
otherwise. If \verb!str="(x+1)^(3)"!, the search returns \texttt{true}.
\subsection{Access and Debugging}
-For those who do not have \textsf{Acrobat}, the application,
+For those who do not have \textsf{\app{Acrobat}}, the application,
unless you are writing very simple code, writing and debugging
-JavaScript will be very difficult. From the Acrobat Reader,
+JavaScript will be very difficult. From the \app{Acrobat} Reader,
there is no access to the document JavaScript. You will be
pretty much writing blind.
-Normally, I develop the JavaScript from within Acrobat. The GUI editor
+Normally, I develop the JavaScript from within \app{Acrobat}. The GUI editor
does check for syntax errors, giving you a chance to correct some simple
errors as you go. After I am satisfied with my code, I copy it from the
editor and paste it into a \texttt{insDLJS} environment. This is how the
JavaScript code of \textsf{exerquiz} was developed.
In my opinion, if you want to develop rather complicated code, having the
-full Acrobat product is a must. (This implies that the Windows or Mac
+full \app{Acrobat} product is a must. (This implies that the Windows or Mac
platform is needed!)
\subsection{JavaScript References}
-The JavaScript used by Acrobat consists of the core JavaScript plus Acrobat's JavaScript extensions.
-The \textit{Core JavaScript Reference}~\cite{tech:NetscapeJSReference} may be found at \mlhref{http://developer.mozilla.org/en/docs/JavaScript}{Mozilla Developer Center}.
-The documentation for the Acrobat extensions may be found in the guides \textit{JavaScript for Acrobat API Reference}~\cite{tech:AcroJSRef}
-and \textit{Developing Acrobat Applications using JavaScript}~\cite{tech:AcroJSGuide}, both of which I've had a hand in writing. These
-are found at \href{http://www.adobe.com/devnet/acrobat/}{Acrobat Developer Center}. (Click on \textbf{JavaScript for Acrobat} in the right-hand navigation panel.)
+The JavaScript used by \app{Acrobat} consists of the core JavaScript plus \app{Acrobat}'s JavaScript extensions.
+The \textit{Core JavaScript Reference}~\cite{tech:NetscapeJSReference} may be found at
+\mlhref{http://developer.mozilla.org/en/docs/JavaScript}{Mozilla Developer Center}.
+The documentation for the \app{Acrobat} extensions may be found in the guides
+\textit{JavaScript for \app{Acrobat} API Reference}~\cite{tech:AcroJSRef}
+and \textit{Developing \app{Acrobat} Applications using JavaScript}~\cite{tech:AcroJSGuide}, both of which I've had a hand in writing. These
+are found at \href{http://www.adobe.com/devnet/acrobat/}{\app{Acrobat} Developer Center}. (Click on \textbf{JavaScript for \app{Acrobat}} in the right-hand navigation panel.)
\section{Open Action}
@@ -3035,9 +3115,9 @@ the \cs{OpenAction} command.
This is an environment useful to PDF developers who want to tap into
the power of JavaScript. To use this environment, the developer
-needs Acrobat~5.0 or higher. \textsf{pdftex} or \textsf{dvipdfm} can
+needs \app{Acrobat}~5.0 or higher. \textsf{pdftex} or \textsf{dvipdfm} can
be used to produce the PDF document, but the developer needs
-the Acrobat product for this environment to do anything.
+the \app{Acrobat} product for this environment to do anything.
The \texttt{execJS} is used primarily for post-distillation
processing (post-creation processing, in the case of \textsf{pdftex}
@@ -3050,7 +3130,7 @@ verbatim JavaScript code. This environment is a variation on
\textsf{insdljs}, it writes a couple of auxiliary files to disk; in
particular, the environment creates an \texttt{.fdf} file. When the
newly produced PDF is loaded for the first time into the viewer
-(Acrobat, not Reader), the \texttt{.fdf} file generated
+(\app{Acrobat}, not Reader), the \texttt{.fdf} file generated
by the \textsf{execJS} environment is imported, and the JavaScript
executed. This JavaScript is \emph{not} saved with the document.
The syntax of this environment is\dots
@@ -3101,7 +3181,7 @@ aebAddWatermarkFromFile = app.trustPropagatorFunction (
});
\end{Verbatim}
-Once this code is installed in the user JavaScript folder, and Acrobat is re-started, the code
+Once this code is installed in the user JavaScript folder, and \app{Acrobat} is re-started, the code
is ready to be used. The way the code is used is with the \texttt{execJS} environment.
\begin{Verbatim}[xleftmargin=\amtIndent]
@@ -3114,7 +3194,7 @@ is ready to be used. The way the code is used is with the \texttt{execJS} enviro
\newtopic This is the code used to prepare this manual. It places a
background graphic on each page of the document. When the newly
-distilled document is first opened in Acrobat, (version 7.0 or
+distilled document is first opened in \app{Acrobat}, (version 7.0 or
higher, is when the privilege bit started to appear), the trusted
function \texttt{aebTrustedFunctions} is executed with its
arguments. Looking at the definition of
@@ -3211,7 +3291,7 @@ FLock & locked field (PDF 1.4)\\
\end{center}
\medskip\noindent
-In the user interface for Acrobat, there are four visibility
+In the user interface for \app{Acrobat}, there are four visibility
attributes for a form field. The table below is a list of these,
and an indication of how each visibility attribute can be attained
through the \textsf{F}.
@@ -3276,7 +3356,7 @@ FfRichText? & rich text (PDF 1.5) & text\\
Below is a list of the keys supported for modifying the appearance
or for creating an action of a field. If the default value of a
key is empty, e.g., \verb+\Ff{}+, then that key does not appear in
-the widget. The Acrobat viewer may have a default when any
+the widget. The \app{Acrobat} viewer may have a default when any
particular key does not appear, e.g. \verb+\W{}+ will be
interpreted as \verb+\W{1}+ by the viewer.
@@ -3333,6 +3413,10 @@ A? & Action dictionary, use this to define JavaScript actions, as well as o
& \verb+\A{}+\newline(no action)\\
Border? & Used with link annotations, an array of three numbers and an optional dash array.
If all three numbers are 0, no border is drawn &\verb+\Border{0 0 0}+\newline (no border)\\
+D? & (link annotations) An array of two numbers that set the dash pattern of a link annotation.
+ The default is 3, which means 3 points of line, 3 points gap.
+ A value of \cs{D\darg{3 2}} means three points of line, followed
+ by two points of space.\\
AP? & Appearance dictionary, used mostly in {\AcroT} with check boxes
to define the `On' value. &\verb+\AP{}+\\
AS? & Appearance state, normally used with check boxes and radio buttons when there are
@@ -3425,8 +3509,11 @@ Lock? & This key is used to lock fields after the signature field is
rawPDF? & If all else fails, you can always introduce key-value pairs
through this variable. &\verb+\rawPDF{}+\\
autoCenter? & There is a centering code that attempts to give a pleasant
- placement of the field. Say \verb+\autoCenter{n}+ to
- turn this off.&\\
+ placement of the field. \verb+\autoCenter{n}+
+ turn auto centering off.&\\
+inline? & If \mlcs{inline\darg{y}}, an alternate method is used
+ get a better vertical positioning. Designed for inline form fields.
+ The default is \mlcs{inline\darg{n}}.\\
presets? & This commands takes a macro as its argument, the text of the macro
are key-value pairs. This is useful for setting up a series of
presets for fields. Example, \verb|\presets{\myFavFive}|\\
@@ -3444,13 +3531,13 @@ linktxtcolor? & The value of this variable is a named color and is the
\end{longtable}
\endgroup
-%The JavaScript used by Acrobat consists of the core JavaScript plus Acrobat's JavaScript extensions.
+%The JavaScript used by \app{Acrobat} consists of the core JavaScript plus \app{Acrobat}'s JavaScript extensions.
%Core JavaScript can be found at \href{http://developer.mozilla.org/en/docs/JavaScript}{Mozilla Developer Center}.\footnote
%{\url{http://developer.mozilla.org/en/docs/JavaScript}}
-%and documentation of the Acrobat extensions can be found in the guides \texttt{JavaScript for Acrobat API Reference}
-%and \emph{Developing Acrobat Applications using JavaScript}, both of which I've had a hand in writing. These
-%can be found at the \href{http://www.adobe.com/devnet/acrobat/}{Acrobat Developer Center},\footnote
-%{\url{http://www.adobe.com/devnet/acrobat/}}. Click on \textbf{JavaScript for Acrobat} in the right-hand navigation panel.
+%and documentation of the \app{Acrobat} extensions can be found in the guides \texttt{JavaScript for \app{Acrobat} API Reference}
+%and \emph{Developing \app{Acrobat} Applications using JavaScript}, both of which I've had a hand in writing. These
+%can be found at the \href{http://www.adobe.com/devnet/acrobat/}{\app{Acrobat} Developer Center},\footnote
+%{\url{http://www.adobe.com/devnet/acrobat/}}. Click on \textbf{JavaScript for \app{Acrobat}} in the right-hand navigation panel.
\newpage
@@ -3466,17 +3553,17 @@ linktxtcolor? & The value of this variable is a named color and is the
\textit{Core JavaScript Reference} available from \href{http://developer.mozilla.org/en/docs/JavaScript}{Mozilla Developer Center}.
\bibitem{tech:AcroJSGuide}
- \textit{Developing Acrobat Applications using JavaScript}, available from
- \mlhref{http://www.adobe.com/devnet/acrobat/}{Acrobat Developer Center}
+ \textit{Developing \app{Acrobat} Applications using JavaScript}, available from
+ \mlhref{http://www.adobe.com/devnet/acrobat/}{\mbox{\app{Acrobat}} Developer Center}.
\bibitem{tech:AcroJSRef}\hypertarget{references}{}%
- \textit{JavaScript for Acrobat API Reference},available from
- \href{http://www.adobe.com/devnet/acrobat/}{Acrobat Developer Center}
+ \textit{JavaScript for \app{Acrobat} API Reference},available from
+ \href{http://www.adobe.com/devnet/acrobat/}{\app{Acrobat} Developer Center}.
\bibitem{tech:PDFRef}
\textit{PDF Reference, sixth edition, PDF 1.7}, available from
- \href{http://www.adobe.com/devnet/acrobat/}{Acrobat Developer Center}
+ \href{http://www.adobe.com/devnet/acrobat/}{\app{Acrobat} Developer Center}.
\end{thebibliography}
diff --git a/texmf-dist/source/latex/acrotex/eforms.dtx b/texmf-dist/source/latex/acrotex/eforms.dtx
index 7f949e23..0c5a49da 100644
--- a/texmf-dist/source/latex/acrotex/eforms.dtx
+++ b/texmf-dist/source/latex/acrotex/eforms.dtx
@@ -4,7 +4,7 @@
%<*copyright>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% eForms package, %%
-%% Copyright (C) 2002-2017 D. P. Story %%
+%% Copyright (C) 2002-2018 D. P. Story %%
%% dpstory@uakron.edu %%
%% %%
%% This program can redistributed and/or modified under %%
@@ -16,15 +16,25 @@
%</copyright>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{eforms}
-%<package> [2017/02/27 v2.9l Provides general eforms support (dps)]
+%<package> [2018/03/22 v2.9.19 Provides general eforms support (dps)]
%<*driver>
\documentclass{ltxdoc}
-\usepackage[colorlinks,hyperindex=false]{hyperref}[2012/10/12] % to support calculate for pdfyrc
+\usepackage[colorlinks,hyperindex=false]{hyperref}[2012/10/12]
\pdfstringdefDisableCommands{\let\\\textbackslash}
\OnlyDescription
\EnableCrossrefs
\CodelineIndex
\RecordChanges
+\bgroup\ttfamily
+\gdef\brpr#1{\char123\relax#1\char125\relax}\egroup
+\let\darg\brpr
+\let\env\texttt
+\let\opt\texttt
+\let\app\textsf
+\def\visispace{\symbol{32}}
+\def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}}
+\def\meta#1{\textsl{\texttt{#1}}}
+\def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}}
\def\ltag{<}\def\rtag{>}
\let\app\textsf\let\pkg\textsf
\InputIfFileExists{aebdocfmt.def}{\PackageInfo{eforms}{Inputting aebdocfmt.def}}
@@ -80,9 +90,11 @@
% Set the driver dependent code for the |quiz| environments.
%
% \changes{v2.5o}{2012/06/18}{Added required package \string\textsf{ifpdf}}
+% \changes{v2.9m}{2017/09/03}{Added the ifluatex package}
% \begin{macrocode}
\RequirePackage{ifpdf}[2006/02/20]
\RequirePackage{ifxetex}[2006/08/21]
+\RequirePackage{ifluatex}
% \end{macrocode}
% \changes{v2.6c}{2014/02/18}{Added the \string\textsf{calc} package as required package.}
% \begin{macrocode}
@@ -117,6 +129,14 @@
% \PassOptionsToPackage{pdftex}{insdljs}
% \PassOptionsToPackage{pdftex}{hyperref}
}
+% \end{macrocode}
+% Added \textsf{luatex} option
+% \changes{v2.9m}{2017/09/03}{Add luatex option}
+% \begin{macrocode}
+\DeclareOption{luatex}{%
+ \def\eq@drivernum{1}\def\eq@driver{luatex}%
+ \def\eq@drivercode{epdftex.def}\def\ef@driver{luatex}%
+}
% \end{macrocode}%
% Set the drivers for \texttt{dvipdfm}\IndexOpt{dvipdfm}. \texttt{dvipdfmx}\IndexOpt{dvipdfmx},
% and \texttt{xetex}\IndexOpt{xetex}.
@@ -205,6 +225,7 @@
\let\inputCalcOrderJS\relax
% \end{macrocode}
% \changes{v2.5o}{2012/06/18}{Added automatic test for \string\textsf{pdftex}.}
+% \changes{v2.9m}{2017/09/03}{Added a check for \string\textsf{lualtex}}
% \begin{macrocode}
\@ifpackageloaded{web}{%
\ExecuteOptions{\eq@driver@name}%
@@ -212,10 +233,11 @@
\@ifpackageloaded{exerquiz}{%
\ExecuteOptions{\eq@driver}%
}{%
+ \ifluatex\ExecuteOptions{luatex}\else
\ifpdf\ExecuteOptions{pdftex}\else
\ifxetex\ExecuteOptions{xetex}\else
\@ifundefined{l@tex@@@@driver}{\ExecuteOptions{dvips}}
- {\ExecuteOptions{dvipsone}}\fi\fi
+ {\ExecuteOptions{dvipsone}}\fi\fi\fi
}%
}
% \end{macrocode}
@@ -292,6 +314,7 @@
\@ifundefined{eq@tmpdima}{\newdimen\eq@tmpdima}{}
\@ifundefined{eq@tmpdimb}{\newdimen\eq@tmpdimb}{}
\newlength\ef@dimena
+\newtoks\ef@scratchtoks
% \end{macrocode}
% (2016/12/22) Added switches \cs{ifmakeXasPD} and \cs{ifmakePDasX}, if true, the form fields created
% by \app{xetex} (\app{pdflatex/Distiller})
@@ -312,12 +335,16 @@
% \DescribeMacro\previewColor sets the color of the preview bounding rectangle. The
% default is black. Used mostly by the \textsf{eqexam} package with the \texttt{online}
% option.
-% \begin{macrocode}
-\providecommand\previewColor{black}
-\def\ef@Bbox#1#2{%
- \hbox{\ifpreview\setlength\fboxrule{0.4pt}\setlength\fboxsep{0pt}%
+% \changes{v2.9o}{2017/10/10}{Removed \string\cs{previewColor} in favor of
+% \string\cs{ckboxColor}}
+% \begin{macrocode}
+\providecommand\ckboxColor[1]{\def\@rgi{#1}\ifx\@rgi\@empty
+ \let\ckbox@Color\relax\else
+ \def\ckbox@Color{\color{#1}}\fi}\let\ckbox@Color\relax
+\def\ef@Bbox#1#2{\hbox{\ifpreview
+ \setlength\fboxrule{0.4pt}\setlength\fboxsep{0pt}%
\@tempdima=#1\advance\@tempdima by-\fboxrule
- \@tempdimb=#2\advance\@tempdimb by-\fboxrule\color{\previewColor}%
+ \@tempdimb=#2\advance\@tempdimb by-\fboxrule \ckbox@Color
\fbox{\parbox[b][\@tempdimb][c]{\@tempdima}{\hfill\vfill}}\else
\parbox[b][#2][c]{#1}{\hfill\vfill}\fi}%
}
@@ -663,8 +690,9 @@
% \cs{mlhypertext}.
% \begin{macrocode}
\def\ef@searchmlLink#1\mlLink#2#3\@nil{\def\ef@argii{#2}%
- \ifx\ef@argii\ef@end\let\ef@mlLink=0\else
- \ifx\ef@argii\ef@true\let\ef@mlLink=1\else\let\ef@mlLink=0\fi\fi}
+ \ifx\ef@argii\ef@end\let\ef@mlLink\ef@Zero\else
+ \ifx\ef@argii\ef@true\let\ef@mlLink\ef@One\else
+ \let\ef@mlLink\ef@Zero\fi\fi}
% \end{macrocode}
% Search for \texttt{/GoToR}, if found, change the link color to |\@filecolor|
% \begin{macrocode}
@@ -732,7 +760,7 @@
% \cs{mlhypertext} from \texttt{aeb\_mlink}, if that package is loaded.
% \begin{macrocode}
\def\@eqmlLink#1{\def\eq@arg{#1}\ifx\eq@arg\ef@true
- \let\ef@mlLink=1\else\let\ef@mlLink=0\fi}
+ \let\ef@mlLink\ef@One\else\let\ef@mlLink\ef@Zero\fi}
% \end{macrocode}
% \DescribeMacro{\Lock} The Lock key is used with signature fields, currently, there is
% no nice user interface to this key. Typical entries are
@@ -1341,7 +1369,7 @@
\fi\fi}
\let\autoCenter\ef@y
% \end{macrocode}
-% \DescribeMacro{\inline} The if |\inline{y}|, then we attempt to
+% \DescribeMacro{\inline} If |\inline{y}|, then we attempt to
% get a better vertical positioning. Designed for inline form fields.
% \changes{v2.5h}{2012/11/17}{Introduce the \string\cs{inline} key designed for
% inline form fields.}
@@ -1381,24 +1409,367 @@
\edef\symbol@choice{\csname eq@#1\endcsname}\fi
}
% \end{macrocode}
+%\DescribeMacro{\mlfix} When set to \texttt{y}, contiguous boxes are combined. This is for
+%multi-line hyperlinks. Recognizable values are \texttt{y} and \texttt{n}. contiguous boxes
+%are combined by default. There are command versions of \cs{mlfix}, these are
+%\DescribeMacro{\mlfixOn} and \DescribeMacro{\mlfixOff}
+%\changes{v2.9.16}{2018/03/08}{Added \string\cs{mlfix} for multiline links}
+%\changes{v2.9.19}{2018/03/22}{Added \string\cs{relax} following width dimension
+% in \string\cs{@eqmlstrut}}
+% \begin{macrocode}
+\newif\iffixmlinks \fixmlinkstrue
+\def\mlfixOn{\fixmlinkstrue}
+\def\mlfixOff{\fixmlinksfalse}
+\def\@eqmlfix#1{\def\ef@arg{#1}\ifx\ef@arg\ef@y
+ \mlfixOn\else\ifx\ef@arg\ef@n
+ \mlfixOff\else\mlfixOn
+ \PackageWarning{eforms}{The value of '#1' is not a
+ supported value\MessageBreak for \string\mlfix.\MessageBreak
+ Using the default of 'y'}%
+ \fi\fi}
+\newbox\mlstrutbox
+% \end{macrocode}
+% \DescribeMacro{\mlstrut}\hskip-\marginparsep\texttt{\darg{\ameta{strut-amt}}}
+% (2018/03/22) \cs{mlstrut} is used to adjust the height of a multi-line link,
+% e.g., \verb!\mlstrut{\large\strut}!
+% \changes{v2.9.19}{2018/03/22}{Added \string\cs{mlstrut} used
+% to adjust the height of a multi-line link}
+% \begin{macrocode}
+\def\@eqmlstrut#1{\setbox\mlstrutbox\hbox{#1}%
+ \def\ml@strut{\vrule \@height\ht\mlstrutbox
+ \@depth\dp\mlstrutbox
+ \@width\z@\relax}}
+\def\ml@strut{\relax\ifmmode\copy\mlstrutbox\else
+ \unhbox\mlstrutbox\fi}
+\@eqmlstrut{\strut}
+% \end{macrocode}
+% \DescribeMacro{\mlcrackat}\hskip-\marginparsep\texttt{\darg{\ameta{num}}}
+% (2018/03/22) \cs{mlcrackat} is a link used to break a multi-line link across a page boundary;
+% specifying \verb~\mlcrackat{3}~ breaks the link after the 3rd syllable. The \pkg{aeb\_mlink}
+% package then creates two links consisting of the text up to and including the crack-at value and
+% the second link consisting of the rest of the hypertext link (or url) string.
+% \changes{v2.9.19}{2018/03/22}{Added \string\cs{mlcrackat}}
+% \begin{macrocode}
+\def\@eqmlcrackat#1{\def\eq@mlcrackat{#1}}
+\let\eq@mlcrackat\@empty
+% \end{macrocode}
+% \DescribeMacro{\mlhyph}\hskip-\marginparsep\texttt{\darg{}}
+% (2018/03/22) \cs{mlhyph} is used to add a hyphen when a multi-line link is cracked
+% using \cs{mlcrackat}. The default is that no hyphen is produced.
+% \changes{v2.9.19}{2018/03/22}{Added \string\cs{mlhyph}}
+% \begin{macrocode}
+\def\@eqmlhyph#1{\def\ef@arg{#1}\ifx\ef@arg\ef@y
+ \def\eq@mlhyph{-}\else\ifx\ef@arg\ef@n
+ \let\eq@mlhyph\@empty\else\let\eq@mlhyph\@empty
+ \PackageWarning{eforms}{The value of '#1' is not a
+ supported value\MessageBreak for \string\mlhyph.\MessageBreak
+ Using the default of 'n'}\fi\fi}
+\let\eq@mlhyph\@empty
+% \end{macrocode}
+% \DescribeMacro{\mlignore}\hskip-\marginparsep\texttt{\darg{}}
+% (2018/03/22) \cs{mlignore} is an internal option used when breaking apart
+% two multi-line links; not used with urls.
+% \changes{v2.9.19}{2018/03/22}{Added \string\cs{mlignore}}
+% \begin{macrocode}
+\def\@eqmlignore#1{\let\eq@mlignore\ef@YES}
+\let\eq@mlignore\ef@NO
+% \end{macrocode}
+% \begin{macrocode}
+\def\@eqmlcrackinsat#1{\def\eq@mlcrackinsat{#1}}
+\let\eq@mlcrackinsat\@empty
+% \end{macrocode}
% \DescribeMacro{\protect} A protect feature for protecting a key from begin changed
% by the user through the optional arguments.
% \begin{macrocode}
\def\eq@protect#1{\let#1\@empty}
% \end{macrocode}
-%
% \subsubsection{Support for Hex escapes in PDF names}
+% \changes{v2.9p}{2017/10/10}{rework the support for Hex escapes in PDF names}
% \begin{macrocode}
\begingroup\catcode`\#=12 \catcode`*=6
-\gdef\HEXNAME{efHex}
-\ifpdfmarkup\gdef\ef@Hx*1*2{\@nameuse{efHex*1*2}}\else
-\gdef\ef@Hx*1*2{#*1*2}\fi
+ \ifpdfmarkup
+ \gdef\ef@Hx*1*2{\@nameuse{efHex*1*2}}\else
+ \gdef\ef@Hx*1*2{\@nameuse{efHex*1*2}}\fi
\endgroup
+\def\efHxError{\PackageError{eforms}{The glyph is not supported}{}}
+\def\HGERROR{efHxError}
\ifpdfmarkup
-\def\HexGlyph#1#2{\global\@namedef{efHex#1}{#2}}
+ \def\HexGlyph#1#2{\def\arg@ii{#2}\ifx\arg@ii\HGERROR
+ \global\@namedef{efHex#1}{\csname#2\endcsname}\else
+ \global\@namedef{efHex#1}{\expandafter
+ \string\csname#2\endcsname}\fi}
+\else
+ \begingroup\catcode`\#=12 \catcode`*=6
+ \gdef\HexGlyph*1*2{\def\arg@ii{*2}\ifx\arg@ii\HGERROR
+ \global\@namedef{efHex*1}{\csname*2\endcsname}\else
+ \global\@namedef{efHex*1}{#*1}\fi}
+ \endgroup
+\fi
\def\ef@inputPDFHEX{\InputIfFileExists{pdfdochex.def}
- {\typeout{Inputtingpdfdochex.def}}{}}
-\expandafter\ef@inputPDFHEX\fi
+ {\PackageInfo{eforms}{Inputting pdfdochex.def}}{}}
+\AtEndOfPackage{\ef@inputPDFHEX}
+%</package>
+%<*hexoctcodes>
+% begin C0 Controls (U000.pdf) http://www.unicode.org/charts/PDF/
+\HexGlyph{00}{efHxError}%{000}
+\HexGlyph{01}{efHxError}%{001}
+\HexGlyph{02}{efHxError}%{002}
+\HexGlyph{03}{efHxError}%{003}
+\HexGlyph{04}{efHxError}%{004}
+\HexGlyph{05}{efHxError}%{005}
+\HexGlyph{06}{efHxError}%{006}
+\HexGlyph{07}{efHxError}%{006}
+\HexGlyph{08}{efHxError}%{008}
+\HexGlyph{09}{efHxError}%{009}
+\HexGlyph{0A}{efHxError}%{012}
+\HexGlyph{0B}{efHxError}%{013}
+\HexGlyph{0C}{efHxError}%{014}
+\HexGlyph{0D}{efHxError}%{015}
+\HexGlyph{0E}{efHxError}%{016}
+\HexGlyph{0F}{efHxError}%{017}
+\HexGlyph{10}{efHxError}%{020}
+\HexGlyph{11}{efHxError}%{021}
+\HexGlyph{12}{efHxError}%{022}
+\HexGlyph{13}{efHxError}%{023}
+\HexGlyph{14}{efHxError}%{024}
+\HexGlyph{15}{efHxError}%{025}
+\HexGlyph{16}{efHxError}%{026}
+\HexGlyph{17}{efHxError}%{027}
+% end C0 Controls (U000.pdf)
+\HexGlyph{18}{030}% U+02D8 BREVE
+\HexGlyph{19}{031}% U+02c7 CARON
+\HexGlyph{1A}{032}% U+02c6 MODIFIER LETTER CIRCUMFLEX ACCENT
+\HexGlyph{1B}{033}% U+02D9 DOT ABOVE
+\HexGlyph{1C}{034}% U+02DD DOUBLE ACUTE ACCENT
+\HexGlyph{1D}{035}% U+02DB OGONEK
+\HexGlyph{1E}{036}% U+02DA RING ABOVEZ
+\HexGlyph{1F}{037}% U+02DC SMALL TILDE
+\HexGlyph{20}{040}% U+0020 SPACE
+\HexGlyph{21}{041}% U+0021 EXCLAMATION MARK
+\HexGlyph{22}{042}% U+0022 QUOTATION MARK
+\HexGlyph{23}{043}% U+0022 NUMBER SIGN
+\HexGlyph{24}{044}% U+0023 DOLLAR SIGN
+\HexGlyph{25}{045}% U+002 PERCENT SIGN
+\HexGlyph{26}{046}% U+0026 AMPERSAND
+\HexGlyph{27}{047}% U+0027 APOSTROPHE
+\HexGlyph{28}{050}% U+0028 LEFT PARENTHESIS
+\HexGlyph{29}{051}% U+0029 RIGHT PAENTHESIS
+\HexGlyph{2A}{052}% U+002A ASTERISK
+\HexGlyph{2B}{053}% U+002B PLUS SIGN
+\HexGlyph{2C}{054}% U+002C COMMA
+\HexGlyph{2D}{055}% U+002D HYPHEN-MINUS
+\HexGlyph{2E}{056}% U+002E FULL STOP
+\HexGlyph{2F}{057}% U+002F SOLIDUS
+\HexGlyph{30}{060}% U+0030 ZERO
+\HexGlyph{31}{061}% U+0031 ONE
+\HexGlyph{32}{062}% U+0032 TWO
+\HexGlyph{33}{063}% U+0033 THREE
+\HexGlyph{34}{064}% U+0034 FOUR
+\HexGlyph{35}{065}% U+0035 FIVE
+\HexGlyph{36}{066}% U+0036 SIX
+\HexGlyph{37}{067}% U+0037 SEVEN
+\HexGlyph{38}{070}% U+0038 EIGHT
+\HexGlyph{39}{071}% U+0039 NINE
+\HexGlyph{3A}{072}% U+003A COLON
+\HexGlyph{3B}{073}% U+003B SEMICOLON
+\HexGlyph{3C}{074}% U+003C LESS-THAN SIGN
+\HexGlyph{3D}{075}% U+003D EQUALS SIGN
+\HexGlyph{3E}{076}% U+003E GREATER-THAN SIGN
+\HexGlyph{3F}{077}% U+003F QUESTION MARK
+\HexGlyph{40}{100}% U+0040 COMMERCIAL AT
+\HexGlyph{41}{101}% U+0041 CAPITAL LETTER A
+\HexGlyph{42}{102}% U+0042 B
+\HexGlyph{43}{103}% U+0043 C
+\HexGlyph{44}{104}% U+0044 D
+\HexGlyph{45}{105}% U+0045 E
+\HexGlyph{46}{106}% U+0046 F
+\HexGlyph{47}{107}% U+0047 G
+\HexGlyph{48}{110}% U+0048 H
+\HexGlyph{49}{111}% U+0049 I
+\HexGlyph{4A}{112}% U+004A J
+\HexGlyph{4B}{113}% U+004B K
+\HexGlyph{4C}{114}% U+004C L
+\HexGlyph{4D}{115}% U+004D M
+\HexGlyph{4E}{116}% U+004E N
+\HexGlyph{4F}{117}% U+004F O
+\HexGlyph{50}{120}% U+0050 P
+\HexGlyph{51}{121}% U+0051 Q
+\HexGlyph{52}{122}% U+0052 R
+\HexGlyph{53}{123}% U+0053 S
+\HexGlyph{54}{124}% U+0054 T
+\HexGlyph{55}{125}% U+0055 U
+\HexGlyph{56}{126}% U+0056 V
+\HexGlyph{57}{127}% U+0057 W
+\HexGlyph{58}{130}% U+0058 X
+\HexGlyph{59}{131}% U+0059 Y
+\HexGlyph{5A}{132}% U+005A Z
+\HexGlyph{5B}{133}% U+005B LEFT SQUARE BRACKET
+\HexGlyph{5C}{134}% U+005C REVERSE SOLIDUS (BACKSLASH)
+\HexGlyph{5D}{135}% U+005D RIGHT SQUARE BRACKET
+\HexGlyph{5E}{136}% U+005E CIRCUMFLEX ACCENT
+\HexGlyph{5F}{137}% U+005F LOW LINE
+\HexGlyph{60}{140}% U+0060 GRAVE ACCENT
+\HexGlyph{61}{141}% U+0061 LATIN SMALL LETTER a
+\HexGlyph{62}{142}% U+0062 b
+\HexGlyph{63}{143}% U+0063 c
+\HexGlyph{64}{144}% U+0064 d
+\HexGlyph{65}{145}% U+0065 e
+\HexGlyph{66}{146}% U+0066 f
+\HexGlyph{67}{147}% U+0067 g
+\HexGlyph{68}{150}% U+0068 h
+\HexGlyph{69}{151}% U+0069 i
+\HexGlyph{6A}{152}% U+006A j
+\HexGlyph{6B}{153}% U+006B k
+\HexGlyph{6C}{154}% U+006C l
+\HexGlyph{6D}{155}% U+006D m
+\HexGlyph{6E}{156}% U+006E n
+\HexGlyph{6F}{157}% U+006F o
+\HexGlyph{70}{160}% U+0070 p
+\HexGlyph{71}{161}% U+0071 q
+\HexGlyph{72}{162}% U+0072 r
+\HexGlyph{73}{163}% U+0073 s
+\HexGlyph{74}{164}% U+0074 t
+\HexGlyph{75}{165}% U+0075 u
+\HexGlyph{76}{166}% U+0076 v
+\HexGlyph{77}{167}% U+0077 w
+\HexGlyph{78}{170}% U+0078 x
+\HexGlyph{79}{171}% U+0079 y
+\HexGlyph{7A}{172}% U+007A z
+\HexGlyph{7B}{173}% U+007B LEFT CURLY BRACKET
+\HexGlyph{7C}{174}% U+007C VERTICAL LINE
+\HexGlyph{7D}{175}% U+007D RIGHT CURLY BRACKET
+\HexGlyph{7E}{176}% U+007E TILDE
+\HexGlyph{7F}{efHxError}% 177 UNDEFINED IN PDFDOCENC
+\HexGlyph{80}{200}% U+2022 BULLET
+\HexGlyph{81}{201}% U+2020 DAGGER
+\HexGlyph{82}{202}% U+2021 DOUBLE DAGGER
+\HexGlyph{83}{203}% U+2026 HORIZONTAL ELLIPSIS
+\HexGlyph{84}{204}% U+2014 EM DASH
+\HexGlyph{85}{205}% U+2013 EN DASH
+\HexGlyph{86}{206}% U+0192 LATIN SMALL LETTER F WITH HOOK
+\HexGlyph{87}{207}% U+2044 FRACTION SLASH
+\HexGlyph{88}{210}% U+2039 SINGLE LEFT-POINTING ANGLE QUOTE MARK
+\HexGlyph{89}{211}% U+203A SINGLE RIGHT-POINTING ANGLE QUOTE MARK
+\HexGlyph{8A}{212}% U+2212 MINUS-SIGN
+\HexGlyph{8B}{213}% U+2030 PER MILL SIGN
+\HexGlyph{8C}{214}% U+201E DOUBLE LOW-9 QUOTE MARK
+\HexGlyph{8D}{215}% U+201C LEFT DOUBLE QUOTE MARK
+\HexGlyph{8E}{216}% U+201C RIGHT DOUBLE QUOTE MARK
+\HexGlyph{8F}{217}% U+2018 LEFT SINGLE QUOTE MARK
+\HexGlyph{90}{220}% U+2019 RIGHT SINGLE QUOTE MARK
+\HexGlyph{91}{221}% U+201A SINGLE LOW-9 QUOTE MARK
+\HexGlyph{92}{222}% U+2122 TRADE MARK SIGN
+\HexGlyph{93}{223}% U+FB01 LATIN SMALL LIGATURE FI
+\HexGlyph{94}{224}% U+FB02 LATIN SMALL LIGATURE FL
+\HexGlyph{95}{225}% U+0141 LATIN CAPITAL LETTER L WITH STROKE
+\HexGlyph{96}{226}% U+0152 LATIN CAPITAL LIGATURE OE
+\HexGlyph{97}{227}% U+0160 LATIN CAPITAL LETTER S WITH CARON
+\HexGlyph{98}{230}% U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS
+\HexGlyph{99}{231}% U+017D LATIN CAPITAL LETTER Z WITH CARON
+\HexGlyph{9A}{232}% U+0131 LATIN SMALL LETTER DOTLESS I
+\HexGlyph{9B}{233}% U+0142 LATIN SMALL LETTER L WITH STROKE
+\HexGlyph{9C}{234}% U+0153 LATIN SMALL LIGATURE OE
+\HexGlyph{9D}{235}% U+0161 LATIN SMALL LETTER S WITH CARON
+\HexGlyph{9E}{236}% U+017E LATIN SMALL LETTER Z WITH CARON
+\HexGlyph{9F}{efHxError}% 237 UNDEF IN PDFDOCENC
+\HexGlyph{A0}{240}% U+20AC EURO SIGN
+\HexGlyph{A1}{241}% U+00A1 INVERTED EXCLAMATION MARK
+\HexGlyph{A2}{242}% U+00A2 CENT SIGN
+\HexGlyph{A3}{243}% U+00A3 POUND SIGN
+\HexGlyph{A4}{244}% U+00A4 CURRENCY SIGN
+\HexGlyph{A5}{245}% U+00A5 YEN SIGN
+\HexGlyph{A6}{246}% U+00A6 BROKEN BAR
+\HexGlyph{A7}{247}% U+00A7 SECTION SIGN
+\HexGlyph{A8}{250}% U+00A8 DIAERESIS
+\HexGlyph{A9}{251}% U+00A9 COPYRIGHT SIGN
+\HexGlyph{AA}{252}% U+00AA FEMININE ORDINAL INDICATOR
+\HexGlyph{AB}{253}% U+00AB LEFT-POINTING DOUBLE ANGLE QUOTE MARK
+\HexGlyph{AC}{254}% U+00AC NOT SIGN
+\HexGlyph{AD}{efHxError}% 255 UNDEFINED IN PDFDOCENC
+\HexGlyph{AE}{256}% U+00AE REGISTERED SIGN
+\HexGlyph{AF}{257}% U+00AF MACRON
+\HexGlyph{B0}{260}% U+00B0 DEGREE SIGN
+\HexGlyph{B1}{261}% U+00B1 PLUS-MINUS SIGN
+\HexGlyph{B2}{262}% U+00B2 SUPERSCRIPT 2
+\HexGlyph{B3}{263}% U+00B3 SUPERSCRIPT 3
+\HexGlyph{B4}{264}% U+00B4 ACUTE ACCENT
+\HexGlyph{B5}{265}% U+00B5 MICRO SIGN
+\HexGlyph{B6}{266}% U+00B6 PILCROW SIGN (PARAGRAPH SIGN)
+\HexGlyph{B7}{267}% U+00B7 MIDDLE DOT
+\HexGlyph{B8}{270}% U+00B8 CEDILLA
+\HexGlyph{B9}{271}% U+00B9 SUPERSCRIPT ONE
+\HexGlyph{BA}{272}% U+00BA MASCULINE ORDINAL INDICATOR
+\HexGlyph{BB}{273}% U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTE MARK
+\HexGlyph{BC}{274}% U+00BC VULGAR FRACTION ONE QUARTER
+\HexGlyph{BD}{275}% U+00BD VULGAR FRACTION ONE HALF
+\HexGlyph{BE}{276}% U+00BE VULGAR FRACTION THREE QUARTERS
+\HexGlyph{BF}{277}% U+00BF INVERTED QUESTION MARK
+\HexGlyph{C0}{300}% U+00C0 LATIN CAPITAL LETTER A WITH GRAVE
+\HexGlyph{C1}{301}% U+00C1 LATIN CAPITAL LETTER A WITH ACUTE
+\HexGlyph{C2}{302}% U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\HexGlyph{C3}{303}% U+00C3 LATIN CAPITAL LETTER A WITH TILDE
+\HexGlyph{C4}{304}% U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS
+\HexGlyph{C5}{305}% U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE
+\HexGlyph{C6}{306}% U+00C6 LATIN CAPITAL LETTER AE
+\HexGlyph{C7}{307}% U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA
+\HexGlyph{C8}{310}% U+00C8 LATIN CAPITAL LETTER E WITH GRAVE
+\HexGlyph{C9}{311}% U+00C9 LATIN CAPITAL LETTER E WITH ACUTE
+\HexGlyph{CA}{312}% U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\HexGlyph{CB}{313}% U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS
+\HexGlyph{CC}{314}% U+00CC LATIN CAPITAL LETTER I WITH GRAVE
+\HexGlyph{CD}{315}% U+00CD LATIN CAPITAL LETTER I WITH ACUTE
+\HexGlyph{CE}{316}% U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\HexGlyph{CF}{317}% U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS
+\HexGlyph{D0}{320}% U+00D0 LATIN CAPITAL LETTER ETH
+\HexGlyph{D1}{321}% U+00D1 LATIN CAPITAL LETTER D WITH TILDE
+\HexGlyph{D2}{322}% U+00D2 LATIN CAPITAL LETTER O WITH GRAVE
+\HexGlyph{D3}{323}% U+00D3 LATIN CAPITAL LETTER O WITH ACUTE
+\HexGlyph{D4}{324}% U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\HexGlyph{D5}{325}% U+00D5 LATIN CAPITAL LETTER O WITH TILDE
+\HexGlyph{D6}{326}% U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS
+\HexGlyph{D7}{327}% U+00D7 MULTIPLICATION SIGN
+\HexGlyph{D8}{330}% U+00D8 LATIN CAPITAL LETTER O WITH STROKE
+\HexGlyph{D9}{331}% U+00D9 LATIN CAPITAL LETTER U WITH GRAVE
+\HexGlyph{DA}{332}% U+00DA LATIN CAPITAL LETTER U WITH ACUTE
+\HexGlyph{DB}{333}% U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\HexGlyph{DC}{334}% U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS
+\HexGlyph{DD}{335}% U+00DD LATIN CAPITAL LETTER Y WITH ACUTE
+\HexGlyph{DE}{336}% U+00DE LATIN CAPITAL LETTER THORN
+\HexGlyph{DF}{337}% U+00DF LATIN CAPITAL LETTER SHARP S (Eszett)
+\HexGlyph{E0}{340}% U+00E0 LATIN SMALL LETTER A WITH GRAVE
+\HexGlyph{E1}{341}% U+00E1 LATIN SMALL LETTER A WITH ACUTE
+\HexGlyph{E2}{342}% U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX
+\HexGlyph{E3}{343}% U+00E3 LATIN SMALL LETTER A WITH TILDE
+\HexGlyph{E4}{344}% U+00E4 LATIN SMALL LETTER A WITH DIAERESIS
+\HexGlyph{E5}{345}% U+00E5 LATIN SMALL LETTER A WITH RING ABOVE
+\HexGlyph{E6}{346}% U+00E6 LATIN SMALL LETTER AE
+\HexGlyph{E7}{347}% U+00E7 LATIN SMALL LETTER C WITH CEDILLA
+\HexGlyph{E8}{350}% U+00E8 LATIN SMALL LETTER E WITH GRAVE
+\HexGlyph{E9}{351}% U+00E9 LATIN SMALL LETTER E WITH ACUTE
+\HexGlyph{EA}{352}% U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX
+\HexGlyph{EB}{353}% U+00EB LATIN SMALL LETTER E WITH DIAERESIS
+\HexGlyph{EC}{354}% U+00EC LATIN SMALL LETTER I WITH GRAVE
+\HexGlyph{ED}{355}% U+00ED LATIN SMALL LETTER I WITH ACUTE
+\HexGlyph{EE}{356}% U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX
+\HexGlyph{EF}{357}% U+00EF LATIN SMALL LETTER I WITH DIAERESIS
+\HexGlyph{F0}{360}% U+00F0 LATIN SMALL LETTER ETH
+\HexGlyph{F1}{361}% U+00F1 LATIN SMALL LETTER N WITH TILDE
+\HexGlyph{F2}{362}% U+00F2 LATIN SMALL LETTER O WITH GRAVE
+\HexGlyph{F3}{363}% U+00F3 LATIN SMALL LETTER O WITH ACUTE
+\HexGlyph{F4}{364}% U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX
+\HexGlyph{F5}{365}% U+00F5 LATIN SMALL LETTER O WITH DIAERESIS
+\HexGlyph{F6}{366}% U+00F6 LATIN SMALL LETTER C WITH ETH
+\HexGlyph{F7}{367}% U+00F7 DIVISION SIGN
+\HexGlyph{F8}{270}% U+00F8 LATIN SMALL LETTER O WITH STROKE
+\HexGlyph{F9}{271}% U+00F9 LATIN SMALL LETTER U WITH GRAVE
+\HexGlyph{FA}{272}% U+00FA LATIN SMALL LETTER U WITH ACUTE
+\HexGlyph{FB}{273}% U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX
+\HexGlyph{FC}{374}% U+00FC LATIN SMALL LETTER U WITH DIAERESIS
+\HexGlyph{FD}{375}% U+00FD LATIN SMALL LETTER Y WITH ACUTE
+\HexGlyph{FE}{376}% U+00FE LATIN SMALL LETTER C THORN
+\HexGlyph{FF}{377}% U+00FF LATIN SMALL LETTER Y WITH DIAERESIS
+%</hexoctcodes>
+%<*package>
% \end{macrocode}
% \subsubsection{Parsing PDF Color}
%
@@ -1979,15 +2350,19 @@
% (ol) and \cs{vcgBdry} positions the field so the boundary lines are
% contiguous (cg).
% \changes{v2.9h}{2017/01/15}{Added \string\cs{volBdry} and\string\cs{vcgBdry}}
+% \changes{v2.9n}{2017/09/04}{Added \string\cs{efSupprIndent}}.
% \begin{macrocode}
+\newcommand{\efSupprIndent}{\ef@scratchtoks=\expandafter{\the\everypar}%
+ \everypar{{\setbox\z@\lastbox}\clubpenalty\@M
+ \everypar=\expandafter{\the\ef@scratchtoks}}}
\newcommand\volBdry{\bgroup\parskip0pt\relax\@@par\nointerlineskip
- \olBdry\noindent\egroup}
+ \olBdry\egroup\efSupprIndent}
\newcommand\vcgBdry{\@ifstar{\edef\ef@offset{\the\parskip}\vcgBdry@i}
{\def\ef@offset{0pt}\vcgBdry@i}}
\newcommand\vcgBdry@i[1][0bp]{\bgroup
\setlength{\ef@dimena}{#1-\ef@offset}\parskip0pt\relax
- \par\nointerlineskip\cgBdry[\ef@dimena]\noindent
- \egroup\ignorespaces}
+ \par\nointerlineskip\cgBdry[\ef@dimena]%
+ \egroup\ignorespaces\efSupprIndent}
% \end{macrocode}
%
% \subsection{Choice Fields}\label{choice}
@@ -2577,7 +2952,7 @@
\eq@rawPDF % everything else
}
% \end{macrocode}
-% The low-level link command and is the building block of all the
+% \cs{set@@Link} is the low-level link command and is the building block of all the
% other, more user-friendly link commands. Takes seven parameters:
%\begin{enumerate}
%\item[\texttt{\#1}:] Optional arguments to modify the appearance and actions of the link.
@@ -2623,13 +2998,18 @@
\AtBeginDocument{\setDef@ultLinkColor}
% \end{macrocode}
% \begin{macro}{\setLink}
-% \begin{macro}{\mlsetLink}
+% \cs{setLink} is the basic high-level link command, it is used to surround text
+% with a link annotation.
% \begin{macro}{\setLinkText}
-% This is the basic high-level link command, it is used to surround text.
+% \cs{setLinkText} is a synonym for \cs{setLink}.
+% \begin{macro}{\mlhypertext}
+% A command defined in the \pkg{aeb\_mlink} package.
+% \begin{macro}{\mlsetLink}
+% \cs{mlsetLink} expands to \cs{mlhypertext}
%\begin{verbatim}
-% \setLinkText[\A{\JS{this.pageNum=6;}}\Color{1 0 0}]{Go There!}
+% \setLink[\A{\JS{this.pageNum=6;}}\Color{1 0 0}]{Go There!}
%\end{verbatim}
-% \paragraph{Link Parameters.} This link takes two parameters, one of which
+% \paragraph{Link Parameters.} These high-level links takes two parameters, one of which
% is optional.
%\begin{enumerate}
%\item[\texttt{[\#1]}:] Optional key-value pairs to change the appearance or action
@@ -2647,17 +3027,28 @@
\newcommand\setLink{\begingroup
\ef@sanitize@toks\ef@setlinktext
}
-\newcommand{\mlsetLink}{\mlhypertext}
-\let\setLinkText\setLink
-\newcommand{\ef@setlinktext}[1][]{%
% \end{macrocode}
% \changes{v2.5b}{2009/12/24}{added path to \string\cs{mlhypertext}}
% Added a path to \cs{mlhypertext} of the \textsf{aeb\_mlink} package. When the
% user specifies \verb!\mlLink{true}! in the option list, we branch off to
-% \cs{mlhypertext}.
+% \cs{mlhypertext}. For example, if we say,
+%\begin{verbatim}
+%\setLink[\mlLink{true}\A{\JS{app.alert("Hello World!");}}]{Hello World!}
+%\end{verbatim}
+% then we branch off to \cs{mlhypertext}. The above, then, is equivalent to,
+%\begin{verbatim}
+%\mlhypertext[\A{\JS{app.alert("Hello World!");}}]{Hello World!}
+%\end{verbatim}
+%If you've created a link using \cs{setLink} and the text does not wrap around to the next
+%link, simply insert \verb!\mlLink{true}! as an option to declare this link is a multi-line
+%link. Of course, you can also change the name from \cs{setLink} to \cs{mlsetLink} (or to \cs{mlhypertext}).
+%
+%In the next line, we \cs{let} \cs{setLinkText} to \cs{setLink}
% \begin{macrocode}
+\let\setLinkText\setLink
+\newcommand{\ef@setlinktext}[1][]{%
\endgroup\ef@searchmlLink#1\mlLink\end\@nil
- \ifx\ef@mlLink0\def\ef@next{\set@LinkText[#1]}\else
+ \ifx\ef@mlLink\ef@Zero\def\ef@next{\set@LinkText[#1]}\else
\def\ef@next{\mlhypertext[#1]}\fi\ef@next
}
\newcommand\set@LinkText[2][]{%
@@ -2688,6 +3079,16 @@
% \begin{macrocode}
\def\ef@postProcLinkProps{}
% \end{macrocode}
+% \cs{mlhypertext} is not defined unless \pkg{aeb\_mlink} is loaded; however,
+% we define \cs{mlsetLink} to expand to \cs{mlhypertext}.
+% \begin{macrocode}
+\newcommand{\mlsetLink}{\mlhypertext}
+\newcommand{\mlhypertext}[2][]{\@ifundefined{mlhypertext@i}
+ {\PackageWarning{eforms}{The \string\mlhypertext\space command
+ does nothing unless\MessageBreak the aeb_mlink package is loaded}}{}%
+ #2}
+% \end{macrocode}
+% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
@@ -3043,7 +3444,8 @@
\define@key{eforms}{default}{\@eqDV{#1}}
\define@key{eforms}{defaultstyle}{\@eqDS{#1}}
% \end{macrocode}
-% The \texttt{value}\IndexKey{value}\IndexKey{richvalue}\IndexKey{apprD} of the field (text, list, combobox). Example: \texttt{value=AcroTeX}.
+% The \texttt{value}\IndexKey{value}\IndexKey{richvalue}\IndexKey{apprD} of the field
+% (text, list, combobox). Example: \texttt{value=AcroTeX}.
% \begin{macrocode}
\define@key{eforms}{value}{\@eqV{#1}}
\define@key{eforms}{richvalue}{\@eqRV{#1}}
@@ -3202,6 +3604,19 @@
\ifcase\nr\relax\@eqinline{y}\or
\@eqinline{n}\fi
}{}
+\define@choicekey{eforms}{mlfix}[\val\nr]{yes,no}
+{%
+ \ifcase\nr\relax\@eqmlfix{y}\or
+ \@eqmlfix{n}\fi
+}{}
+\define@key{eforms}{mlstrut}[\strut]{\@eqmlstrut{#1}}
+\define@key{eforms}{mlcrackat}[]{\@eqmlcrackat{#1}}
+\define@key{eforms}{mlcrackinat}[]{\@eqmlcrackinsat{#1}}
+\define@choicekey{eforms}{mlhyph}[\val\nr]{yes,no}
+{%
+ \ifcase\nr\relax\@eqmlhyph{y}\or
+ \@eqmlhyph{n}\fi
+}{}
% \end{macrocode}
% Set presets\IndexKey{presets} from inside a \cs{ui} argument. For example,
%\begin{verbatim}
@@ -3705,17 +4120,29 @@
/ANN pdfmark}%
\to@insertStrucTabOrder{Link}\endgroup
}
+% \end{macrocode}
+% (2018/03/22) Defined \cs{pboxRect} to support
+% \cs{setLinkPbox}.
+% \changes{v2.9.19}{2018/03/22}{Defined \string\cs{pboxRect} to support
+% \string\cs{setLinkPbox}}
+% \begin{macrocode}
+\def\pboxRect{/Rect [\par@@Rect]}
+% \end{macrocode}
+% Added \cs{mllnkcontainer} to support textsf{aeb\_mlink} package.
+% \changes{v2.9.17}{2018/03/14}{Added \string\cs{mllnkcontainer}.}
+% \begin{macrocode}
+\def\mllnkcontainer#1{#1}
\def\setLinkPbox@driver
{%
\ifx\eq@A\@empty\else\expandafter\convertAToAction\eq@A\@nil\fi
\@eqBS{}%
- \literalps@out{%
- [ \eq@objdef/Rect [\par@@Rect]
+ \literalps@out{\mllnkcontainer{%
+ [ \eq@objdef\pboxRect
\eq@Border
\eq@QuadPoints % QuadPoints
\common@LinkCode
/Subtype /Link
- /ANN pdfmark}%
+ /ANN pdfmark}}%
\to@insertStrucTabOrder{Link}\endgroup
}
% \end{macrocode}
diff --git a/texmf-dist/source/latex/acrotex/eforms.ins b/texmf-dist/source/latex/acrotex/eforms.ins
index b474df85..182345c3 100644
--- a/texmf-dist/source/latex/acrotex/eforms.ins
+++ b/texmf-dist/source/latex/acrotex/eforms.ins
@@ -54,6 +54,7 @@
\file{edvipdfm.def}{\from{eforms.dtx}{copyright,edvipdfm}}
\file{uieforms.def}{\from{eforms.dtx}{copyright,userinterface}}
\file{setcorder.def}{\from{eforms.dtx}{copyright,setcorder}}
+ \file{pdfdochex.def}{\from{eforms.dtx}{copyright,hexoctcodes}}
}
\Msg{***************************************************************}
diff --git a/texmf-dist/source/latex/acrotex/exerquiz.dtx b/texmf-dist/source/latex/acrotex/exerquiz.dtx
index 0cae45ef..e9412205 100644
--- a/texmf-dist/source/latex/acrotex/exerquiz.dtx
+++ b/texmf-dist/source/latex/acrotex/exerquiz.dtx
@@ -4,7 +4,7 @@
%<*copyright>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Exerquiz.sty package, %%
-%% Copyright (C) 1999-2017 D. P. Story %%
+%% Copyright (C) 1999-2018 D. P. Story %%
%% dpstory@uakron.edu %%
%% %%
%% This program can redistributed and/or modified under %%
@@ -22,7 +22,7 @@
%<randomize>\ProvidesFile{aebrandom.def}
%<sumrytbls>\ProvidesFile{aebsumrytbls.def}
%<template>\ProvidesFile{template.def}
-%<package|driver|aebjs|eqexam|randomize|sumrytbls|template> [2017/03/16 v7.8g %
+%<package|driver|aebjs|eqexam|randomize|sumrytbls|template> [2018/03/21 v8.2.2 %
%<package> Exerquiz: Exercises and Quizzes for LaTeX/PDF package (dps)]
%<driver> Exerquiz documentation driver file (dps)]
%<aebjs> Exerquiz document level JavaScript (dps)]
@@ -57,6 +57,7 @@
\PackageInfo{exerquiz}{aebdocfmt.def cannot be found}}
\begin{document}
\let\env\texttt\let\pkg\textsf
+ \let\app\textsf
\GetFileInfo{exerquiz.sty}
\title{Exerquiz: Exercises and Quizzes for \LaTeX/PDF}
\author{D. P. Story\\
@@ -81,10 +82,12 @@
% \MakeShortVerb{|}
% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{exerquiz}{Inputting aebdonotindex.def}}
% {\PackageInfo{exerquiz}{aebdonotindex.def cannot be found}}
-%
% \begin{macrocode}
-%<*package>
% \end{macrocode}
+% (v8.0 dated 2017/08/08) This version introduces multi-letter variables and what I'll term `alternate appearances'.
+% This is a major addition, changes are marked by \texttt{dps17} for future reference in case something goes wrong.
+% \changes{v8.0}{2017/08/08}{Introduce multi-letter variables and alternate appearances. Changes
+% made are marked by `\texttt{dps17}' throughout the DTX.}
% \changes{v7.7k}{2016/04/18}{Minor bug fixes, improved driver recognition}
% \changes{v7.7j}{2016/04/05}{Change in eforms to 2016/04/05 v2.8f}
%
@@ -93,12 +96,16 @@
% Introduce a number of useful options for \textsl{exerquiz}.
% \subsection{Options for paper, solutions, JavaScript and preview}
% \begin{macrocode}
+% Begin package segment
+%<*package>
\usepackage{keyval}
% \end{macrocode}
%\changes{v6.4t}{2012/06/18}{Added ifpdf as a required package}
+%\changes{v8.1a}{2017/09/03}{Added check for luatex}
% \begin{macrocode}
\RequirePackage{ifpdf}[2006/02/20]
\RequirePackage{ifxetex}[2006/08/21]
+\RequirePackage{ifluatex}
\@ifundefined{exqtable}{\def\exqtable{table}}{}
\IfFileExists{xcolor.sty}{%
\def\eq@ColorPackage{xcolor}%
@@ -144,12 +151,11 @@
% No solutions for quizzes (shortquiz and quiz environments).
% \begin{macrocode}
\DeclareOption{noquizsolutions}{\eq@noquizsolutionstrue\eq@nolinktrue}
-% \end{macrocode}
-% \IndexOpt{online}
-% An \texttt{online} options.
-% \begin{macrocode}
%</package>
%<*package|eqexam>
+% \end{macrocode}
+% An \IndexOpt{online}\texttt{online} options.
+% \begin{macrocode}
\let\eq@YES=y \let\eq@NO=n
\let\eq@One=1 \let\eq@Zero=0
\def\eq@r{r}\let\eq@f=f \let\eq@l=l
@@ -177,7 +183,11 @@
% \begin{macrocode}
\DeclareOption{solutionsonly}{\solutionsonlytrue\answerkeytrue
\therearesolutionstrue\AtEndOfPackage{\let\exerSolnsHeadnToc\relax}}
+% \end{macrocode}
+% \changes{v8.1k}{2018/02/04}{Added \string\cs{ifanswerkey} switch}
+% \begin{macrocode}
\newif\ifsolutionsonly\solutionsonlyfalse
+\@ifundefined{ifanswerkey}{\newif\ifanswerkey\answerkeyfalse}{}
% \end{macrocode}
% \IndexOpt{contsolns}
% This option requires both \textsf{web} and \textsf{exerquiz}. The package
@@ -212,8 +222,8 @@
% \IndexOpt{vspacewithsolns}
% This is for the \texttt{vspacewithsolns} option designed for
% \textsf{eqexam}, but can be used in \textsf{exerquiz}. The switch
-% \cs{ifvspacewithsolns} is defined in \textsf{eqexam}, and we olnly
-% define it here is \textsf{eqexam} is not loaded.
+% \cs{ifvspacewithsolns} is defined in \textsf{eqexam}, and we only
+% define it here if \textsf{eqexam} is not loaded.
% \changes{v6.3x}{2011/04/05}{Added \texttt{vspacewithsolns}}
% \begin{macrocode}
\@ifundefined{ifvspacewithsolns}{%
@@ -221,6 +231,11 @@
\newif\ifvspacewithsolns\vspacewithsolnsfalse
}{}
% \end{macrocode}
+% \changes{v8.1m}{2018/02/09}{\string\cs{ifdisplayworkarea} conditionally defined}
+% \begin{macrocode}
+\@ifundefined{ifdisplayworkarea}{\newif\ifdisplayworkarea
+ \displayworkareafalse}{}
+% \end{macrocode}
% \IndexOpt{nodljs}
% An option for excluding all DLJS from the document. Useful with the
% \texttt{forpaper} option, or a document destined to be printed. Pass
@@ -304,6 +319,15 @@
\PassOptionsToPackage{pdftex}{eforms}
}
% \end{macrocode}
+% Added a \texttt{luatex} option
+%\changes{v8.1a}{2017/09/03}{Added a \string\texttt{luatex} option}
+% \begin{macrocode}
+\DeclareOption{luatex}{%
+ \def\eq@drivernum{1}\def\eq@driver{luatex}%
+ \PassOptionsToPackage{luatex}{\eq@ColorPackage}
+ \PassOptionsToPackage{luatex}{eforms}
+}
+% \end{macrocode}
% \IndexOpt{dvipdfm}\IndexOpt{dvipdfmx}\IndexOpt{xetex}
% Set the driver dependent code for the \texttt{quiz} and \texttt{quiz}
% environments.
@@ -543,10 +567,20 @@
%</package>
%<*package|eqexam>
\newif\ifeq@noforms \eq@noformsfalse
-\newif\ifeq@noquizsolutions \eq@noquizsolutionsfalse % dps new
-\newif\ifnocorrections \nocorrectionsfalse
+\newif\ifeq@noquizsolutions \eq@noquizsolutionsfalse
% changed \ifeq@nocorrections to \ifnocorrections
%\newif\ifeq@nocorrections \eq@nocorrectionsfalse
+\newif\ifnocorrections \nocorrectionsfalse
+% \end{macrocode}
+% Added \string\cs{ifeqe@flextended} to support \string\pkg{eqexam}
+% \changes{v8.1h}{2018/01/03}{Added \string\cs{ifeqe@flextended} to support \string\pkg{eqexam}}
+% \changes{v8.1o}{2018/02/12}{Added \string\cs{ifcont@nnot} to support \string\pkg{eqexam}}
+% \begin{macrocode}
+\@ifundefined{ifeqe@flextended}{\newif\ifeqe@flextended
+ \eqe@flextendedfalse}{}
+\@ifundefined{ifcont@nnot}{\newif\ifcont@nnot \cont@nnotfalse}{}
+\@ifundefined{if@eqalignfilllinestoleft}{\newif\if@eqalignfilllinestoleft
+ \@eqalignfilllinestoleftfalse}{}
% \end{macrocode}
% (4/28/11) A switch to control whether the declared vertical space
% for the \texttt{solution} environment will be preserved during the \texttt{answerkey}
@@ -583,7 +617,26 @@
% \begin{macrocode}
\def\SolutionsAfter{\eq@solutionsaftertrue\eq@nolinktrue}
\newif\ifcqSA\cqSAfalse
-\def\SolutionsAtEnd{\eq@solutionsafterfalse\eq@nolinkfalse}
+% \end{macrocode}
+% Modified \cs{SolutionsAtEnd} (2018/02/02) to include \cs{eq@nosolutionsfalse}
+% and \cs{eq@proofingfalse}.
+% \changes{v8.1j}{2018/02/02}{Added \string\cs{eq@nosolutionsfalse}
+% and \string\cs{eq@proofingfalse} to the
+% definition of \string\cs{SolutionsAtEnd}}
+% \begin{macrocode}
+%\def\SolutionsAtEnd{\eq@solutionsafterfalse\eq@nolinkfalse}
+%\def\SolutionsAtEnd{\eq@solutionsafterfalse\eq@nolinkfalse
+% \eq@nosolutionsfalse\eq@proofingfalse\answerkeyfalse}
+\def\SolutionsAtEnd{\eq@solutionsafterfalse\eq@nolinkfalse
+% \end{macrocode}
+% Now, if |\ifvspacewithsolns| is true, we set |\eq@nosolutionsfalse| so solutions appear
+% at the end of the file; otherwise, we set |\eq@nosolutionstrue|.
+% \changes{v8.1k}{2018/02/04}{Added a conditional within \string\cs{SolutionsAtEnd}}
+% \changes{v8.1m}{2018/02/09}{Include \string\cs{displayworkareatrue} in definition
+% of \string\cs{SolutionsAtEnd}}
+% \begin{macrocode}
+ \displayworkareatrue\ifvspacewithsolns\eq@nosolutionsfalse\else
+ \eq@nosolutionstrue\fi\eq@proofingfalse\answerkeyfalse}
\def\NoSpaceToWork{\let\eq@insertverticalspace\eq@NO}
\def\SpaceToWork{\let\eq@insertverticalspace\eq@YES}
\SpaceToWork
@@ -625,17 +678,11 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \begin{macro}{\saveRandomSeed}
-% \begin{macro}{\inputRandomSeed}
-% These two commands are used when the \texttt{allowrandomize} option is in effect,
-% Until then, they do nothing. See the definition in the section \autoref{randomize}.
+% These\DescribeMacro{\saveRandomSeed}\DescribeMacro{\inputRandomSeed} two commands are used when the \texttt{allowrandomize} option is in effect,
+% Until then, they do nothing. See the definition in \autoref{randomize}.
% \begin{macrocode}
\let\saveRandomSeed\relax
\let\inputRandomSeed\relax
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \begin{macrocode}
%</package|eqexam>
%<*package>
% \end{macrocode}
@@ -685,15 +732,17 @@
% \end{macrocode}
% If web is already loaded, we use its driver.
% \changes{v6.4t}{2012/06/18}{Testing for pdflatex and xetex}
+% \changes{v8.1a}{2017/09/03}{Testing for luatex}
% \begin{macrocode}
\@ifpackageloaded{web}{%
\ExecuteOptions{\eq@driver@name}%
}{%
+ \ifluatex\ExecuteOptions{luatex}\else
\ifpdf\ExecuteOptions{pdftex}\else
\ifxetex\ExecuteOptions{xetex}\else
\InputIfFileExists{web.cfg}{}
{\@ifundefined{l@tex@@@@driver}{\ExecuteOptions{dvips}}
- {\ExecuteOptions{dvipsone}}}\fi\fi
+ {\ExecuteOptions{dvipsone}}}\fi\fi\fi
}
% \end{macrocode}
% \begin{macrocode}
@@ -705,8 +754,14 @@
% \begin{macrocode}
\RequirePackage{array}
\RequirePackage{\eq@ColorPackage}
-\RequirePackage{verbatim}
+% \end{macrocode}
+% Changed order of loading, comment package first, then verbatim package; prior to the change, anomalous
+% errors, which were traced to these two packages.
+% \changes{v7.8k}{2017/07/25}{Changed order of loading, comment package first, then verbatim package}
+% \begin{macrocode}
\RequirePackage{comment}
+\RequirePackage{verbatim}
+%\RequirePackage{comment}
\RequirePackage{hyperref}
\RequirePackage{amssymb}% used for return symbols
\RequirePackage{eforms}[2012/06/20]
@@ -722,6 +777,18 @@
\MessageBreak in the option list of the exerquiz package.}
}{}
% \end{macrocode}
+% \begin{macrocode}
+\edef\eq@restoreCats{% dps17
+ \catcode`\noexpand\"=\the\catcode`\"\relax
+ \catcode`\noexpand\'=\the\catcode`\'\relax
+ \catcode`\noexpand\,=\the\catcode`\,\relax
+ \catcode`\noexpand\(=\the\catcode`\(\relax
+ \catcode`\noexpand\!=\the\catcode`\!\relax
+ \catcode`\noexpand\_=\the\catcode`\_\relax
+}
+\@makeother\"\@makeother\'\@makeother\,%
+\@makeother\(\@makeother\!\@makeother\_
+% \end{macrocode}
% Determine whether we have solutions at end.
% \begin{macrocode}
\@ifundefined{ifsolutionsAtEnd}
@@ -844,16 +911,21 @@
\def\exSolafterDefault{#1}\resetSolnAfterToDefault}
\exsolafterDefault{\textit{Solution}:}
\newcommand{\renameSolnAfterTo}[1]{\def\exsolafter{#1}}
-\def\recoverDisplayBelow{\vskip\belowdisplayskip}
-\newcommand{\adjDisplayBelow}{\vskip-\lastskip\vskip-\baselineskip}
-% \ifsolutionsAtEnd\recoverDisplayBelow\fi}
-\newcommand{\adjDisplayBelowPlus}{\adjDisplayBelow\recoverDisplayBelow}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
+% \DescribeMacro{\adjDisplayBelow} is useful when expanded beneath distplays that
+% have no follow-up text below them. These seems to me, in certain situations, unnecessary
+% space is created. The \cs{adjDisplayBelow} attempts to remedy this. The
+% \DescribeMacro{\adjDisplayBelowPlus}\cs{adjDisplayBelowPlus} is the same as
+% \cs{adjDisplayBelow}, but adds \cs{recoverDisplayBelow}. The command \cs{adjDisplayBelow}
+% has a |vskip-\baselineskip|, if this is too much, use \cs{adjDisplayBelowPlus}.
% \begin{macrocode}
+\newcommand{\adjDisplayBelow}{\vskip-\lastskip\vskip-\baselineskip}
+\newcommand{\adjDisplayBelowPlus}{\adjDisplayBelow\recoverDisplayBelow}
+\def\recoverDisplayBelow{\vskip\belowdisplayskip}
%</package|eqexam>
%<template>
%<template>% Solution label for solutionafter option for exercise
@@ -1175,18 +1247,17 @@
\typeout{Check: `#1' is not an acceptable option, inserting
default, `check'.}
%</template>
+%<*package>
% \end{macrocode}
-%
% Announce driver option
% \begin{macrocode}
-%<*package>
-\typeout{^^Jexerquiz: * Using \eq@driver\space option *^^J}
+\PackageInfo{exerquiz}{* Using \eq@driver\space option *}
+%</package>
+%<*package|eqexam>
% \end{macrocode}
% \subsection{Handles, counters and such}
% Handles to write solutions to quizzes and exercises to a file.
% \begin{macrocode}
-%</package>
-%<*package|eqexam>
\ifsolutionsonly
\InputIfFileExists{\jobname_xdefs.cut}{%
\typeout{^^JExerquiz|Eqexam: Reading \jobname_xdefs.cut^^J}}
@@ -1237,8 +1308,6 @@
% answers. We declare this length to be 0pt. The \textsf{eqexam} resets this value.
% \begin{macrocode}
\newlength\eqemargin \eqemargin=0pt
-% \end{macrocode}
-% \begin{macrocode}
%</package>
%<*package|eqexam>
% \end{macrocode}
@@ -1260,8 +1329,6 @@
\newcounter{eqquestionnoii}
\newcounter{eqquestionnoiii}
\newcount\@eqquestiondepth \@eqquestiondepth=0
-% \end{macrocode}
-% \begin{macrocode}
%</package|eqexam>
%<*package>
\newcounter{grpquestionno}
@@ -1363,19 +1430,17 @@
%\newcommand\exrtnlabelformat{\exlabelsol\ \theeqexno}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\exrtnlabelformat}
-% This is the formatted return label (return from the solution),
+% This\DescribeMacro{\exrtnlabelformatwp} is the formatted return label (return from the solution),
% for an exercise with parts.
% \begin{macrocode}
\newcommand\exrtnlabelformatwp{$\square$}
+%</package>
+%<*package|eqexam>
% \end{macrocode}
-% \end{macro}
% \begin{macro}{\aboveexskip}
% \begin{macro}{\belowexskip}
% Amount of skip before and after exercise environment
% \begin{macrocode}
-%</package>
-%<*package|eqexam>
\newcommand{\belowexskip}[1]{\setlength{\eq@tmplength}{#1}%
\edef\eq@exerskip{\noexpand\removelastparskip
\noexpand\vskip\the\eq@tmplength\relax\kern0pt}}
@@ -1479,9 +1544,9 @@
% environment, this is what I should have done originally, but now its
% done. The \texttt{exercise*} signals an exercise with parts. It takes
% one optional parameter, the name of a counter \texttt{<ctr>} that is to
-% be used.
-% \begin{macro}{\exerSolnInExtFile}
-% With the exercises, you have the option of including them in the main document, or putting them
+% be used.\medskip
+%
+% \noindent With the exercises\DescribeMacro{\exerSolnInExtFile}, you have the option of including them in the main document, or putting them
% in an external document. The \cs{exerSolnsInExtFile} command lets you specify an external file name.
% Just use the \textit{basename}, hyperref will add the extension. If an external file is specified, all
% solution links are changed to links between documents. Usage:
@@ -1494,9 +1559,6 @@
\gdef\exerSolns@ReturnPath{#1}}
\let\exerSolns@ExtFile\eq@NO
\def\exerSolns@ReturnPath{}
-% \end{macrocode}
-% \end{macro}
-% \begin{macrocode}
%</package>
%<*package|eqexam>
% \end{macrocode}
@@ -1705,7 +1767,7 @@
\def\declCQSolStr#1{\def\cqSStr{#1}}
\declCQSolStr{Solution}
% \end{macrocode}
-% Aside from the words `Question' and `Solution', the way these two are formatting is determined
+% Aside from the words `Question' and `Solution', the way these two are formated is determined
% through \cs{declCQPre}\DescribeMacro{\declCQPre} and \cs{declCQPost}\DescribeMacro{\declCQPost}.
% These declarations are seen below. The \cs{declCQPost} is more complicated in that it handles the
% formatting after the copied question; in the default definition, we skip a \cs{medskip} and do a \cs{indent}.
@@ -2001,7 +2063,7 @@
% elsewhere as well.
%\par\medskip\noindent
% The \cs{eqterminex} command is one that appears on the solution page, just after the exercise number.
-% We redefine it to do our will. The convenience macro \cs{decleqterminex}\DescribeMacro{\decleqterminex} is used for that purpose.
+% We redefine it to do our will. The convenience macro \DescribeMacro{\decleqterminex}\cs{decleqterminex} is used for that purpose.
% We use \cs{ifterminexchanged} to track whether the default definition is changed.
% \begin{macrocode}
\newif\ifterminexchanged \terminexchangedfalse % dps cq
@@ -2013,9 +2075,19 @@
\decleqterminex{\eqterminexDEF}
% \end{macrocode}
%\changes{v6.7}{2013/04/07}{Inserted another argument into \cs{eqEXt}}
-% Added another argument into \cs{eqEXt}, used for filtering.
-% \begin{macrocode}
+% (2013/04/07) Added another argument into \cs{eqEXt}, used for filtering.\par\medskip
+% \noindent
+% When solutions are written to the SOL file, they are not normally in a group.
+% If you execute \DescribeMacro\makeExSolnsLocalOn\cs{makeExSolnsLocalOn}, each solution
+% is written in a group. Undo this with \DescribeMacro\makeExSolnsLocalOff\cs{makeExSolnsLocalOff},
+% which is the historic default.
+% \changes{v8.1p}{2018/02/13}{Added grouping for exercise solutions to the SOL file}
+% \begin{macrocode}
+\newif\ifmakeExSlLocal \makeExSlLocalfalse
+\def\makeExSolnsLocalOn{\makeExSlLocaltrue}
+\def\makeExSolnsLocalOff{\makeExSlLocalfalse}
\def\eqExerSolnHeaderSngl{%
+ \ifmakeExSlLocal\protect\begingroup^^J\fi
\protect\eqEXt{\eqExtArg}{\eqFilterArg}\protect
\solnItemMngt\protect\exerSolnHeader{\exsecrunhead}{ex.\the@exno}%
{\exsllabelformat}\exer@solnheadhook
@@ -2030,6 +2102,7 @@
% Added another argument into \cs{eqEXt}, used for filtering.
% \begin{macrocode}
\def\eqExerSolnHeaderList{%
+ \ifmakeExSlLocal\protect\begingroup^^J\fi
\protect\eqEXt{\eqExtArg}{\eqFilterArg}\protect
\solnItemMngt\protect\exerSolnHeader{\exsecrunhead}%
{ex.\the@exno\thepartno}{\exsllabelformatwp}%
@@ -2077,10 +2150,32 @@
% \end{macro}
% This macro is the beginning of the \texttt{solution} environment for
% exercises.
-% \begin{macrocode}
-\def\solnexer@woparts{\def\bLeaveVspace{x}% = no vertical space added
+% \changes{v8.1g}{2017/12/27}{added \string\cs{pushEnvir} and \string\cs{popEnvir} to remove
+% \string\cs{everypar} influence in \string\cs{solnexer@woparts}}
+% \changes{v8.1o}{2018/02/12}{Added cond. definition for \string\cs{if@eqalignfilllinestoleft}}
+% \begin{macrocode}
+\let\exsolnonceonlytophook\relax
+\def\solnexer@woparts{%
+ \ifanswerkey\ifeqe@flextended\ifcont@nnot
+ \ifx\solutionparshape\@empty\else % dpsj8
+ \pushEnvir
+ \everypar{}\if@eqalignfilllinestoleft\else
+ \parshape=1 \leadinIndent \linewidth\fi
+ \popEnvir
+ \fi\fi\fi\fi\def\bLeaveVspace{x}% = no vertical space added
+ \exsolnonceonlytophook % dps27
+ \global\let\exsolnonceonlytophook\relax
+% \end{macrocode}
+% The following lines are needed to get a better alignment
+% with the bgonly key option, in \pkg{eqexam}.
+% \changes{v8.1f}{2017/12/04}{Added lines to support eqexam}
+% \begin{macrocode}
+ \@ifundefined{KV@eqefillLines@bgonly}{}
+ {\ifKV@eqefillLines@bgonly\ifvmode\else
+ \par\leavevmode\strut\fi\fi
+ \ifKV@eqefillLines@outlineonly\leavevmode\strut\fi}%
\ifeq@ckSolnVspace
- \def\eq@next{\@ifnextchar[{\solnexer@@woparts}%
+ \def\eq@next{\@ifnextchar[{\solnexer@@woparts}%]
{\solnexer@@woparts[\null]}}\else
\def\eq@next{\solnexer@@woparts[\null]}\fi
% \end{macrocode}
@@ -2105,34 +2200,34 @@
{\vskip0pt\penalty-50\vglue\wlVspace\eqWriteLine
\advance\@tempcnta1\relax}\par\endgroup
}
+\let\leavevspace\relax % dpsj5
\newcommand{\vspaceFmt}[1]{%
- \ifx\solutionparshape\@empty\else
+ \ifx\solutionparshape\@empty\else
% \end{macrocode}
% This must be part of the solution for a \cs{leadinitem} question.
% We need to make an adjustment to the \cs{linewidth}.
% \begin{macrocode}
- \advance\linewidth-\leadinIndentPrtSep\fi
+ \advance\linewidth-\leadinIndentPrtSep\fi
\ifdim\sameVspace>0pt
- \let\bLeaveVspace\@empty
- \def\leavevspace{%
- \ifx\eq@insertverticalspace\eq@YES\par
- \eqPriorVspace{#1}{\nobreak\noindent
+ \let\bLeaveVspace\@empty
+ \def\leavevspace{%
+ \ifx\eq@insertverticalspace\eq@YES\par\eq@quessolskip
+ \eqPriorVspace{#1}{\nobreak\noindent
% \end{macrocode}
% If \texttt{nLines} is non-empty, we'll use some spacial code
% to generate the lines so it breaks across pages.
% \begin{macrocode}
- \ifx\soln@keys@nLines\@empty
- \if@eqlinedfiller
- \def\eq@lines@next{\vspaceFiller{#1}}\else
- \def\eq@lines@next{\parbox[b][#1][t]{\linewidth}
- {\vspaceFiller{#1}}}\fi
- \else
- \def\eq@lines@next{\eq@linesXPgs}%
- \fi\eq@lines@next
- }%
- \fi
- }%
- \fi
+ \if@eqlinedfiller
+ \ifx\soln@keys@nLines\@empty
+ \def\eq@lines@next{\vspaceFiller{#1}}\else
+ \def\eq@lines@next{\eq@linesXPgs}\fi
+ \else
+ \def\eq@lines@next{\parbox[b][#1][t]{\linewidth}
+ {\vspaceFiller{#1}}}%
+ \fi\eq@lines@next}%
+ \fi
+ }\expandafter\leavevspace % dpsj6
+ \fi
}
% \end{macrocode}
% \changes{v6.8g}{2014/04/08}{Added key-val here for \textsf{eqexam}.}
@@ -2209,20 +2304,34 @@
% then \textsf{eqexam} should leave space for writing an answer, and put solutions at the end
% of the document.
% \begin{macrocode}
- \ifx\sameVspace\@empty\gdef\sameVspace{0pt}\fi
- \ifvspacewithsolns\vspaceFmt{\sameVspace}\fi
- \ifeq@nosolutions\ifeq@solutionsafter\else
- \vspaceFmt{\sameVspace}\fi\fi
+% dpsj5 moved to solnexer@@@woparts
+% \ifx\sameVspace\@empty\gdef\sameVspace{0pt}\fi
+% \ifvspacewithsolns\vspaceFmt{\sameVspace}\fi
+% \ifeq@nosolutions\ifeq@solutionsafter\else
+% \vspaceFmt{\sameVspace}\fi\fi
\fi\fi
\solnexer@@@woparts
}
% \end{macrocode}
% \changes{v7.7q}{2016/07/22}{Added \string\cs{solnsafterSkip}}
+% \changes{v8.1h}{2018/01/03}{Added \string\cs{@solnafterSkipOnce} (package use only)}
% \begin{macrocode}
\def\solnsafterSkip#1{\setlength{\@tempdima}{#1}%
- \def\solnsafterSkipAmt{\the\@tempdima}%
- \def\solutionsafterSkip{\vskip#1\relax}}
+ \edef\solnsafterSkipAmt{\the\@tempdima}%
+ \def\solutionsafterSkip{\vskip\solnsafterSkipAmt\relax}}
\solnsafterSkip{\smallskipamount}
+\def\@solnafterSkipOnce#1{\setlength{\@tempdima}{#1}%
+ \xdef\@solnafterSkipOnceAmt{\the\@tempdima}}%
+\def\@@solnafterSkipOnce{\vskip\@solnafterSkipOnceAmt\relax %dpsj3
+ \gdef\@solnafterSkipOnceAmt{0pt}}
+\def\@solnafterSkipOnceAmt{0pt}
+% \end{macrocode}
+% Add separation between the question and the \texttt{solution} environment.
+% \changes{v8.1d}{2017/11/13}{Added \string\cs{quessolsep} for exercises (eqexam)}
+% \begin{macrocode}
+\def\quessolSkip#1{\setlength{\@tempdima}{#1}%
+ \edef\eq@quessolskip{\noexpand\vskip\the\@tempdima\relax}}
+\def\eq@quessolskip{\vskip\smallskipamount}
% \end{macrocode}
% The next two definitions are used for debugging the
% \cs{ifkeepdeclaredvspacing} feature (\textsf{eqexam} only).
@@ -2269,95 +2378,109 @@
\let\priorexsolafterTab\@empty
\let\priorexsolafterSngl\@empty
\def\eq@Hid{H}\def\eq@hid{h}
-\def\solnexer@@@woparts{%
- \global\thereissolutiontrue
- \def\exerwparts@cols{0}%
- \let\verbatim@out\ex@solns
- \if\currhideopt\eq@Hid
+\def\solutionafterExCmds#1{\def\@rgi{#1}\ifx\@rgi\@empty
+ \let\eqSolnExCmds\relax\else
+ \def\eqSolnExCmds{#1}\fi}
+\let\eqSolnExCmds\relax
+\def\eq@b@ddCodeSpecialDef#1{#1}% dpsj4
+\let\eq@b@ddCodeSpecial\eq@b@ddCodeSpecialDef % dpsj4
+\def\solnexer@@@woparts{\ifeq@solutionsafter\else
+ \expandafter\begingroup\fi %dpsj10
+ \global\thereissolutiontrue
+ \global\let\procsoln\relax % dpsj6
+ \global\let\endprocsoln\relax % dpsj6
+ \def\exerwparts@cols{0}%
+ \let\verbatim@out\ex@solns
+ \if\currhideopt\eq@Hid
% \end{macrocode}
% (2017/02/09) Hide \cs{minVspacet@bs} for `H' option
% \changes{v7.8e}{2017/02/09}{Hide \string\cs{minVspacet@bs} for `H' option}
% \begin{macrocode}
- \let\minVspacet@bs\@empty
- \let\procsoln\eqSavedComment
- \let\endprocsoln\eqSavedEndCommet
- \def\eq@next{\procsoln}%
+ \let\minVspacet@bs\@empty
+ \let\procsoln\eqSavedComment
+ \let\endprocsoln\eqSavedEndCommet
+ \def\eq@next{\procsoln}%
+ \else
+ \eq@ckglobalhide
+ \ifeq@hidesolution
+ \let\procsoln\eqSavedComment
+ \let\endprocsoln\eqSavedEndCommet
\else
- \eq@ckglobalhide
- \ifeq@hidesolution
- \let\procsoln\eqSavedComment
- \let\endprocsoln\eqSavedEndCommet
- \else
- \ifx\bLeaveVspace\@empty\leavevspace\fi
- \ifeq@solutionsafter\else
- \ifx\eq@@CommonCmd\@empty\else
- \set@display@protect
- \immediate\write\verbatim@out{\eq@@CommonCmd}%
- \set@typeset@protect
- \fi
- \fi
- \let\procsoln\verbatimwrite
- \let\endprocsoln\endverbatimwrite
- \fi
- \def\eq@next{%
- \ifeq@solutionsafter%\par
- \removelastskip\removelastparskip
- \cqSAtrue\eqCQDeclarations
- \declCopyQues{\input{\cq@CutName}}%
- \ifx\exsolafter\@empty
+% \ifx\bLeaveVspace\@empty\leavevspace\fi % dpsj5
+ \ifeq@solutionsafter\else
+ \ifx\eq@@CommonCmd\@empty\else
+ \set@display@protect
+ \immediate\write\verbatim@out{\eq@@CommonCmd}%
+ \set@typeset@protect
+ \fi
+ \fi
+ \let\procsoln\verbatimwrite
+ \let\endprocsoln\endverbatimwrite
+ \fi
+ \def\eq@next{%
+ \ifeq@solutionsafter
+ \let\procsoln\relax % dpsj6
+ \let\endprocsoln\relax
+ \removelastskip\removelastparskip
+ \cqSAtrue\eqCQDeclarations
+ \declCopyQues{\input{\cq@CutName}}%
+ \ifx\exsolafter\@empty
% \end{macrocode}
% If we have solutions after and there is no label and no vertical
% skip specified, we do nothing other than to execute \cs{eqe@setStartSolns},
% which marks the beginning of the ``solution.''
% \begin{macrocode}
- \ifdim\sameVspace=0pt\eqe@setStartSolns
- \else
+ \ifdim\sameVspace=0pt\eqe@setStartSolns
+ \else
% \end{macrocode}
% If there is vertical space specified, we do a standard skip, and mark the beginning
% of the solution with \cs{eqe@setStartSolns}.
% \begin{macrocode}
- \solutionsafterSkip
- \eqe@setStartSolns
- \fi
- \else\par\kern0pt
- \solutionsafterSkip
- \noindent\strut\eqe@setStartSolns
- \fi
- \parskip\eqeques@parsep
- \ifx\endparts\endexercise@parts@tabular
- \eq@setPrbSolnAftrIndnt
- \restorejustify
-% \expandafter\setTabulrSolnEnv
- \fi
+ \solutionsafterSkip
+ \@@solnafterSkipOnce % dpsj3
+ \eqe@setStartSolns
+ \fi
+ \else\par\kern0pt
+ \solutionsafterSkip
+ \@@solnafterSkipOnce % dpsj3
+ \noindent\strut\eqe@setStartSolns
+ \fi
+ \parskip\eqeques@parsep
+ \ifx\endparts\endexercise@parts@tabular
+ \eq@setPrbSolnAftrIndnt
+ \restorejustify
+ \fi
% \end{macrocode}
% (2017/02/09) Added prior \cs{exsolafter} hooks.
% \changes{v7.8e}{2017/02/09}{Added prior \string\cs{exsolafter} hooks}
% \begin{macrocode}
- \ifx\endparts\endexercise@parts@tabular\expandafter
- \priorexsolafterTab\else
- \ifx\endparts\endexercise@parts@list\expandafter
- \priorexsolafterList\else\expandafter
- \priorexsolafterSngl\fi\fi
+ \ifx\endparts\endexercise@parts@tabular\expandafter
+ \priorexsolafterTab\else
+ \ifx\endparts\endexercise@parts@list\expandafter
+ \priorexsolafterList\else\expandafter
+ \priorexsolafterSngl\fi\fi
% \end{macrocode}
% The solution after label, followed by a space.
% \begin{macrocode}
- \exsolafter\space\ignorespaces
+% \eqSolnExCmds % dpsj8
+ \exsolafter\space\ignorespaces
% \end{macrocode}
% We set the shape of the solutionafter.
% This is empty if \cs{leadinitem} is not used.
% \begin{macrocode}
- \solutionparshape
- \else
+ \solutionparshape
+ \else
% \end{macrocode}
% Write the solution header 11/03/05
% \begin{macrocode}
- \eqExerSolnHeader
- \global\let\eqExerSolnHeader\@empty
- \global\therearesolutionstrue\expandafter\procsoln
- \fi
- }%
- \fi
-\eq@next}
+ \eqExerSolnHeader
+ \global\let\eqExerSolnHeader\@empty
+ \global\therearesolutionstrue\expandafter\procsoln
+ \fi
+ }%
+ \fi
+ \eq@b@ddCodeSpecial{\eq@next}%
+}% dpsj4
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
@@ -2398,6 +2521,7 @@
\exrtnlabelformat\fi}}%
\protect\endeqEXt\ifeqforpaper\protect\par{\belowexsolnskip}\fi^^J%
%</eqexam>
+ \ifmakeExSlLocal\protect\endgroup^^J\fi
%<*package|eqexam>
}
% \end{macrocode}
@@ -2406,46 +2530,69 @@
% Unless \cmd{\eq@solutionsaftertrue}, then \cmd{\endverbitim},
% and write return labels.
% \begin{macrocode}
-\def\endsolnexer@woparts{%
- \if\currhideopt H%
- \ifkeepdeclaredvspacing\vskip\sameVspace\fi
- \csname endprocsoln\endcsname
- \else
+\let\eq@e@ddCodeSpecialDef\relax % dpsj4
+\let\eq@e@ddCodeSpecial\eq@e@ddCodeSpecialDef % dpsj6
+% \end{macrocode}
+% Added \cs{kdvsp@Restore} to support
+% the \texttt{flextended} option from \textsf{eqexam}. See the placement
+% of this command below its default definition of \cs{relax}.
+% \changes{v8.1i}{2018/01/20}{Added \string\cs{kdvsp@Restore} to support
+% the \texttt{flextended} option from \string\textsf{eqexam}}
+% \begin{macrocode}
+\let\kdvsp@Restore\relax % dpsj20
+\def\endsolnexer@woparts{\endprocsoln\eq@e@ddCodeSpecial
+ \pkg@endsolnexerhook % djsj8 moved from the end of the macro
+ \ifeq@solutionsafter\else
+ \expandafter\endgroup\fi % from \begingroup at \solnexer@@@woparts
+ \global\let\exsolnonceonlytophook\relax
+ \ifx\sameVspace\@empty\gdef\sameVspace{0pt}\fi % dpsj5
+ \ifvspacewithsolns\vspaceFmt{\sameVspace}\else
+ \ifeq@nosolutions\ifeq@solutionsafter\else
+ \vspaceFmt{\sameVspace}\fi\fi\fi
+ \if\currhideopt H%
+ \ifkeepdeclaredvspacing\vskip\sameVspace\fi
+% \csname endprocsoln\endcsname
+ \else
% \end{macrocode}
% If solutions after, we start a new paragraph, then add some kerning glue,
% this gives a better gauge for calculating the \cs{pagetotal}.
% \begin{macrocode}
- \ifeq@solutionsafter
- \if\exerstar*%
- \eq@fititin{\mbox{\exrtnlabelformatwp}}\else
- \eq@fititin{\mbox{\exrtnlabelformat}}\fi
- \ifx\istabularexer\eq@YES\kern0pt\else\par\fi
-% \ifnum\exerwparts@cols>0\relax\kern0pt\else\par\fi
-% \end{macrocode}
-% \changes{v6.3z}{2011/04/28}{if \cs{ifkeepdeclaredvspacing} is true, we attempt
+ \ifeq@solutionsafter
+ \ifx\isitleadin\eq@YES\parshape=0 \fi % dpsj9
+ \if\exerstar*%
+ \eq@fititin{\mbox{\exrtnlabelformatwp}}\else
+ \eq@fititin{\mbox{\exrtnlabelformat}}\fi
+ \ifx\istabularexer\eq@YES\unskip\kern0pt\else\par\fi % dpsj6
+% \ifx\istabularexer\eq@YES\kern0pt\else\par\fi
+% \ifnum\exerwparts@cols>0\relax\kern0pt\else\par\fi
+% \end{macrocode}
+% if \cs{ifkeepdeclaredvspacing} is true, we attempt
% to preserve the vertical space declared by the \textsf{solution} environment when
-% \cs{ifeq@solutionsafter} is true.}
+% \cs{ifeq@solutionsafter} is true.
+% \changes{v6.3z}{2011/04/28}{if \string\cs{ifkeepdeclaredvspacing} is true, we attempt
+% to preserve the vertical space declared by the \textsf{solution} environment when
+% \string\cs{ifeq@solutionsafter} is true.}
% \begin{macrocode}
-\ifx\minVspacet@bs\@empty
- \ifkeepdeclaredvspacing
+ \ifx\minVspacet@bs\@empty
+ \ifkeepdeclaredvspacing
% \end{macrocode}
% We get the current \cs{pagetotal}, and subtract off the page total as recorded
% by \cs{eq@startSoln}.
% \begin{macrocode}
- \@tempdima\pagetotal
- \advance\@tempdima-\eq@startSoln
+ \@tempdima\pagetotal
+ \advance\@tempdima-\eq@startSoln
% \end{macrocode}
% \changes{v6.4w}{2012/26/27}{Added \cs{relax} following the assignment.}
% {\TeX} was looking ahead looking for the rest of the dimension, this caused
% problems because later code was expanded when it should not have been. Inserted
% \cs{relax}, \verb~\@tempdimb\sameVspace\relax~.
% \begin{macrocode}
- \@tempdimb\sameVspace\relax
+ \@tempdimb\sameVspace\relax
% \end{macrocode}
% if \cs{soln@keys@nLines} is nonempty, we put \cs{sameVspace} to \texttt{1sp},
% unless the author asks for \texttt{1sp}, this is how it is set.
% \begin{macrocode}
- \ifdim\@tempdimb>1sp\relax
+ \ifdim\@tempdimb>1sp\relax
% \end{macrocode}
% If there is a positive value for \cs{sameVspace}, we calculate
% the difference between\cs{@tempdimab} and \cs{@tempdima}, that is, we calculate
@@ -2453,35 +2600,37 @@
% \sameVspace-(\pagetotal-\eq@startSoln)
%\end{verbatim}
% \begin{macrocode}
- \advance\@tempdimb-\@tempdima
+ \advance\@tempdimb-\@tempdima
% \end{macrocode}
% If this difference is positive, we will skip this amount.
% \begin{macrocode}
- \ifdim\@tempdimb>0pt\vglue\@tempdimb\kern0pt
- \let\eqe@showEndHere\@gobble
- \edef\tmp@exp{\noexpand\marginpar{%
- \noexpand\smash{e: adj \the\@tempdimb}}}%
- \eqe@debugVertSkip{\tmp@exp}%
- \fi
- \fi
+ \ifdim\@tempdimb>0pt\vglue\@tempdimb\kern0pt
+ \let\eqe@showEndHere\@gobble
+ \edef\tmp@exp{\noexpand\marginpar{%
+ \noexpand\smash{e: adj \the\@tempdimb}}}%
+ \eqe@debugVertSkip{\tmp@exp}%
\fi
- \eqe@showEndHere{\eqe@debugVertSkip{\marginpar{\smash{e}}}}%
-\fi
- \else
- \endprocsoln
- \eq@ckglobalhide
- \ifeq@hidesolution\else
- \endsolnexerhookaux
+ \fi
+ \fi
+ \eqe@showEndHere{\eqe@debugVertSkip{\marginpar{\smash{e}}}}%
+ \fi
+ \else
+% \endprocsoln
+ \eq@ckglobalhide
+ \ifeq@hidesolution\else
+ \endsolnexerhookaux
% \end{macrocode}
% Here's were we write the trailer for the solution
% \begin{macrocode}
- \set@display@protect
- \immediate\write\verbatim@out{\eqExerSolnTrailer}%
- \set@typeset@protect
- \fi
+ \let\verbatim@out\ex@solns
+ \set@display@protect
+ \immediate\write\verbatim@out{\eqExerSolnTrailer}%
+ \set@typeset@protect
\fi
+ \fi
\fi
-\pkg@endsolnexerhook\endsolnexerhook}
+ \kdvsp@Restore % dpsj20
+ \endsolnexerhook\penalty0\relax}
% \end{macrocode}
% \end{macro}
% \subsection{The \texttt{exercise*} Environment: Exercises with Parts}
@@ -2534,7 +2683,7 @@
% (2016/12/16) Define a flag \cs{istabularexer} that signals to the solution environment it is in a tab environment
% \changes{v7.8b}{2016/12/16}{Added \string\cs{istabularexer}}
% \begin{macrocode}
-\let\istabularexer\eq@NO % dps 2016/12/16
+\let\istabularexer\eq@NO
\def\exercise@parts{\let\rlspar\relax
\ifx\solutionparshape\@empty
\let\isitleadin\eq@NO
@@ -2550,17 +2699,17 @@
% a leadinitem.} If there is a lead-in, we set \cs{topsep} to \texttt{0pt}
% and skip \cs{itemsep}.
% \begin{macrocode}
- \def\eqparts@topsep{0pt}% dps88
- \vskip\eqparts@itemsep\relax\fi % dps88
+ \def\eqparts@topsep{0pt}%
+ \vskip\eqparts@itemsep\relax\fi
\topofpartshook
- \let\itsExerParts\eq@YES % dps17
+ \let\itsExerParts\eq@YES
\global\let\@listiiredefined\eq@NO
\def\exerwparts@cols{0}\@ifnextchar[%
{%
% \end{macrocode}
% When there is a \cs{tableadin}, we remove \cs{removelastparskip} because it does not occur above.
% \begin{macrocode}
- \if@tableadinitem\else\removelastparskip\fi % dps11
+ \if@tableadinitem\else\removelastparskip\fi
% \keepdeclaredvspacingfalse
\let\endparts\endexercise@parts@tabular\exercise@parts@tabular@}%
{\let\endparts\endexercise@parts@list\exercise@parts@list}}
@@ -2612,16 +2761,16 @@
% parts.
%\changes{v6.4o}{2012/02/04} {Fine tune the control over space between parts.}
% \begin{macrocode}
-\newcommand{\partsitemsep}[1]{{% dps88
+\newcommand{\partsitemsep}[1]{{%
\setlength{\@tempdima}{#1}%
\xdef\eqparts@itemsep{\the\@tempdima}}}
\let\eqpartsitemsep\partsitemsep
\def\eqparts@itemsep{0pt}
-\newcommand\partsparsep[1]{{% dps88
+\newcommand\partsparsep[1]{{%
\setlength{\@tempdima}{#1}%
\xdef\eqparts@parsep{\the\@tempdima}}}
\def\eqparts@parsep{0pt}
-\newcommand\partstopsep[1]{{% dps88
+\newcommand\partstopsep[1]{{%
\setlength{\@tempdima}{#1}%
\xdef\eqparts@topsep{\the\@tempdima}}}
\def\eqparts@topsep{3pt}
@@ -2694,9 +2843,9 @@
% (2012/11/30) If \cs{solutionparshape} is nonempty, the user has used
% \cs{leadinitem}, so we increment \texttt{partno}.
% \begin{macrocode}
- \if\isitleadin\eq@YES % dps7
+ \if\isitleadin\eq@YES
\settowidth{\eq@tmplength}{\parts@indent\eqe@prtsepPrb}%
- \xdef\prtsIndntSep{\the\eq@tmplength}% dps7
+ \xdef\prtsIndntSep{\the\eq@tmplength}%
% \advance\linewidth-\prtsIndntSep\relax
\if\itsforleadinitem\eqe@YES\setcounter{partno}{\fliPartNo}\else
\setcounter{partno}{1}\fi\fi
@@ -2843,12 +2992,12 @@
% \end{macrocode}
% If this is not tabular env, \cs{autotabnewline} does nothing
% \begin{macrocode}
- \ifnum\exerwparts@cols>0\relax % dps cq
+ \ifnum\exerwparts@cols>0\relax
\ifx\eq@tabMarkChk\@gobble
\def\eq@atnext{\expandafter
\tabularnewline\expandafter[#1]}\else
\def\eq@atnext{\resettabMark\tabularnewline
- \noalign{\expandafter\kern#1}}\fi % dps7
+ \noalign{\expandafter\kern#1}}\fi
\expandafter\eq@atnext\fi}
\def\eq@tabMark{%
\ifnum\eq@extabColCnt=0\relax
@@ -2886,7 +3035,7 @@
% \cs{leadinitem}, so we increment \texttt{partno}.
% \begin{macrocode}
\def\tablrIndent{\hglue\prtsIndntSep\relax}%
- \if\isitleadin\eq@YES % dps7
+ \if\isitleadin\eq@YES
\if$\the\everypar$\let\tablrIndent\relax\fi
\setcounter{partno}{1}\fi
\let\leadinitem\eq@leadinitemparts
@@ -2912,8 +3061,8 @@
\@ifundefined{@xtabularcr}{\let\@xarraycr\eq@xtabularcr}
{\let\@xtabularcr\eq@xtabularcr}%
% \end{macrocode}
-% We reduce the width of the \cs{parbox}es (p|{width}|) by \cs{exertabsep} to leave
-% room for \cs{tabcolsep=}\cs{exertabsep} between columns.
+% We reduce the width of the \cs{parbox}es (p|{width}|) by \cs{eq@partstabcolsep} to leave
+% room for \cs{tabcolsep=}\cs{eq@partstabcolsep} between columns.
%\begin{verbatim}
% n=\exerwparts@cols
% width=(\linewidth-2*(n-1)*\tabcolsep)/n
@@ -2935,15 +3084,16 @@
\tabcolsep\@tempdima
\multiply\@tempdima\@tempcnta
\advance\eq@tmpdima-\@tempdima
- \divide\eq@tmpdima by\exerwparts@cols
+ \divide\eq@tmpdima by\exerwparts@cols\relax %dpsj3
% \ifx\isitleadin\eq@NO
- \advance\eq@tmpdima\prtsIndntSep\relax
-% \advance\eq@tmpdima\halfWidth\relax % dps17
+% \advance\eq@tmpdima\prtsIndntSep\relax % dpsj3
+ \edef\widthOfPartsBox{\the\eq@tmpdima}% dpsj2
+% \advance\eq@tmpdima\halfWidth\relax
% \else\advance\eq@tmpdima\halfWidth\relax\fi
% \end{macrocode}
% If there is a \cs{tableadin}, we do not perform a \cs{vskip}.
% \begin{macrocode}
- \if@tableadinitem\else\vskip\eq@partstabtopsep\relax\fi % dps11
+ \if@tableadinitem\else\vskip\eq@partstabtopsep\relax\fi
\noindent\normalbaselines\kern0pt
\prior@parts@hook\abovepartshook
% \end{macrocode}
@@ -2952,6 +3102,7 @@
% \changes{v7.4}{2015/03/23}{inserted \cmd\setTabulrSolnEnv}%
% \begin{macrocode}
\tablrIndent\tabular[t]{@{}*{\exerwparts@cols}{>{\setTabulrSolnEnv
+% \ifanswerkey\eqSolnExCmds\fi %dpsj2
\parskip\eqeques@parsep\relax
\parindent0pt\relax\strut}p{\eq@tmpdima}}@{\hidewidth}}%
}{\endtabular\kern0pt
@@ -3006,7 +3157,7 @@
\eq@tmpdima=\wd\eq@tmpbox
\addtolength\eq@tmplength{\eq@extralabelsep}%
\xdef\partshangamount{\the\eq@tmplength}%
- \advance\linewidth-\eq@tmplength
+% \advance\linewidth-\eq@tmplength %dpsj3
\parshape \@ne 0pt \linewidth
\everypar{\parshape \@ne 0pt \linewidth}%
\eq@setPrbSolnAftrIndnt
@@ -3036,6 +3187,8 @@
\eq@item
}
% \end{macrocode}
+% End of the \texttt{parts} environment.
+% \end{environment}
% In the above tabular parts environment, \cs{@xtabularcr} is \cs{let} to
% equal to \cs{eq@xtabularcr}.
% \begin{macrocode}
@@ -3055,10 +3208,6 @@
{\eqe@tab@parts@rowsep}}%
\def\eqe@tab@parts@rowsep{\save@@xtabularcr
\noalign{\expandafter\kern\eqparts@tabrowsep}}%
-% \end{macrocode}
-% End of the \texttt{parts} environment.
-% \end{environment}
-% \begin{macrocode}
%</package|eqexam>
%<*package>
% \end{macrocode}
@@ -3067,12 +3216,15 @@
% We provide several key-values for adjusting the spacing of the environment.
% The keys defined here are \texttt{labelwidthTo}, \texttt{labelwidth}, \texttt{topsep},
% \texttt{parsep},\texttt{itemsep}, \texttt{labelsep}, and \texttt{continue}.%
-% \IndexKey{labelwidthTo}\IndexKey{labelwidth}\IndexKey{topsep}%
-% \IndexKey{parsep}\IndexKey{itemsep}\IndexKey{labelsep}\IndexKey{continue}%
+% \IndexKey{labelwidthTo}\IndexKey{labelwidth}
% \begin{macrocode}
\define@key{exEnum}{labelwidthTo}[\normalsize\normalfont\bfseries00.\ ]%
{\def\exE@labelwidthTo{#1}}
\define@key{exEnum}{labelwidth}[\@empty]{\def\exE@labelwidth{#1}}
+% \end{macrocode}
+% Keys continued.\IndexKey{topsep}%
+% \IndexKey{parsep}\IndexKey{itemsep}\IndexKey{labelsep}\IndexKey{continue}%
+% \begin{macrocode}
\let\exE@labelwidth\@empty
\define@key{exEnum}{topsep}[3pt]{\def\exE@topsep{#1}}
\define@key{exEnum}{parsep}[3pt]{\def\exE@parsep{#1}}
@@ -3110,7 +3262,7 @@
\def\setENum{\Elabel\if\exerstar*\thequestionno(\thepartno)\else
\thequestionno\fi}%
\ifExSolutionsSet\else
- \writeToExSolns{\protect\begin{exEnumerate}}\fi
+ \writeToExSolns{^^J\protect\begin{exEnumerate}^^J}\fi
\list{}{%
\ifx\exE@labelwidth\@empty
\settowidth{\labelwidth}{\exE@labelwidthTo}\else
@@ -3126,7 +3278,7 @@
\settowidth{\labelsep}{\normalfont\ }%
\setlength{\leftmargin}{\labelwidth}%
}\item\relax}{\ifExSolutionsSet\else
- \writeToExSolns{\protect\end{exEnumerate}}\fi
+ \writeToExSolns{\protect\end{exEnumerate}^^J}\fi
\endlist}
% \end{macrocode}
% \end{environment}
@@ -3149,6 +3301,7 @@
% \end{environment}
% \end{environment}
% \begin{macrocode}
+% End of enumeration exercises section
%</package>
%<*package|eqexam>
% \end{macrocode}
@@ -3306,7 +3459,7 @@
% to be redefined to \cs{newpage}. It is used in \cs{exerSolnHeader}.
% The reasons for this definition are lost in time.
% \begin{macrocode}
- \def\webnewpage{\let\webnewpage\newpage}%
+ \def\webnewpage{\global\let\webnewpage\newpage}%
\fi
% \end{macrocode}
% We have a prior command, followed by the section title
@@ -3657,6 +3810,7 @@
%\DescribeMacro\sqhspace\cmd\sqhspace\ is the space that follows \cmd\sqlabel
% \begin{macrocode}
\let\sqhspace\space
+\let\ListOfSQuizNames\@empty
\newenvironment{shortquiz}
{%
% \end{macrocode}
@@ -3732,10 +3886,19 @@
\oField.WrongAnsSymbJSLoc=\wrngAnsSymbJSLoc;\fi
}}]{sqID\oField}{0bp}{0bp}}%
}
+\def\qz@IDTxtField{\makebox[0pt][l]{\textField[\autoCenter{n}\BC{}\BG{}
+ \S{S}\textSize{0}\Ff{\FfReadOnly}
+ \AA{\AAFormat{if(typeof aQuizzesInDoc=="undefined")\r\t
+ var aQuizzesInDoc=new Array();\r
+ if (aQuizzesInDoc.indexOf("\oField")) aQuizzesInDoc.push("\oField");
+ }}]{qzID\oField}{0bp}{0bp}}}
%</package>
%<*package|eqexam>
+\let\eqQuizType\relax
\def\@@shortquiz[#1]{%\begingroup
\gdef\oField{#1}\gdef\curr@quiz{#1}\gdef\currQuiz{#1}%
+ \edef\tmp@Exp{\noexpand\g@addto@macro\noexpand
+ \ListOfSQuizNames{,#1}}\tmp@Exp
% \end{macrocode}
% We try to support {\LaTeX}'s cross-referencing system by defining
% \cs{@currentlabel}, \cs{@currentHlabel}, and \cs{@currentlabelname}.
@@ -3892,6 +4055,16 @@
% \DescribeMacro\sqsolafterhspace The space after the solution label
% \begin{macrocode}
\def\sqsolafterhspace{\space}
+% \end{macrocode}
+% When solutions are written to the QSL file, they are not normally in a group.
+% If you execute \DescribeMacro\makeQzSolnsLocalOn\cs{makeQzSolnsLocalOn}, each solution
+% is written in a group. Undo this with \DescribeMacro\makeQzSolnsLocalOff\cs{makeQzSolnsLocalOff},
+% which is the historic default.
+% \changes{v8.1p}{2018/02/13}{Added grouping for quiz solutions to the QSL file}
+% \begin{macrocode}
+\newif\ifmakeQzSlLocal \makeQzSlLocalfalse
+\def\makeQzSolnsLocalOn{\makeQzSlLocaltrue}
+\def\makeQzSolnsLocalOff{\makeQzSlLocalfalse}
\def\solution@sq{\let\eq@next\relax
\ifx\@qzsolndest\@empty
\PackageWarning{exerquiz}%
@@ -3907,6 +4080,7 @@
\global\therearequizsolutionstrue\let\verbatim@out=\quiz@solns
\set@display@protect
\immediate\write\verbatim@out{%
+ \ifmakeQzSlLocal\protect\begingroup^^J\fi
% \end{macrocode}
% Mark in the solutions files whether this is a quiz or a shortquiz solution.
% \begin{macrocode}
@@ -3963,9 +4137,8 @@
\else\newpage\penalty1\fi\fi\egroup
}
% \end{macrocode}
-% \begin{macro}{\saveDest}
-% \begin{macro}{\useDest}
-% These two macros are used, as needed to save the destination name of a solution, then
+% The two macros\DescribeMacro{\saveDest}\cs{saveDest} and \DescribeMacro{\useDest}\cs{useDest} are used,
+% as needed to save the destination name of a solution, then
% re-emitting it later, just prior to the solution. Useful for grouped questions.
% \begin{macrocode}
\newcommand{\saveDest}[1][]{%
@@ -3974,10 +4147,6 @@
\xdef\@qzsolndest{#1}\xdef\holdDest{#1}\fi}
\def\useDest{\def\@qzsolndest{\holdDest}}
\let\holdDest\@empty
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \begin{macrocode}
%</package>
%<*package|eqexam>
\def\fpAfterSolutionsSkip{\par\medskip}
@@ -3994,6 +4163,7 @@
{\protect\mbox{\sqslrtnlabel}}\string\endeqSQt%
\fi
\ifeqforpaper\protect\fpAfterSolutionsSkip\fi^^J%
+ \ifmakeQzSlLocal\protect\endgroup^^J\fi
}
%</package|eqexam>
%<*package>
@@ -4014,6 +4184,7 @@
%\end{document}
%\end{verbatim}
% \begin{macrocode}
+% End package and begin package|eqexam
%</package>
%<*package|eqexam>
\let\eqSQt\@gobble
@@ -4070,8 +4241,7 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \begin{macro}{\noPeekAction}
-% The default definition of \cmd{quizSolnHeader} contains a macro called
+% The\DescribeMacro{\noPeekAction} default definition of \cs{quizSolnHeader} contains a macro called
% \cmd{\noPeek}. This is the action that \cmd{\noPeek} performs. The actual
% definition of \cmd{\noPeek} is driver dependent, and is listed elsewhere.
% An open page action will be created with a JavaScript action, which calls
@@ -4083,16 +4253,15 @@
\def\noPeekAction#1#2{%
/AA <</O<</S/JavaScript/JS(noPeek("#1",#2))>> >>
}
+%</package>
+%<*package|eqexam>
% \end{macrocode}
-% \end{macro}
% \subsection{The \texttt{shortquiz} Solutions}
% When the first solution is written, \cmd{\therearequizsolutions} is
% made true. When the solutions are input back into the file, and
% this switch is still false, then no quiz header is typeset;
% this avoids an empty quiz solutions section with only the header.
% \begin{macrocode}
-%</package>
-%<*package|eqexam>
\newif\iftherearequizsolutions \therearequizsolutionsfalse
\let\aeb@FLOverride\relax
% \end{macrocode}
@@ -4140,7 +4309,7 @@
% \begin{macrocode}
\newcommand{\quizSolnInput}
{%
- \let\webnewpage\relax
+ \global\let\webnewpage\relax
\immediate\closeout\quiz@solns
\ifeq@noquizsolutions\else
% \end{macrocode}
@@ -4154,7 +4323,7 @@
\iftherearequizsolutions\newpage\markright{}%
\eq@normallheader\markright{\sqslsecrunhead}%
\ifx\webnewpage\relax
- \def\webnewpage{\let\webnewpage\newpage}\fi
+ \def\webnewpage{\global\let\webnewpage\newpage}\fi
% \end{macrocode}
% Here we have various prior commands, and the setting of the
% section title.
@@ -4255,6 +4424,7 @@
% For multiple choice questions, here we give the option of using a mixture of links
% and forms.
% \begin{macrocode}
+% Begin joint package and eqexam
%</package>
%<*package|eqexam>
\newcommand\useForms{\def\aeb@FLOverride{f}}
@@ -4290,6 +4460,13 @@
{\goodbreak\@ifstar{\gdef\qstar{*}\@quiz*f}{\gdef\qstar{x}\@quiz*l}}
{\aeb@endquiz}
\def\@quizCnt{0}
+% \end{macrocode}
+% \cs{ListOfQuizNames} and \cs{ListOfSQuizNames} are master lists of all
+% quizzes in the document.
+% \changes{v7.8l}{2017/07/29}{Added \string\cs{ListOfQuizNames} and
+% \string\cs{ListOfSQuizNames}}
+% \begin{macrocode}
+\let\ListOfQuizNames\@empty
\def\@quiz*#1#2{%
% \end{macrocode}
% (06/08/10) The next two lines initialize the macros for registering the
@@ -4329,9 +4506,11 @@
% \end{macrocode}
% \changes{v6.3u}{2010/11/04}{%
% Added \cs{xdef}\cs{oField}\texttt{\{\#2\}}, this is
-% needed for \textsf{apb.dtx}.
-%}
+% needed for \textsf{apb.dtx}}
+% Add \cs{listOfQuizNames} to track quizzes
+% \changes{v7.8k}{2017/07/25}{Added \string\cs{listOfQuizNames} to track quizzes}
% \begin{macrocode}
+ \g@addto@macro\ListOfQuizNames{,#2}%
\gdef\quiz@total{#2}\xdef\curr@quiz{#2}\xdef\oField{#2}%
\xdef\currQuiz{#2}\xdef\currQuizStartPage{\thepage}%
\xdef\aPointType{0}%
@@ -4434,9 +4613,9 @@
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
-\def\listOfQuizzes{}
-\def\listOfSubmitQuizzes{}
-\def\initializeAllSubmitQuizzes{}
+%\def\listOfQuizzes{}
+%\def\listOfSubmitQuizzes{}
+%\def\initializeAllSubmitQuizzes{}
% \end{macrocode}
% \begin{macro}{\@initQuiz}
% \begin{macro}{\priorInitQuiz}
@@ -4444,7 +4623,7 @@
% \cs{@initQuiz} is executed when you click on `Begin Quiz'. Included here are some
% macro hooks for insert code prior to, and after the quiz initialization. This
% command appears in the commands \cs{eq@@BeginQuizLinkActions} and \cs{eq@@BeginQuizButtonActions} below.
-%\changes{v7.0}{2014/11/05}{Added some JS: lstOfQuizzes is an associative array
+%\changes{v7.0}{2014/11/05}{Added some JS: lstOfQuizzes is an object
% listing all quizzes in the document, the value is the quiz object. We add properties
% isSubmitted and initializeWith to the quiz object.}
% \begin{macrocode}
@@ -4459,7 +4638,7 @@
\oField.RightColorJSLoc=\rghtColorJSLoc;\fi
\ifx\wrngColorJSLoc\@empty\else\jsR
\oField.WrongColorJSLoc=\wrngColorJSLoc;\fi
- \ifx\partialColorJSLoc\@empty\else\r
+ \ifx\partialColorJSLoc\@empty\else\jsR
\oField.PartialColorJSLoc=\partialColorJSLoc;\fi
\ifx\rghtAnsSymbJSLoc\@empty\else\jsR
\oField.RightAnsSymbJSLoc=\rghtAnsSymbJSLoc;\fi
@@ -4469,7 +4648,9 @@
\oField.CorrAnsSymbJSLoc=\corrAnsSymbJSLoc;\fi
\ifx\eqGradeScaleLoc\@empty\else\jsR
\oField.GradeScaleLoc=new Array(\eqGradeScaleLoc);\fi
- \ifx\priorInitQuiz\@empty\else\jsR\priorInitQuiz\fi\jsR
+ \ifx\eqCorrLocalChoiceFully\@empty\else\jsR % dpsf07
+ \oField.fullyCorrectLoc=\eqCorrLocalChoiceFully;\fi
+ \ifx\priorInitQuiz\@empty\else\jsR\priorInitQuiz\fi %\jsR
InitializeQuiz("\curr@quiz",\ifnocorrections0\else1\fi);
\ifx\eq@CGI\@empty\jsR\curr@quiz.isSubmitted=false;\else
\jsR\curr@quiz.isSubmitted=true;\fi
@@ -4512,6 +4693,7 @@
\let\bqlabelFmt\@empty
\def\eq@BeginQuizLink
{%
+ \qz@IDTxtField
\set@@Link{}{}{}{\color{\@linkcolor}\bqlabelFmt\bqlabel}{}%
{\eq@setWidgetProps\setLink@driver}%
{\eq@BeginQuizLinkDefaults\eq@@BeginQuizLinkActions\every@Link}%
@@ -4524,28 +4706,28 @@
% \begin{macrocode}
\newcommand\priorSubmitQuiz{}
\newcommand\postSubmitQuiz{}
-\def\eq@@EndQuizLinkActions
-{%
- \A{\JS{%
- if (!isQuizInitialized("\curr@quiz"))\jsR\jsT
- eqAppAlert(InitMsg("\bqlabelISO"),3);\jsR
- else {\jsR\jsT
- if (\minQuizResp(\thequestionno)) {\jsR\jsT\jsT
- \curr@quiz.PtValues=new %
-Array(\pointValuesArray);\jsR\jsT\jsT
- ProbType = [\ptypeArray];\jsR\jsT\jsT
+\def\eq@@EndQuizLinkActions{\A{\JS{%
+ if (!isQuizInitialized("\curr@quiz"))\jsR\jsT
+ eqAppAlert(InitMsg("\bqlabelISO"),3);\jsR
+ else {\jsR\jsT
+ if (\minQuizResp(\thequestionno)) {\jsR\jsT\jsT
+ \curr@quiz.PtValues=new %
+ Array(\pointValuesArray);\jsR\jsT\jsT
+ ProbType = [\ptypeArray];\jsR\jsT\jsT
\if@inclkey
- \curr@quiz.CorrAns=(new %
-Array(\corrAnsArray));\jsR\jsT\jsT
+ \curr@quiz.CorrAns=(new %
+ Array(\corrAnsArray));\jsR\jsT\jsT
\fi
- DisplayQuizResults("\curr@quiz",\theeqpointvalue,%
-\thequestionno);\jsR\jsT\jsT
-% \priorSubmitQuiz
- \eq@submitURL
- \postSubmitQuiz
- resetQuiz("\curr@quiz");\jsR\jsT
- }\jsR
- }}}%
+ DisplayQuizResults("\curr@quiz",\theeqpointvalue,%
+ \thequestionno);\jsR\jsT\jsT
+ var h=this.getField("ScoreData.\curr@quiz");\jsR\jsT\jsT
+ h.value=Score+";"+NQuestions+";"%
+ +ptScore+";"+NPointTotal;\jsR\jsT\jsT
+ \eq@submitURL
+ \postSubmitQuiz
+ \jsT\jsT resetQuiz("\curr@quiz");\jsR\jsT
+ }\jsR
+ }}}%
}
\def\eq@EndQuizLinkDefaults{\Border{0 0 0}}
\let\eqlabelFmt\@empty
@@ -4560,8 +4742,8 @@ Array(\corrAnsArray));\jsR\jsT\jsT
{\eq@EndQuizLinkDefaults\eq@@EndQuizLinkActions\every@Link}%
\makebox[0pt][r]{\textField[\BC{}\autoCenter{n}]%
{htxtfld.\curr@quiz}{0bp}{0bp}}%
- \makebox[0pt][r]{\eq@insertHiddenFields}\global\let\eq@CGI\@empty
- \ignorespaces
+ \makebox[0pt][r]{\eq@hiddenScoreData\eq@insertHiddenFields}%
+ \global\let\eq@CGI\@empty\ignorespaces
}
% \end{macrocode}
% \end{macro}
@@ -4580,14 +4762,12 @@ Array(\corrAnsArray));\jsR\jsT\jsT
\def\eq@@BeginQuizButtonActions
{%
\A{\JS{%
-% \ifx\priorInitQuiz\@empty\else\priorInitQuiz\r\fi
\@initQuiz
-% \ifx\postInitQuiz\@empty\else\r\postInitQuiz\fi
}}%
}
\newcommand\eq@BeginQuizButton[1][]
{%
- \mbox{\push@@Button{#1}{beginQuiz.\curr@quiz}{}%
+ \mbox{\qz@IDTxtField\push@@Button{#1}{beginQuiz.\curr@quiz}{}%
{\DefaultHeightOfWidget}{\eq@protect\A}%
{\eq@setButtonProps\eq@Button@driver}%
{\BeginQuizButtonDefaults\eq@@BeginQuizButtonActions
@@ -4603,29 +4783,31 @@ Array(\corrAnsArray));\jsR\jsT\jsT
\CA{\eqlabel}\F{\FPrint}\BC{1 0 0}
\BG{.7529 .7529 .7529}\W{1}\S{B}\H{P}
}
-\def\eq@@EndQuizButtonActions
-{%
- \A{\JS
- {if (!isQuizInitialized("\curr@quiz"))\jsR\jsT
- eqAppAlert(InitMsg("\bqlabelISO"),3);\jsR
- else {\jsR\jsT
- if (\minQuizResp(\thequestionno)&&_ModalNotOn){\jsR\jsT\jsT
- \curr@quiz.PtValues=(new %
-Array(\pointValuesArray));\jsR\jsT\jsT
- ProbType=[\ptypeArray];\jsR\jsT\jsT
+\def\eq@@EndQuizButtonActions{\A{\JS{%
+ if (!isQuizInitialized("\curr@quiz"))\jsR\jsT
+ eqAppAlert(InitMsg("\bqlabelISO"),3);\jsR
+ else {\jsR\jsT
+ if (\minQuizResp(\thequestionno)&&_ModalNotOn){\jsR\jsT\jsT
+ \curr@quiz.PtValues=(new %
+ Array(\pointValuesArray));\jsR\jsT\jsT
+ ProbType=[\ptypeArray];\jsR\jsT\jsT
\if@inclkey
- \curr@quiz.CorrAns=(new %
-Array(\corrAnsArray));\jsR\jsT\jsT
+ \curr@quiz.CorrAns=(new %
+ Array(\corrAnsArray));\jsR\jsT\jsT
\fi
- DisplayQuizResults("\curr@quiz",\theeqpointvalue,%
-\thequestionno);\jsR\jsT\jsT
- \eq@submitURL
- \postSubmitQuiz
- resetQuiz("\curr@quiz");\jsR\jsT
- }\jsR
- }}%
- }
-}
+ DisplayQuizResults("\curr@quiz",\theeqpointvalue,%
+ \thequestionno);\jsR\jsT\jsT
+ var h=this.getField("ScoreData.\curr@quiz");\jsR\jsT\jsT
+ h.value=Score+";"+NQuestions+";"%
+ +ptScore+";"+NPointTotal;\jsR\jsT\jsT
+ \eq@submitURL
+ \postSubmitQuiz
+ \jsT\jsT resetQuiz("\curr@quiz");\jsR\jsT
+ }\jsR
+ }}}%
+}
+\newcommand{\eq@hiddenScoreData}{\makebox[0pt][r]{%
+ \textField[\BC{}\F{\FHidden}]{ScoreData.\curr@quiz}{0bp}{0bp}}}
\newcommand\eq@EndQuizButton[1][]
{%
\ifx\eq@CGI\@empty
@@ -4637,7 +4819,8 @@ Array(\corrAnsArray));\jsR\jsT\jsT
{\eq@setButtonProps\eq@Button@driver}%
{\EndQuizButtonDefaults\eq@@EndQuizButtonActions
\every@ButtonField\every@EndQuizButton}}%
- \makebox[0pt][r]{\eq@insertHiddenFields}\global\let\eq@CGI\@empty
+ \makebox[0pt][r]{\eq@hiddenScoreData\eq@insertHiddenFields}%
+ \global\let\eq@CGI\@empty
}
% \end{macrocode}
% \end{macro}
@@ -5000,12 +5183,11 @@ Array(\corrAnsArray));\jsR\jsT\jsT
% text macro \cs{currQuiz} which contains the quiz name. Can be used in conjunction
% with \cs{floatQuiz} and \cs{startQuizHere}.
% }
+% \changes{v8.1k}{2018/02/04}{Added \string\cs{oField} to list in \string\cs{DeclareQuiz}}
% \begin{macrocode}
-\def\DeclareQuiz#1{%
- \edef\thisQuiz{#1}%
- \edef\curr@quiz{#1}%
- \edef\currQuiz{#1}%
- \edef\curr@quiz{#1}%
+\def\DeclareQuiz#1{\edef\oField{#1}%
+ \edef\thisQuiz{#1}\edef\curr@quiz{#1}%
+ \edef\currQuiz{#1}\edef\curr@quiz{#1}%
}
\let\Quiz\DeclareQuiz
% \end{macrocode}
@@ -5393,6 +5575,7 @@ Array(\corrAnsArray));\jsR\jsT\jsT
% `\texttt*', in which case a name of \texttt{\string\curr@quiz.\string\thequestionno}
% is assigned.
% \begin{macrocode}
+% Begin joint package and eqexam
%</package>
%<*package|eqexam>
\def\pushEnvir{\xdef\eq@currenvir{\@currenvir}\endgroup}
@@ -5486,7 +5669,7 @@ Array(\corrAnsArray));\jsR\jsT\jsT
\def\eq@lw@l{\eq@l@l\eq@hspanner}
% \end{macrocode}
% For the link-style MC question, the default width, \cs{eq@l@l}, of the label is the normalsize width of
-% `(d)'. For a form checkbox or radiobutton bux, the default width, cs{eq@lw@f}, is \cs{RadioFieldSize},
+% `(d)'. For a form checkbox or radiobutton, the default width, \cs{eq@lw@f}, is \cs{RadioFieldSize},
% normally defined as \texttt{11bp}.
% \begin{macrocode}
\def\eq@l@l{\normalsize\normalfont(d)}
@@ -5517,8 +5700,8 @@ Array(\corrAnsArray));\jsR\jsT\jsT
\noexpand\eq@ansChoiceArray{,"\alph{quizno}"}}\fi
\tmp@exp
}
-\newcommand\Ans@list[2][0]{\gdef\eq@pPTs{#1}%
- \xdef\Ans@choice{#2}\item\relax\noindent\if\eq@listType\eq@One
+\newcommand\Ans@list[2][0]{\gdef\eq@pPTs{#1}\xdef\Ans@choice{#2}%
+ \item\relax\noindent\if\eq@listType\eq@One
\addtocounter{quizno}{-1}\@ifundefined{ifwithsoldoc}
{\refstepcounter{quizno}}{\ifwithsoldoc\stepcounter{quizno}\else
\refstepcounter{quizno}\fi}\fi
@@ -5552,7 +5735,7 @@ Array(\corrAnsArray));\jsR\jsT\jsT
% to 0pt; when \textsf{eqexam} is used, it has a nonzero value.
% \begin{macrocode}
\ifnum\exerwparts@cols>1\relax
- \ifx\itsExerParts\eq@YES % dps17
+ \ifx\itsExerParts\eq@YES
\setlength{\leftmargin}{\labelwidth}\else
\setlength{\leftmargin}{\labelwidth+\eqemargin}\fi
\else
@@ -5569,6 +5752,7 @@ Array(\corrAnsArray));\jsR\jsT\jsT
% another for \texttt{exerquiz}.
% to the following.
% \begin{macrocode}
+% Begin joint package and eqexam
%</package|eqexam>
%<package> \setlength{\labelsep}{0pt}%
%<package>% \settowidth{\labelsep}{\eq@hspanner}%
@@ -5588,8 +5772,8 @@ Array(\corrAnsArray));\jsR\jsT\jsT
% These parameters are saved in the commands \cs{eq@pPTs} and
% \cs{Ans@choice}.
% \begin{macrocode}
-\newcommand\Ans@tabular[2][0]{\gdef\eq@pPTs{#1}%
- \xdef\Ans@choice{#2}\leavevmode\@Ans
+\newcommand\Ans@tabular[2][0]{\gdef\eq@pPTs{#1}\xdef\Ans@choice{#2}%
+ \leavevmode\@Ans
}
% \end{macrocode}
% (2013/05/17) \DescribeMacro{\sqtabsep} sets the \cs{tabsep} between columns.
@@ -5602,7 +5786,7 @@ Array(\corrAnsArray));\jsR\jsT\jsT
\def\sqTabPos#1{\def\sq@TabPos{[#1]}}\sqTabPos{}
\def\answers@@sq@tabular#1{%
% \ifinner\else\par\vskip-\parskip\vspace{\aboveanswersSkip}\fi
- \ifinner % dps17
+ \ifinner
\ifx\itsExerParts\eq@YES\par\removelastskip
\removelastparskip\vskip\aboveanswersSkip\fi
\else\par\removelastskip\removelastparskip
@@ -5796,42 +5980,28 @@ Array(\corrAnsArray));\jsR\jsT\jsT
\def\sqNoCorrections{\let\@sqAlertsOnly\eq@One}
\def\sqCorrections{\let\@sqAlertsOnly\eq@Zero}
\sqNoCorrections
+\def\Ans@sq@f@ActionsTrue{%
+ \if\@sqTurnOffAlerts1OnBlurRespBox(true,"\oField");\jsR\fi
+ \ifx\@qzsolndest\@empty\else\ifeq@solutionsafter\else
+ jmpToNamedDest("\oField","\@qzsolndest",%
+ \if\@sqTurnOffAlerts00\else1\fi);\fi
+ \fi\eqAddAAMouseUpMC}
+\def\Ans@sq@f@ActionsFalse{%
+ \if\@sqTurnOffAlerts1OnBlurRespBox(false,"\oField" );\jsR\fi
+ \ifx\oField\@empty\else
+ updateTally("\oField.\thequestionno");
+ \fi\jsR\eqAddAAMouseUpMC}
% \end{macrocode}
% The actions for the form version of a multiple choice question of a \texttt{shortquiz}.
% \begin{macrocode}
-\def\Ans@sq@f@Actions
-{%
- \A{\if\Ans@choice\eq@One
- \JS{%
-% \end{macrocode}
-%\changes{v6.7d}{2013/05/27}{removed JS control of checks and color, they
-% are hardwired instead.}
-% \begin{macrocode}
- \if\@sqTurnOffAlerts1OnBlurRespBox(true,"\oField");\jsR\fi
- \ifx\@qzsolndest\@empty\else
- \ifeq@solutionsafter\else
- jmpToNamedDest("\oField","\@qzsolndest",%
-\if\@sqTurnOffAlerts00\else1\fi);\fi
- \fi}%
- \else
- \JS{%
- \if\@sqTurnOffAlerts1OnBlurRespBox( false, %
-"\oField" );\jsR\fi
- \ifx\oField\@empty\else
- updateTally("\oField.\thequestionno");
- \fi}%
- \fi%
- }%
- \AA{\AAMouseDown{\JS{%
- updateTally.downState=!!event.target.isBoxChecked%
-(\arabic{quizno}-1);}}}%
-}
-\def\Ans@proofing
-#1{%
- \ifeq@proofing\if\Ans@choice1\relax
- \llap{\@proofingsymbol\,\hskip#1\relax}%
- \fi\fi
-}
+\def\Ans@sq@f@Actions{\A{\if\Ans@choice\eq@One
+ \JS{\Ans@sq@f@ActionsTrue}\else
+ \JS{\Ans@sq@f@ActionsFalse}\fi}%
+ \AAmousedown{updateTally.downState=!!event.target.isBoxChecked%
+ (\arabic{quizno}-1);}}
+\def\Ans@proofing#1{\ifeq@proofing\if\Ans@choice1\relax
+ \llap{\@proofingsymbol\,\hskip#1\relax}%
+ \fi\fi}
% \end{macrocode}
%\DescribeMacro{\sqRghtSymbChoice}\DescribeMacro{\sqRghtSymbColor} for the \texttt{shortquiz}
% environment, these first two commands assign the right symbol (default check) and
@@ -5947,52 +6117,48 @@ Array(\corrAnsArray));\jsR\jsT\jsT
\catcode`\&=12
\gdef\eq@AND{&&}
\endgroup
-\def\Ans@ck@sq@f@Actions
-{%
- \A{\if\Ans@choice1%
- \JS{%
-var fName=event.target.name;\jsR
-var g=this.getField("mc.\oField.\thequestionno");\jsR
-var a=g.getArray();\jsR
-for (var i=0; i<a.length; i++)\jsR\jsT
- if ( a[i].isBoxChecked(0) \eq@AND\space
-a[i].value.charAt(0)==0)\jsR\jsT\jsT
- a[i].checkThisBox(0,false);\jsR
- \if\@sqTurnOffAlerts1OnBlurRespBox( %
- true, "\oField" );\jsR\fi
- \ifx\@qzsolndest\@empty\else
- \ifeq@solutionsafter\else
-% if all correct answers are check, jump to solution
-for (var i=0; i<a.length; i++){\jsR\jsT
- if ( a[i].exportValues[0].charAt(0)==1 \eq@AND\space
-!a[i].isBoxChecked(0) )\jsR\jsT\jsT
- break;\jsR
-}\jsR
- if (i>=a.length) jmpToNamedDest("\oField","\@qzsolndest",%
- \if\@sqTurnOffAlerts00\else1\fi);
- \fi
- \fi}%
- \else%
- \JS{%
-var fName=event.target.name;\jsR
-var g=this.getField("mc.\oField.\thequestionno");\jsR
-var a=g.getArray();\jsR
-for (var i=0; i<a.length; i++)\jsR
-{\jsR\jsT
- if (a[i].value.charAt(0)==0) {\jsR\jsT\jsT
- if ( fName != a[i].name )\jsR\jsT\jsT\jsT
- a[i].checkThisBox(0,false);\jsR\jsT
- }\jsR
-}\jsR
- \if\@sqTurnOffAlerts1OnBlurRespBox( false, "\oField" );\fi%
- \ifx\oField\@empty\else%
- updateTally("\oField.\thequestionno");
- \fi}%
- \fi%
- }%
- \AA{\AAMouseDown{%
-\JS{updateTally.downState=!!event.target.isBoxChecked(0);}}}
-}
+\def\Ans@ck@sq@f@ActionsTrue{%
+ var fName=event.target.name;\jsR
+ var g=this.getField("mc.\oField.\thequestionno");\jsR
+ var a=g.getArray();\jsR
+ for (var i=0; i<a.length; i++)\jsR\jsT
+ if ( a[i].isBoxChecked(0) \eq@AND\space
+ a[i].value.charAt(0)==0)\jsR\jsT\jsT
+ a[i].checkThisBox(0,false);\jsR
+ \if\@sqTurnOffAlerts1OnBlurRespBox(%
+ true,"\oField");\jsR\fi
+ \ifx\@qzsolndest\@empty\else
+ \ifeq@solutionsafter\else
+ % if all correct answers are check, jump to solution
+ for (var i=0; i<a.length; i++){\jsR\jsT
+ if ( a[i].exportValues[0].charAt(0)==1 \eq@AND\space
+ !a[i].isBoxChecked(0))\jsR\jsT\jsT
+ break;\jsR
+ }\jsR
+ if (i>=a.length) jmpToNamedDest("\oField","\@qzsolndest",%
+ \if\@sqTurnOffAlerts00\else1\fi);
+ \fi
+ \fi\eqAddAAMouseUpMS}
+\def\Ans@ck@sq@f@ActionsFalse{%
+ var fName=event.target.name;\jsR
+ var g=this.getField("mc.\oField.\thequestionno");\jsR
+ var a=g.getArray();\jsR
+ for (var i=0; i<a.length; i++)\jsR
+ {\jsR\jsT
+ if (a[i].value.charAt(0)==0) {\jsR\jsT\jsT
+ if ( fName != a[i].name )\jsR\jsT\jsT\jsT
+ a[i].checkThisBox(0,false);\jsR\jsT
+ }\jsR
+ }\jsR
+ \if\@sqTurnOffAlerts1OnBlurRespBox( false, "\oField" );\fi
+ \ifx\oField\@empty\else
+ updateTally("\oField.\thequestionno");
+ \fi\eqAddAAMouseUpMS}
+\def\Ans@ck@sq@f@Actions{%
+ \A{\if\Ans@choice\eq@One
+ \JS{\Ans@ck@sq@f@ActionsTrue}\else
+ \JS{\Ans@ck@sq@f@ActionsFalse}\fi}%
+ \AAmousedown{updateTally.downState=!!event.target.isBoxChecked(0);}}
\def\Ans@ck@sq@f{%
\if\eq@listType\eq@One\stepcounter{quizno}\else
\@ifundefined{ifwithsoldoc}{\refstepcounter{quizno}}
@@ -6604,6 +6770,7 @@ if (_bOK) {\jsR\jsT
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
+% Begin joint package and eqexam
%</package>
%<*package|eqexam>
% \end{macrocode}
@@ -6983,9 +7150,11 @@ if (_bOK) {\jsR\jsT
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
+% end joint package and eqexam
%</package|eqexam>
% \end{macrocode}
% \begin{macrocode}
+% Begin randomize segment
%<*randomize>
% \end{macrocode}
%
@@ -7029,6 +7198,13 @@ if (_bOK) {\jsR\jsT
\endgroup
}
% \end{macrocode}
+% \DescribeMacro{\writeSeedToSolnFile} writes the current
+% value of \cs{randomi} to the solution file. May be useful in randomizing choices
+% in the solution file in the same order they were randomized in the main document.
+% \changes{v7.8h}{2017/04/14}{Added \string\cs{writeSeedToSolnFile}}
+% \begin{macrocode}
+\def\writeSeedToSolnFile{\writeToExSolns{\string\randomi=\the\randomi}}
+% \end{macrocode}
% The \cs{bChoices} command is now processed by the \texttt{keyval} package. There
% are two keys: \texttt{nCols} and \texttt{random}. The first key
% sets the number of columns we are limited to; the second one obviously declares
@@ -7386,12 +7562,6 @@ if (_bOK) {\jsR\jsT
% In the case of the author using Acrobat 4.0, he/she needs to load
% manually insert the \texttt{eq\_DLJS.pdf} file. If only exercises
% are used, this insertion is not needed.
-% \begin{macrocode}
-%</package>
-% \end{macrocode}
-% \begin{macrocode}
-%<*package>
-% \end{macrocode}
% \begin{environment}{oQuestion}
% This was my first attempt and I have not deleted it from the package yet.
% Useful for posing a single question only. The argument is the (unique) name
@@ -7410,8 +7580,8 @@ if (_bOK) {\jsR\jsT
\xdef\eq@pageThisQ{\the\c@page}%
\global\let\eqQzQuesList\@empty
\xdef\oField{#1}\xdef\curr@quiz{#1}\xdef\currQuiz{#1}%
- \let\@qzsolndest\@empty
- \stepcounter{questionno}%
+ \g@addto@macro\ListOfSQuizNames{,#1}\let\@qzsolndest\@empty
+% \stepcounter{questionno}%
\let\eqQuizType\isSQZ\gdef\eqPTs{1}\global\let\eqQT\eq@na
\let\answers\answers@sq
\let\endanswers\endanswers@sq
@@ -7425,6 +7595,7 @@ if (_bOK) {\jsR\jsT
\global\let\aebtitleQuiz\@empty
\global\let\aebTitleQuiz\@empty
\global\let\eq@tq@star\relax
+ \aftergroup\ignorespaces
}
\def\oSolution#1{\edef\@qzsolndest{#1}}
% \end{macrocode}
@@ -7497,6 +7668,24 @@ if (_bOK) {\jsR\jsT
% \texttt{(r:x,r:y,i:n)}, where \texttt{"r"} means a real variable and \texttt{"i"}
% means an integer variable. The variables must be either of the old style (no commas, no typing)
% or the new style. Do not mix the styles.
+%
+% \changes{v8.0}{2017/08/08}{Support for multi-letter variables and alternate appearances}
+% \textbf{Multi-letter variables.} Beginning with v8.0 (2017/08/08) support for multi-letter variables and appearance replacement
+% is added. Within the \texttt{\#3}, use the following notation:
+%\begin{verbatim}
+% (x\rpl{alpha}{y}z)
+%\end{verbatim}
+%This declares three variables, \texttt{x}, \texttt{alpha}, and \texttt{z}. What in fact is
+%taking place is that \texttt{alpha} is replaced by \texttt{y} and processing continues from there.
+%
+% \textbf{Alternate appearances.} Additionally, there is now a scheme for replacing the variables
+% with alternate appearances.
+%\begin{verbatim}
+% (x\rpl{alpha->\\u03B1}{y}z)
+%\end{verbatim}
+%The arrow notation (\texttt{->}) tells \pkg{exerquiz} to replace \texttt{alpha} with the unicode character
+%\verb~\u03B1~ (note the double backslash above), which is the Greek letter alpha ($\alpha$).
+%
% \item[\ttfamily\#4 :] Optional, a named destination to the solution to the
% question. If this parameter appears, then a solution must follow the
% question, enclosed in a \texttt{solution} environment.
@@ -7529,36 +7718,101 @@ if (_bOK) {\jsR\jsT
%\begin{flushleft}\footnotesize
%|\RespBoxMath{<exp(t), 2*t, sin(t)>}(t)[soln]{3}{.0001}{0}{1}[compare]*{ProcVec}|
%\end{flushleft}
-% \begin{macrocode}
-\newcommand\RespBoxNT{\def\rbFlag{0}\@RespBox}
-\newcommand\RespBox{\def\rbFlag{0}\@RespBox}
-\newcommand\RespBoxMath{\def\rbFlag{0}\@RespBox}
-% \end{macrocode}
-% These commands can be used define the default appearance of the \cs{RespBoxMath},
-% \cs{RespBoxTxt} et al. This first set controls all standard text fields.
-% \begin{macrocode}
+% \changes{v8.1}{2017/09/02}{Sanitize superscript before reading parameters in \string\cs{RespBoxMath}}
+% \begin{macrocode}
+\newcommand\RespBoxNT{\RespBoxMath}
+\newcommand\RespBox{\RespBoxMath}
+% \end{macrocode}
+% (2018/03/21) Exclude unicode from \cs{RespBoxMath}
+% \changes{v8.2.2}{2018/03/21}{Exclude unicode from \string\cs{RespBoxMath}}
+% \begin{macrocode}
+\newcommand\RespBoxMath{\def\rbFlag{0}\begingroup\Hy@unicodefalse
+ \@makeother\^\@makeother\&\@RespBox}
+% \end{macrocode}
+% Within \cs{RespBoxMath}, \cs{rpl} (\cs{rpl=\texttt{\underbar{r}e\underbar{pl}ace}}) is \cs{let} to \cs{eq@rpl}. The command \cs{rpl}, used
+% within the variable argument of \cs{RespBoxMath}, declares a multi-letter variable. There are
+% two styles, one an extension of the other: (1) |\rpl{alpha}{x}|, declares that the multi-letter
+% variable `\texttt{alpha}' is the same as the usual single variable `\texttt{x}'; (2) |\rpl{alpha->\\u03B1}{x}| declare
+% the variable `\texttt{alpha}' to be the same as `\texttt{x}', it also says to use |\\u0381| as the
+% format appearance of `\texttt{alpha}'.
+% \changes{v7.9a}{2017/08/05}{Added \string\cs{eq@rpl} to support multi-letter variables}
+% \begin{macrocode}
+\def\eq@rpl#1#2{_rplVarsBy('#1','#2')@} % dps17
+% \end{macrocode}
+% A variation on the objective style math problem, is to initially populate the response box with an
+% incorrect answer and ask the student to correct it. (Good for future teachers.) The problem type set
+% straightforward when multi-variables are not used, just specify the \cs{V} and \cs{DV} keys in the
+% optional argument of \cs{RespBoxMath}. When multi-variables are used, we have to precede the question
+% with \DescribeMacro{\setInitAltAppr}\cs{setInitAltAppr}. There are two variations, the first is for
+% a non-\app{dvips/Distiller} workflow (document JavaScript are embedded at the creation of the PDF;
+% the second variation is with Distiller, where the document JavaScript is embedded with \app{Acrobat}
+% after the creation of the PDF. In the latter case, the JavaScript functions used below (\texttt{processMathVars},
+% \texttt{getSubstValue}, and \texttt{RespBoxAppr} are not available yet when the document is initially
+% opened in \app{Acrobat}. As a result, an exception is thrown. When the exception is thrown,
+% \texttt{app.setTimeOut} gives a delay and the field is reset after 25 milliseconds, this causes
+% the \emph{initial} alternate appearance to appear, if that is desired.
+% \changes{v8.1a}{2017/09/03}{Add \string\cs{setInitAltAppr} for setting the initial alternate appearance}
+% \begin{macrocode}
+\ifnum\eq@drivernum=0\def\RorRT{\r\t}\else\def\RorRT{\r}\fi
+\def\toAltApprCnt{0}\def\toAltApprVar{_toAltAppr\toAltApprCnt}
+\def\toAltApprCntInc{{\@tempcnta=\toAltApprCnt\relax
+ \advance\@tempcnta1\relax
+ \xdef\toAltApprCnt{\the\@tempcnta}}}
+\def\setCoreInitAltAppr{%
+ var\eqSP_substVars=\indepVars;\RorRT
+ var\eqSP_mathVars=processMathVars(_substVars);\RorRT
+ var\eqSP_substValue=getSubstValue(_substVars,event.value);\RorRT
+ event.value=RespBoxAppr(event);\RorRT
+ getSubstValue.aSubsts=[];%
+}
+\def\bInitAltAppr{\ifShowAppr
+ \def\ShowApprSAVE{true}\toAltApprCntInc\ShowApprfalse
+ \def\eqAddAAFormat{\ifnum\eq@drivernum=0try\eqLBr\RorRT\fi
+ \setCoreInitAltAppr\ifnum\eq@drivernum=0 \r\eqRBr catch(e){\RorRT
+ var\eqSP\toAltApprVar=%
+ app.setTimeOut('this.resetForm("'+event.target.name+'");%
+ app.clearTimeOut(\toAltApprVar);',250);\r}\fi}\else
+ \def\ShowApprSAVE{false}\fi
+}
+\def\eInitAltAppr{\@nameuse{ShowAppr\ShowApprSAVE}%
+ \ifShowAppr\altApprOn\let\eqAddAAFormat\@empty\fi}
% \end{macrocode}
% Get any changes in the appearance of the text box
% \changes{v6.4c}{2011/07/01}{\cs{RespBoxMath} now records its lists of
% independent variables under the global variable \texttt{\_mathVars}.}
% \begin{macrocode}
-\begin{defineJS}[%
- \catcode`\%=14\relax\catcode`\@=0\relax]{\AAKqRespBoxMath}
-if(event.willCommit){
- RecordPointValue(@eqPTs,@thequestionno@ifx@grpquestions1,%
-@thegrpquestionno,@grpPointValue,@grpTotalWeight,%
-"@grpEvalFunction"@fi);
- RecordProblemType("@eqQT",@thequestionno);
- _mathVars=@indepVar;
- var retn = @processJSfunc(@rbArgs,@compareJSfunc);
- ProcUserResp(retn,event.value,@thequestionno,%
-0@ifx@grpquestions1,@thegrpquestionno@fi);
-}
-if (!isQuizInitialized("@currQuiz")) {
- @eqObjAlert@space eqAppAlert(InitMsg("@bqlabelISO"),3);
- event.rc = false;
+\def\AAKqRespBoxMath{%
+% \end{macrocode}
+% \cs{AAKqRespBoxMath} is the default keystroke action script for \cs{RespBoxMath}
+% \begin{macrocode}
+ if(event.willCommit){\r\t
+ RecordPointValue(\eqPTs,\thequestionno\ifx\grpquestions1,%
+\thegrpquestionno,\grpPointValue,\grpTotalWeight,%
+"\grpEvalFunction"\fi);\r\t
+ RecordProblemType("\eqQT",\thequestionno);\r\t
+% \end{macrocode}
+% If there are substitute variables, \cs{ifSubstVars} is true, and the script below
+% are the lines developed in support of multi-letter variables.
+% \begin{macrocode}
+\ifSubstVars % dps17
+ var\eqSP_substVars=\indepVars;\r\t
+ var\eqSP_mathVars=processMathVars(_substVars);\r\t
+ var\eqSP_substValue=getSubstValue(_substVars,event.value);\r\t
+ var\eqSP_substAns=getSubstValue(_substVars,"\eqCorrectAns");\r\t
+ var\eqSP retn=\processJSfunc(\rbArgs,%
+ \compareJSfunc,_substValue);\r\t
+\else
+ var\eqSP_mathVars=\indepVars;\r\t
+ var\eqSP retn=\processJSfunc(\rbArgs,\compareJSfunc);\r\t
+\fi
+ ProcUserResp(retn,event.value,\thequestionno,%
+0\ifx\grpquestions1,\thegrpquestionno\fi);\r
+ }\r
+ if (!isQuizInitialized("\currQuiz")) {\r\t
+ \eqObjAlert\space eqAppAlert(InitMsg("\bqlabelISO"),3);\r\t
+ event.rc = false;\r
+ }
}
-\end{defineJS}
\def\RespBoxMathDefaults
{%
\BC{0 0 0}\S{S}\textColor{0 g}\F{\FPrint}\W{1}
@@ -7571,88 +7825,122 @@ if (!isQuizInitialized("@currQuiz")) {
\else\noexpand\Ff{\FfReadOnly}\fi\fi\fi
}%
}
-\let\eqFormatArg\@empty
-\def\@@RespBoxMathActions
-{%
- \AA{\if\eqQuizType\isQZ
- \AAKeystroke{\AAKqRespBoxMath\eqAAKeystrokeArg}
- \AAFormat{\eqFormatArg}
- \else
- \AAKeystroke{if(event.willCommit) {\r\t
- _mathVars=\indepVar;\r\t
- retn=\processJSfunc(\rbArgs,\compareJSfunc);\r
-\if\@sqTurnOffAlerts1
- \t OnBlurRespBox(%
- \if\@sqTurnOffAlerts1retn\else null\fi,"\curr@quiz");
- \eqAAKeystrokeArg\r
+\let\eqAddAAFormat\@empty
+% \end{macrocode}
+% \DescribeMacro{\eqSP}\cs{eqSP} is a space character to keep \textsf{dvips} from breaking lines at space.
+% \begin{macrocode}
+\def\eqSP{\string\040} % dps17
+\def\eqLBr{\string\173}
+\def\eqRBr{\string\175}
+\def\@@RespBoxMathActions{%
+ \AA{\if\eqQuizType\isQZ
+ \AAKeystroke{\AAKqRespBoxMath\eqAddAAKeystroke}
+ \AAFormat{\ifShowAppr\ifSubstVars\ifarrowDelim % dps17
+% \end{macrocode}
+% The \texttt{RespBoxApp()} JavaScript function replaces the multi-letter variable (\texttt{alpha}, for example)
+% with its appearance (|\\u03B1|, eg).
+% \begin{macrocode}
+ try{event.value=RespBoxAppr(event);}catch(e){}\r
+ \fi\fi\fi\eqAddAAFormat}
+ \else
+ \AAKeystroke{if(event.willCommit) {\r\t
+\ifSubstVars%
+% \end{macrocode}
+% If there are multi-letter variables (\cs{SubstVarstrue}), we insert the code developed.
+% \begin{macrocode}
+ var\eqSP_substVars=\indepVars;\r\t
+ var\eqSP_mathVars=processMathVars(_substVars);\r\t
+ var\eqSP_substValue=getSubstValue(_substVars,event.value);\r\t
+ var\eqSP_substAns=getSubstValue(_substVars,"\eqCorrectAns");\r\t
+ var\eqSP retn=\processJSfunc(\rbArgs,%
+ \compareJSfunc,_substValue);\r\t
+\else
+ var\eqSP_mathVars=\indepVars;\r\t
+ var\eqSP retn=\processJSfunc(\rbArgs,\compareJSfunc);
\fi
- }%
- }
- \AAFormat{\eqFormatArg}%
- \AAOnFocus{\JS{var retn = null;}}%
- \AAOnBlur{\JS{OnBlurRespBox(null,"\curr@quiz");}}%
- \fi
- }
+\if\@sqTurnOffAlerts1\r\t
+ OnBlurRespBox(retn,"\curr@quiz");
+\fi
+% \end{macrocode}
+% Moved \cs{eqAAKeystrokArg} from the conditional to the position below.
+% \changes{v7.8i}{2017/07/21}{Moved \string\cs{eqAAKeystrokArg}}
+% \begin{macrocode}
+ \eqAddAAKeystroke\r
+ }}
+ \AAFormat{\ifShowAppr\ifSubstVars\ifarrowDelim % dps17
+ try{event.value=RespBoxAppr(event);}catch(e){}\r\fi\fi\fi
+ \eqAddAAFormat}%
+ \AAOnFocus{\JS{var retn = null;}}%
+ \AAOnBlur{\JS{OnBlurRespBox(null,"\curr@quiz");}}%
+\fi
+ }
}
+\def\annot@subtype@rbm{rbm}
\newcommand\@RespBox[1][]
{%
- \eq@AddProbToQzQuesList
- \smallskip\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,"math"]}%
- \stepcounter{questionno}%
- \def\Fld@name{obj.\curr@quiz.\thequestionno}%
- \fi
- \else % shortquiz
- \ifx\grpquestions\eq@One
- \stepcounter{grpquestionno}%
- \def\Fld@name{%
- grpobj.\oField.\thequestionno.\thegrpquestionno}%
- \else
- \stepcounter{questionno}%
- \def\Fld@name{%
- obj.\oField.\thequestionno}%
- \fi
+ \edef\annot@subtype{\annot@subtype@rbm}%
+ \eq@AddProbToQzQuesList
+ \smallskip\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,"math"]}%
+ \stepcounter{questionno}%
+ \def\Fld@name{obj.\curr@quiz.\thequestionno}%
+ \fi
+ \else % shortquiz
+ \ifx\grpquestions\eq@One
+ \stepcounter{grpquestionno}%
+ \def\Fld@name{%
+ grpobj.\oField.\thequestionno.\thegrpquestionno}%
+ \else
+ \stepcounter{questionno}%
+ \def\Fld@name{%
+ obj.\oField.\thequestionno}%
\fi
+ \fi
% \end{macrocode}
% Changed (v6.3f, 2008/10/08) the command \cs{array} to \cs{Array} to avoid clashing with the
% array command defined in \texttt{amsmath}.
% \begin{macrocode}
- \let\Array\aeb@array
- \moreRespBoxMathDefaults
+ \let\Array\aeb@array
+ \moreRespBoxMathDefaults
% \end{macrocode}
% (2014/01/23) This is tricky, I'm enclosing \cs{text@@Field} in an \cs{mbox}, beginning here
% \begin{macrocode}
- \leavevmode\hbox\bgroup\text@@Field{#1}{\Fld@name}%
- {\RBW}{\DefaultHeightOfWidget}%
- {\eq@protect\AA}{\eq@setWidgetProps\eq@RespBox}%
- {\RespBoxMathDefaults\@moreRespBoxMathDefaults
- \@@RespBoxMathActions\every@eqTextField\every@RespBoxMath}%
+ \leavevmode\hbox\bgroup\let\rpl\eq@rpl
+ \text@@Field{#1}{\Fld@name}%
+ {\RBW}{\DefaultHeightOfWidget}%
+ {\eq@protect\AA}{\eq@setWidgetProps\eq@RespBox}%
+ {\RespBoxMathDefaults\@moreRespBoxMathDefaults
+ \@@RespBoxMathActions\every@eqTextField\every@RespBoxMath}%
}
% \end{macrocode}
% Get the second parameter, which is the correct answer to the question, and
% test to see if there is a specification for the optional third parameter,
% which is the variable list, `\texttt x' is the default.
+% \changes{v8.1}{2017/09/02}{Sanitize superscript before \string\cs{pdfstringdef} is applied}
+% \changes{v8.1c}{2017/09/30}{Define \string\cs{eqCorrectAnsTeX} to display the answer
+% in preview mode.}
% \begin{macrocode}
-\def\eq@RespBox#1{\gdef\eqCorrectAns{#1}\if\grpquestions\eq@Zero
+\def\eq@RespBox#1{\pdfstringdef\eqCorrectAns{#1}%
+ \gdef\eqCorrectAnsTeX{#1}\if\grpquestions\eq@Zero
% \end{macrocode}
% If not within a \texttt{mathGrp} environment, if within a MCFI command pair we save the author's
% answer as \cs{s@veCorrAnsMCFI}; otherwise, we record the author's answer. If within
% \texttt{mathGrp} environment, we record is as part of the group array to be use later.
% \begin{macrocode}
- \ifwithinMCFI\gdef\s@veCorrAnsMCFI{"#1"}\else
-% \eq@recordCorrAns{"#1"}
-\fi\else\eq@recordGrpAnsArray{"#1"}\fi
- \@ifnextchar({\@eq@RespBox{#1}}{\@eq@RespBox{#1}(x)}}
+ \ifwithinMCFI\gdef\s@veCorrAnsMCFI{"#1"}\fi
+ \else
+ \eq@recordGrpAnsArray{"#1"}\fi
+ \@ifnextchar({\@eq@RespBox{#1}}{\@eq@RespBox{#1}(x)}}
% \end{macrocode}
% Pick up the optional third parameter, then test whether the optional fourth parameter is there.
% There are two forms: the [mydest] an explicit destination for the solution to the problem, or
@@ -7660,8 +7948,8 @@ if (!isQuizInitialized("@currQuiz")) {
% \texttt{[\string\curr@quiz.\string\thequestionno]}.
% \begin{macrocode}
\def\@eq@RespBox#1(#2){\@ifnextchar[{\@eq@RespB@x{#1}(#2)}%
- {\@ifstar{\@eq@RespB@x{#1}(#2)[\curr@quiz.\thequestionno]}%
- {\@eq@RespB@x{#1}(#2)[]}}}
+ {\@ifstar{\@eq@RespB@x{#1}(#2)[\curr@quiz.\thequestionno]}%
+ {\@eq@RespB@x{#1}(#2)[]}}}
% \end{macrocode}
% Now get the next three parameters: the number of samples, the precision, and the first of the
% two interval parameters.
@@ -7676,18 +7964,172 @@ if (!isQuizInitialized("@currQuiz")) {
% \cs{eq@defaultRDPrecision} which can be set by \cs{defaultRDPrecision}. The default definition
% is \verb!\defaultRDPrecision{1E-14}!.
% \begin{macrocode}
-\def\@eq@RespB@x#1(#2)[#3]#4#5#6{\xdef\@qzsolndest{#3}%
- \def\indepVar{"#2"}\def\eq@precision{#5}%
+\newif\ifarrowDelim\arrowDelimfalse % dps17
+% \end{macrocode}
+% The problem is to detect when \cs{indepVars} contains the arrow notation (\verb~->~), this signals
+% that the appearance of the user's response is to be replaced by another appearance. The command
+% \cs{GiiRpli} attempts to do just that, it sets \cs{arrowDelim} to true if an arrow is detectect,
+% otherwise, to false.
+% \begin{macrocode}
+\def\rpl@#1#2{\rpl@i#1->\@nil}
+\def\rpl@i#1->#2\@nil{\def\argii{#2}\ifx\argii\@empty\else
+ \global\arrowDelimtrue\fi}
+\def\GiiRpli#1{\global\arrowDelimfalse\GiiRplii#1\rpl{}{}\@nil}
+\def\GiiRplii#1\rpl#2#3#4\@nil{\def\argiv{#4}%
+ \ifx\argiv\@empty\let\eq@next\relax\else
+ \rpl@{#2}{#3}\ifarrowDelim\let\eq@next\relax\else
+ \def\eq@next{\GiiRplii#4\@nil}\fi\fi
+ \eq@next}
+% \end{macrocode}
+% \textbf{Is arrow specified?} \cs{isAltApprSpec} determines whether the delimiter `\texttt{->}' is present, if it is
+% we set |\global\arrowDelimtrue|, otherwise it is globally set to false. Its supporting
+% code is listed above: \cs{rpl@} and \cs{GiiRpli}
+% \begin{macrocode}
+\def\isAltApprSpec#1{\bgroup\if\frstIsrpl\eq@YES\GiiRpli{#1}\else
+ \expandafter\GiiRpli\expandafter{#1}\fi\egroup} % dps17
+% \end{macrocode}
+% If the independent variables are passed as a command, we need
+% to expand first; on the other hand, if the argument is literal and begins with \cs{rpl}
+% we do not expand first. This is to get a correct determination of \cs{ifSubstVars}
+% and \cs{ifarrowDelim}.
+% \begin{macrocode}
+\def\isFrstrpl#1#2\@nil{\ifx#1\rpl\let\frstIsrpl\eq@YES\else
+ \let\frstIsrpl\eq@NO\fi}
+% \end{macrocode}
+% Macros to count the number of independent variables
+% \begin{macrocode}
+\def\cntComm@s#1{\@tempcnta\z@\expandafter\cntComm@si#1,,\@nil}
+\def\cntComm@si#1,#2,\@nil{\def\argii{#2}\ifx\argii\@empty
+ \def\eq@next{\edef\nC{\the\@tempcnta}}\else
+ \advance\@tempcnta\@ne\def\eq@next{\cntComm@si#2,\@nil}\fi
+ \eq@next}\def\eq@SC{;}\def\rplSofT#1#2{#2}
+\def\cntVars#1{\let\rpl\rplSofT\edef\eV@rs{#1}\let\rpl\eq@rpl
+ \cntComm@s{\eV@rs}\ifnum\nC>\z@
+ \@tempcnta\nC\relax\advance\@tempcnta\@ne
+ \xdef\nV{\the\@tempcnta}\else\@tempcnta\z@
+ \expandafter\cntVarsi\eV@rs;\@nil\fi}
+ \def\cntVarsi#1#2\@nil{\def\argii{#2}%
+ \ifx\argii\eq@SC\def\eq@next{\advance\@tempcnta\@ne
+ \edef\nV{\the\@tempcnta}}\else\advance\@tempcnta\@ne
+ \def\eq@next{\cntVarsi#2\@nil}\fi
+ \eq@next}
+\def\eq@X{x}
+% \end{macrocode}
+% It there repetition? (\texttt{[0,1]*3}, eg)
+% \begin{macrocode}
+\def\eq@isThereRept#1{\let\eq@isRept\eq@Zero\expandafter
+ \eq@isThereRepti#1*\@nil}
+\def\eq@isThereRepti#1*#2\@nil{\def\argii{#2}\ifx\argii\@empty
+ \let\eq@isRept\eq@Zero\else\let\eq@isRept\eq@One\fi}
+% \end{macrocode}
+% Expand repetition if present (\texttt{[0,1]*3=[0,1]x[0,1]x[0,1]}, eg)
+% \begin{macrocode}
+\def\eq@obeyReptOfIntrvls#1{%
+ \expandafter\eq@isThereRept\expandafter{#1}% sets \eq@isRept
+ \if\eq@isRept\eq@Zero\relax\let\eq@interv@ls\@empty\expandafter
+ \g@addto@macro\expandafter\eq@interv@ls
+ \expandafter{#1}\let\eq@next\relax\else\let\eq@interv@ls\@gobble
+ \def\eq@next{\expandafter
+ \eq@obeyReptOfIntrvlsi#1x[]x\@nil}\fi\eq@next}
+\def\eq@obeyReptOfIntrvlsi#1[#2]#3#4x#5\@nil{%
+ \def\argi{#2}\def\argii{#3}\def\argiv{#5}%
+ \ifx\argi\@empty\let\eq@next\relax\else
+ \ifx\argii\eq@X\g@addto@macro\eq@interv@ls{x[#2]}%
+ \def\eq@next{\eq@obeyReptOfIntrvlsi#4x#5x\@nil}\else
+ % repetition of an interval
+ \eq@ddtorepIntrvl{[#2]}{#4}%
+ \def\eq@next{\eq@obeyReptOfIntrvlsi#5x\@nil}\fi
+ \fi
+ \eq@next
+}
+\def\eq@ddtorepIntrvl#1#2{\@tempcnta=#2 \eq@ddtorepIntrvli{#1}{#2}}
+\def\eq@ddtorepIntrvli#1#2{\@whilenum\@tempcnta>\z@\do
+ {\g@addto@macro\eq@interv@ls{x#1}\advance\@tempcnta\m@ne}}
+% \end{macrocode}
+% Macros to count the number of intervals. First determine if there
+% are repetitions if so, expand them \cs{eq@obeyReptOfIntrvls} returns
+% the expanded intervals in \cs{eq@interv@ls}
+% \begin{macrocode}
+\def\cntIv@ls#1{\@tempcnta\z@\expandafter\cntIv@lsi#1xxx\@nil}%
+% \end{macrocode}
+% Before counting the intervals, determine if there is repetition, if so
+% expand those intervals appropriately.
+% \begin{macrocode}
+\def\cntIv@lsi#1x#2x\@nil{\def\argii{#2}\ifx\argii\eq@X
+ \advance\@tempcnta\@ne
+ \edef\nI{\the\@tempcnta}\let\eq@next\relax\else
+ \advance\@tempcnta\@ne\def\eq@next{\cntIv@lsi#2x\@nil}\fi
+\eq@next}
+% \end{macrocode}
+% A interval specification might have an intersection in it (\texttt{\&}, so for the purpose
+% of counting, we count the intervals up to the first ampersand.
+% \changes{v8.1b}{2017/09/06}{Fixed a problem with the use of \string\cs{RespBoxMath}
+% when it is within a tabular environment.}
+% \begin{macrocode}
+\begingroup\@makeother\&
+\gdef\eq@ProcIntrvls#1{\expandafter
+ \eq@ProcIntrvlsi#1&&\@nil}
+\gdef\eq@ProcIntrvlsi#1&#2&#3\@nil{\def\argii{#2}%
+ \ifx\argii\@empty
+% \end{macrocode}
+% The intervals do not contain an ampersand.
+% Expand intervals, if necessary result returns in \cs{eq@interv@ls}
+% \begin{macrocode}
+ \eq@obeyReptOfIntrvls{#1}%
+% \end{macrocode}
+% Count the intervals
+% \begin{macrocode}
+ \cntIv@ls{\eq@interv@ls}%
+ \else
+% \end{macrocode}
+% The intervals contain an ampersand (union of two intervals of equal dimension assumed,
+% \meta{interval${}_1$}\texttt{\&}\meta{interval${}_1$}).
+% Expand the first set of union.
+% \begin{macrocode}
+ \eq@obeyReptOfIntrvls{#1}%
+% \end{macrocode}
+% Save this result in \cs{interv@ls}
+% \begin{macrocode}
+ \edef\interv@ls{\eq@interv@ls}%
+ \cntIv@ls{\eq@interv@ls}%
+% \end{macrocode}
+% Expand the second set of union
+% \begin{macrocode}
+ \eq@obeyReptOfIntrvls{#2}%
+ \edef\eq@interv@ls{\interv@ls&\eq@interv@ls}%
+ \fi
+}
+\endgroup
+% \end{macrocode}
+% \cs{RespBoxMath} continues here
+% \begin{macrocode}
+\def\@eq@RespB@x#1(#2)[#3]#4#5#6{\xdef\@qzsolndest{#3}% dps17
+ \gdef\indepVars{"#2"}\isFrstrpl#2\@nil\if\frstIsrpl\eq@YES
+ \def\@IVi{#2}\else\expandafter\def\expandafter
+ \@IVi\expandafter{#2}\fi\edef\@IVii{#2}\ifx\@IVi\@IVii
+% \end{macrocode}
+% If \cs{indepVars} (\texttt{\#2}) does not contain \cs{rpl}, the two versions
+% of \cs{@IVi} and \cs{@IVii} should compare favorably. If they differ, the difference
+% is due to the presence of \cs{rpl}.
+% \begin{macrocode}
+ \global\SubstVarsfalse\else\global\SubstVarstrue
+ \isAltApprSpec{#2}\fi
+% \end{macrocode}
+% \textbf{Counting number of variables.} We count the number of independent variables.
+% \begin{macrocode}
+ \cntVars{#2}\def\eq@precision{#5}%
\ifx\eq@precision\eq@ZERO
\def\eq@defaultCompare{reldiffCompare}%
% \end{macrocode}
% (2017/01/11) Replace \texttt{\#1} by \cs{eqCorrectAns} to delay expansion
% \changes{v7.8d}{2017/01/11}{Replace \string\texttt{\#1} by \string\cs{eqCorrectAns} to delay expansion}
% \begin{macrocode}
- \def\rbArgstmp{%
- \rbFlag,"\eqCorrectAns",#4,\eq@defaultRDPrecision}\else
- \def\eq@defaultCompare{diffCompare}%
- \def\rbArgstmp{\rbFlag,"\eqCorrectAns",#4,#5}\fi
+ \def\rbArgstmp{\rbFlag,% dps17
+ \ifSubstVars_substAns\else"#1"\fi,#4,%
+ \eq@defaultRDPrecision}\else
+ \def\eq@defaultCompare{diffCompare}%
+ \def\rbArgstmp{\rbFlag,% dps17
+ \ifSubstVars_substAns\else"#1"\fi,#4,#5}\fi
% \end{macrocode}
% We have arrived at the first of possibly two parameters that define the interval(s)
% from which to sample random points. There are two forms, the old style (deprecated)
@@ -7696,22 +8138,22 @@ if (!isQuizInitialized("@currQuiz")) {
% (10/10/11) To support \cs{viidna}, we expand \texttt{\#6} first before passing it
% to the command \cs{@checkforInterval}.
% \begin{macrocode}
- \edef\eq@ixparam{#6}%
- \expandafter\@checkforInterval\eq@ixparam\\%
+ \edef\eq@ixparam{#6}\expandafter\eq@chkivIntrvls\eq@ixparam\\%
}
% \end{macrocode}
% \DescribeMacro{\viidna} is used with the \texttt{satisfyEq} for the seventh parameter,
% these routines do not use the ninth, but there needs to be something that does not
% stop compilation.
% \begin{macrocode}
-\def\viidna{[]}
+\def\viidna{[0,1]}
+%\def\viidna{[]}
% \end{macrocode}
% If the next token is a `\texttt[', then that signals the beginning of an interval
% such as \texttt{[a,b]}, must be the new style. The second parameter is not
% needed, and not expected in this case. It would be a mistake to include it.
% \begin{macrocode}
-\def\@checkforInterval{%
- \@ifnextchar[{\@checkforIntervali}{\@checkforIntervalii}}
+\def\eq@chkivIntrvls{\@ifnextchar[{\eq@chkivIntrvlsi}%
+ {\eq@chkivIntrvlsii}}
% \end{macrocode}
% This is the case of the new style of defining the interval. We insert it into the
% arguments list, and continue on to the next stage.
@@ -7720,71 +8162,80 @@ if (!isQuizInitialized("@currQuiz")) {
% is next to the left bracket. Somehow, the left brace and right brace get absorbed. We do a
% work around, and insert a space after the left bracket.
% \begin{macrocode}
-\def\@checkforIntervali#1\\{%
- \def\rbArgs{\rbArgstmp,"#1",\indepVar}%
- \@ifnextchar[{\@eq@@RespBox[ \expandafter\@gobble}%
- {\@eq@@RespBox[\eq@defaultCompare]}%
+\def\eq@chkivIntrvlsi#1\\{\eq@ProcIntrvls{#1}%
+ \def\rbArgs{\rbArgstmp,"\eq@interv@ls",_mathVars}% dps17
+ \@ifnextchar[{\@eq@@RespBox[ \expandafter\@gobble}%
+ {\@eq@@RespBox[\eq@defaultCompare]}%
}
% \end{macrocode}
% This is assumed to be the old style for defining the interval. In this case, the next
-% token is the right-hand endpoint of the interval, we need it. It would be a mistake
-% \texttt{not} to include it. We also test for the presence of the optional
+% token is the right-hand endpoint of the interval, we need it. We also test for the presence of the optional
% of a customized comparison function, parameter \texttt{\#9}
% \begin{macrocode}
-\def\@checkforIntervalii#1\\#2{%
- \def\rbArgs{\rbArgstmp,"[#1,#2]",\indepVar}%
- \@ifnextchar[{\@eq@@RespBox}{\@eq@@RespBox[\eq@defaultCompare]}%
+\def\eq@chkivIntrvlsii#1\\#2{\def\nI{1}%
+ \def\rbArgs{\rbArgstmp,"[#1,#2]",_mathVars}%
+ \@ifnextchar[{\@eq@@RespBox}{\@eq@@RespBox[\eq@defaultCompare]}%
}
% \end{macrocode}
% Finally, we see if there will be a 10th parameter by seeing if `\texttt*' comes
% next. We change the catcodes here, so we can have a left and right brace in the
-% optional argument \#9. Hope it works. dps 12/30/03
-%\changes{v6.4g}{2011/07/21}{%
-% Changing the definition of \cs{@eq@@RespBox}, removing the change
-% in \cs{catcode}s. If this causes problems, can restore the
-% old definition.
-%}
-% \begin{macrocode}
-%\def\@eq@@RespBox{\begingroup\catcode`\<=1\relax\catcode`\>=2\relax
-% \catcode`\{=12\relax\catcode`\}=12\relax\@eq@@@RespBox}
-%\def\@eq@@@RespBox[#1]{\endgroup\@ifstar{\jsRespBox[#1]}%
-% {\jsRespBox[#1]{ProcResp}}}
-% \end{macrocode}
-% Below is an alternate (and obvious) definition for \cs{@eq@@RespBox}. Whatever
-% reason I had to change the catcodes, I don't remember, and things seem to work
-% without it. But, will keep things as they are.
+% optional argument \#9. Hope it works. dps 12/30/03\medskip
% \begin{macrocode}
-\def\@eq@@RespBox{\@eq@@@RespBox}
-\def\@eq@@@RespBox[#1]{\@ifstar{\jsRespBox[#1]}%
+\def\@eq@@RespBox[#1]{\@ifstar{\jsRespBox[#1]}%
{\jsRespBox[#1]{ProcResp}}}
\def\eq@ProcRespIntervals{ProcRespIntervals}
+\def\eq@ProcRespSetNum{ProcRespSetNum}
+\def\eq@ProcRespSetSym{ProcRespSetSym}
+\def\eq@ProcRespEvalEq{ProcRespEvalEq}
+\def\eq@ProcRespEvalEqNonZero{ProcRespEvalEqNonZero}
+\def\eq@ProcRespEvalEqList{ProcRespEvalEqList}
+\def\eq@ProcRespEvalEqListNonZero{ProcRespEvalEqListNonZero}
\def\jsRespBox[#1]#2{\def\compareJSfunc{#1}%
- \def\processJSfunc{#2}\gdef\g@processJSfunc{#2}% 01/11
+ \def\processJSfunc{#2}\gdef\g@processJSfunc{#2}% 01/11
+ \ifnum\nV=\nI\relax\else
+ \ifx\processJSfunc\eq@ProcRespSetNum\else
+ \ifx\processJSfunc\eq@ProcRespSetSym\else
+ \ifx\processJSfunc\eq@ProcRespEvalEq\else
+ \ifx\processJSfunc\eq@ProcRespEvalEqNonZero\else
+ \ifx\processJSfunc\eq@ProcRespEvalEqList\else
+ \ifx\processJSfunc\eq@ProcRespEvalEqListNonZero\else
+ \PackageWarning{exerquiz}{The number of variables does not
+ match\MessageBreak the number of intervals. The
+ problem\MessageBreak may not evaluate properly}\fi\fi\fi\fi\fi\fi\fi
% \end{macrocode}
% (2017/01/11) Run answer through \cs{pdfstringdef} if
% \texttt{ProcRespIntervals} is used to avoid unbalanced parentheses.
% \changes{v7.8d}{2017/01/11}{Run answer through \string\cs{pdfstringdef} if
% \string\texttt{ProcRespIntervals} is used.}
% \begin{macrocode}
- \ifx\eq@ProcRespIntervals\g@processJSfunc
+ \ifx\eq@ProcRespIntervals\g@processJSfunc
% \end{macrocode}
% When the response function is \texttt{ProcRespIntervals} there is no `real' math, no subscripts,
% no superscripts. We turn of the math mode warning before \cs{pdfstringdef}.
% \begin{macrocode}
- \let\@inmathwarn@SAVE\@inmathwarn\let\@inmathwarn\@gobble
+ \let\@inmathwarn@SAVE\@inmathwarn\let\@inmathwarn\@gobble
% \end{macrocode}
% When the response function is \texttt{ProcRespIntervals}, there may be unbalanced parentheses, we'll
% pass \cs{eqCorrectAns} through \cs{pdfstringdef} to escape them.
% \begin{macrocode}
- \pdfstringdef{\eqCorrectAns}{\eqCorrectAns}%
- \let\@inmathwarn\@inmathwarn@SAVE\fi
- \eq@recordCorrAns{"\eqCorrectAns"}% 01/11
- \ifeq@proofing\makebox[0pt][l]{\space\math@correctAnswer}\fi
- \eq@TextField % send to the driver-dependent macro
+ \pdfstringdef{\eqCorrectAns}{\eqCorrectAns}%
+ \let\@inmathwarn\@inmathwarn@SAVE\fi
+% \end{macrocode}
+% Remove parentheses from the argument of \cs{eq@recordCorrAns}.
+% \changes{v8.2}{2018/03/18}{Corrected \string\cs{eq@recordCorrAns}}
+% \changes{v8.2.1}{2018/03/19}{If not a math group, record this data}
+% \begin{macrocode}
+\ifx\grpquestions\eq@Zero
+ \eq@recordCorrAns{"\eqCorrectAns"}% 2018/03/18
+% \eq@recordCorrAns{("\eqCorrectAns")}% 01/11
+\fi
+ \ifeq@proofing\makebox[0pt][l]{\space\math@correctAnswer}\fi
+ \eq@TextField % send to the driver-dependent macro
% \end{macrocode}
% (2014/01/23) Closing the \cs{hbox} here, begun at the opening of \cs{text@@Field} above.
% \begin{macrocode}
- \egroup
+ \egroup % hbox
+ \endgroup % \RespBoxMath
}
% \end{macrocode}
% The primitive \cs{meaning} is used to get a typeset version of the answer for the \texttt{proofing}
@@ -7794,9 +8245,9 @@ if (!isQuizInitialized("@currQuiz")) {
% for example, following a period (`.'). Oh, well.
% \begin{macrocode}
\def\gobbleMacro#1>{}
-\gdef\math@correctAnswer{%
- \ttfamily\color{\@proofingsymbolColor}\spaceskip=2pt\xspaceskip=2pt%
- \expandafter\gobbleMacro\meaning\eqCorrectAns
+\gdef\math@correctAnswer{\ttfamily
+ \color{\@proofingsymbolColor}\spaceskip=2pt\xspaceskip=2pt%
+ \expandafter\gobbleMacro\meaning\eqCorrectAnsTeX
}
% \end{macrocode}
% \end{macro}
@@ -7884,7 +8335,12 @@ if (!isQuizInitialized("@currQuiz")) {
\def\@@RespBoxTxtActions
{%
\AA{\if\eqQuizType\isQZ
- \AAKeystroke{\AAKqRespBoxTxt}
+% \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
@@ -7892,8 +8348,10 @@ if (!isQuizInitialized("@currQuiz")) {
\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
@@ -7906,10 +8364,11 @@ if (!isQuizInitialized("@currQuiz")) {
\fi
}
}
+\def\annot@subtype@rbt{rbt}
\newcommand\@RespBoxTxt[1][]
{%
+ \edef\annot@subtype{\annot@subtype@rbt}%
\eq@AddProbToQzQuesList
-% \smallskip
\ifx\grpquestions\eq@Zero\addtocounter{eqpointvalue}{\eqPTs}\fi
\if\eqQuizType\isQZ
\def\rbFlag{1}\global\IsRespBoxtrue
@@ -8099,8 +8558,10 @@ if (!isQuizInitialized("@currQuiz")) {
% Here is the beginning of \cs{RespBoxTxtPC}.
% \begin{macrocode}
\newcommand{\RespBoxTxtPC}{\def\rbFlag{0}\@RespBoxTxtPC}
+\def\annot@subtype@rbtpc{rbtpc}
\newcommand\@RespBoxTxtPC[1][]
{%
+ \edef\annot@subtype{\annot@subtype@rbtpc}%
\eq@AddProbToQzQuesList
\smallskip\ifx\grpquestions\eq@Zero
\addtocounter{eqpointvalue}{\eqPTs}\fi
@@ -8314,17 +8775,34 @@ if (!isQuizInitialized("@currQuiz")) {
\BC{0 0 0}\BG{.7529 .7529 .7529}\H{P}
}
\def\normalCABtnBC{0 0 0}
- \def\qCorrAnsButtonActionHook
- {%
- \JS{%
- \ifx\@qzsolndest\@empty\else
- if (event.shift)\jsR\jsT
- this.gotoNamedDest("\@qzsolndest");\jsR
- else\jsR\jsT
- \fi
- \processJSfunc("Ans.\curr@quiz","\CorrectAns",\currQuiz);
- }%
- }
+\def\qCorrAnsButtonActionHook{\JS{%
+\ifx\@qzsolndest\@empty\else
+ if (event.shift)\jsR\jsT
+ this.gotoNamedDest("\@qzsolndest");\jsR
+ else {\jsR\jsT\fi
+% \end{macrocode}
+% The script for the \cs{CorrAnsButton} accommodates multi-letter variables
+% \begin{macrocode}
+\ifShowAppr % dps17
+ \ifarrowDelim
+ if (typeof event.target.appr=="undefined")\r\JST\t
+ event.target.appr=false;\r\JST
+ event.target.appr=!event.target.appr;\r\JST
+ if (event.target.appr) {\r\t\JST
+ var _substVars=\indepVars;\r\t\JST
+ var _substAns=getSubstValue(_substVars,"\CorrectAns");\r\t\JST
+ var value=RespBoxAppr("\CorrectAns");\r\JST
+ } else value="\CorrectAns";\r\JST
+ \else
+ value="\CorrectAns";\r\JST
+ \fi
+\else
+ value="\CorrectAns";\r\JST
+\fi
+ \processJSfunc("Ans.\curr@quiz",value,\currQuiz);\r
+\ifx\@qzsolndest\@empty\else % dps17
+ }\fi
+}}
\def\sqCorrAnsButtonActionHook
{%
\JS{%
@@ -8348,7 +8826,8 @@ if (!isQuizInitialized("@currQuiz")) {
\eq@@@CorrAnsButton{#1}{#2}{DisplayAnswer}}%
}
\def\eq@@@CorrAnsButton#1#2#3{\gdef\CorrectAns{#2}%
- \def\processJSfunc{#3}%
+ \def\processJSfunc{#3}\ifx\@qzsolndest\@empty\let\JST\@empty\else
+ \let\JST\jsT\fi % dps17
\ifx\eq@ProcRespIntervals\g@processJSfunc % 01/11
\let\@inmathwarn@SAVE\@inmathwarn\let\@inmathwarn\@gobble
% \end{macrocode}
@@ -8364,8 +8843,9 @@ if (!isQuizInitialized("@currQuiz")) {
\ifx\@qzsolndest\@empty%\noexpand\BC{\normalCABtnBC}%
\else\noexpand\BC{\solution@Color}\fi
\noexpand\A{\noexpand\qCorrAnsButtonActionHook}}%
- \ifeq@noquizsolutions\else
- \mbox{\push@@Button{#1}{\Fld@name}{}{\DefaultHeightOfWidget}%
+ \ifeq@noquizsolutions\else % dps17 (\let\rpl\eq@rpl)
+ \mbox{\let\rpl\eq@rpl
+ \push@@Button{#1}{\Fld@name}{}{\DefaultHeightOfWidget}%
{\eq@protect\A}{\eq@setButtonProps\eq@Button@driver}%
{\CorrAnsButtonDefaults\@@CorrAnsButtonActions
\every@ButtonField\every@CorrAnsButton}}%
@@ -8723,8 +9203,6 @@ if (!isQuizInitialized("@currQuiz")) {
% \begin{macrocode}
\ifx\grpquestions\eq@Zero\eq@tmpExp\fi
}
-% \end{macrocode}
-% \begin{macrocode}
%</package>
%<*sumrytbls>
% \end{macrocode}
@@ -9080,11 +9558,12 @@ if (!isQuizInitialized("@currQuiz")) {
% \end{macrocode}
% \end{environment}
% \begin{macrocode}
+% End sumrytbls segment
%</sumrytbls>
-% \end{macrocde}
+%<*mcfi>
+% \end{macrocode}
% \subsection{Posing MC/math fill-in questions}
% \begin{macrocode}
-%<*mcfi>
\def\bMCFI{%
\withinMCFItrue
\ifx\qRadionActionsHook\@empty
@@ -9141,13 +9620,7 @@ if (!isQuizInitialized("@currQuiz")) {
% \begin{macrocode}
\inputMCFICode
% \end{macrocode}
-% \begin{macrocode}
-%</package>
-% \end{macrocode}
% \section{eForms Support}
-% \begin{macrocode}
-%<*package>
-% \end{macrocode}
% \begin{macro}{\solutionColor}
% This color is introduced at the pdfmark/rawPDF level. Define
% the color without commas. For example |\solutionColor{0 .6 0}|
@@ -9159,8 +9632,8 @@ if (!isQuizInitialized("@currQuiz")) {
\solutionColor{\solutionColorDef}
% \end{macrocode}
% \end{macro}
-%
% \begin{macrocode}
+% End of package segment
%</package>
%<*eqcolor>
% \end{macrocode}
@@ -9404,48 +9877,6 @@ if (!isQuizInitialized("@currQuiz")) {
\newcommand\everyGradeField[1]{\def\every@GradeField{#1}}
\def\every@GradeField{}
% \end{macrocode}
-% \begin{macro}{\AddAAFormat}
-% Here is the definition of \cs{AddAAFormat}. This macro can be used
-% in \cs{RespBoxMath} to add in formatting of the answer. This macro is
-% necessary because the \cs{AA} actions for the \textsf{exerquiz} quiz macros
-% are ``protected''; the document author cannot accidentally overwrite my
-% JavaScript for processing the user's answer.
-% \begin{flushleft}
-% Example: In the preamble
-%\begin{verbatim}
-%\begin{defineJS}{\formatAsSet}
-%if (event.value.replace(/\\s/g,"") != "")
-% event.value = "{ " + event.value + " }";
-%\end{defineJS}
-%\end{verbatim}
-% and in the body of a \texttt{quiz} environment,
-%\begin{verbatim}
-%$x^2 - 3x + 2 = 0$, $S = \RespBoxMath[\AddAAFormat{\formatAsSet}
-% \rectW{.75in}\textSize{0}]{1,2}{1}{.0001}{[0,1]}*{ProcRespSetNum}$
-%\end{verbatim}
-%\end{flushleft}
-% \begin{macrocode}
-\def\@eqAddAAFormat#1{\def\eqFormatArg{#1}}
-\def\eq@AddAAFormat{}
-\def\formatAsSet{try{formatAsSet()}catch(e){}}
-\def\formatAsVector{try{formatAsVector()}catch(e){}}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\AddAAKeystroke}
-% The value of this key is JS code that executes after the input box has been processed.
-% Created to use with AcroFleX for showing graphs after the user enters a response.
-%
-%\changes{v6.3b}{2008/06/29}
-%{
-% Added the \cs{AddAAKeystroke} to the recognizable set of keys. This will be obeyed
-% within the optional arguments of \cs{RespBoxMath}.
-%}
-% \begin{macrocode}
-\def\@eqAddAAKeystroke#1{\def\argi{#1}\ifx\argi\@empty
- \def\eqAAKeystrokeArg{}\else\def\eqAAKeystrokeArg{\r #1}\fi}
-\def\eqAAKeystrokeArg{}
-% \end{macrocode}
-% \end{macro}
% \begin{macro}{\everysqRadioButton}
% \begin{macro}{\everyqRadioButton}
% Here, you can control the appearance of all the standard checkboxes, also
@@ -9496,11 +9927,150 @@ if (!isQuizInitialized("@currQuiz")) {
% Replace everyeqGenButten with everyPushButton
\let\everyeqGenButton\everyPushButton
\let\every@eqGenButton\every@PushButton
+\let\eqGenButton\pushButton
\newcommand\everyeqIcon[1]{\def\every@eqIcon{#1}}
\def\every@eqIcon{}
-% dps new
-\let\eqGenButton\pushButton
% \end{macrocode}
+%
+% \subsection{Additional Format and Action keys}
+%
+% \begin{macro}{\AddAAFormat}
+% Here is the definition of \cs{AddAAFormat}. This macro can be used
+% in \cs{RespBoxMath} to add in formatting of the answer. This macro is
+% necessary because the \cs{AA} actions for the \textsf{exerquiz} quiz macros
+% are ``protected''; the document author cannot accidentally overwrite my
+% JavaScript for processing the user's answer.
+% \begin{flushleft}
+% Example: In the preamble
+%\begin{verbatim}
+%\begin{defineJS}{\formatAsSet}
+%if (event.value.replace(/\\s/g,"") != "")
+% event.value = "{ " + event.value + " }";
+%\end{defineJS}
+%\end{verbatim}
+% and in the body of a \texttt{quiz} environment,
+%\begin{verbatim}
+%$x^2 - 3x + 2 = 0$, $S = \RespBoxMath[\AddAAFormat{\formatAsSet}
+% \rectW{.75in}\textSize{0}]{1,2}{1}{.0001}{[0,1]}*{ProcRespSetNum}$
+%\end{verbatim}
+%\end{flushleft}
+% Define a special value (\cs{formatInitAltApprs}) for \cs{AddAAFormat} used in initializing \cs{RespBoxMath} problems,
+% where there are alternate appearances.
+% \changes{v8.1a}{2017/09/03}{Define a special value (\string\cs{formatInitAltApprs}) for \string\cs{AddAAFormat}}
+% \begin{macrocode}
+\def\formatInitAltApprs{\formatInitAltApprs}
+\def\@eqAddAAFormat#1{\def\@rgi{#1}\ifx\@rgi\formatInitAltApprs
+ \bInitAltAppr\else\def\eqAddAAFormat{#1}\fi}
+\def\eqAddAAFormat{}
+\def\formatAsSet{try{formatAsSet()}catch(e){}}
+\def\formatAsVector{try{formatAsVector()}catch(e){}}
+% \end{macrocode}
+% \end{macro}
+% What follows are a series of three ``action'' keys, that is, their arguments are
+% JavaScript code. They are meant to be used in highly specialized settings.
+% \begin{macro}{\setActionKeys}
+% The action keys can be set through the optional argument, if available, or they can be set
+% globally using the command \cs{setActionKeys}. The only keys supported for use
+% as the argument of \cs{setActionKeys} are \cs{AddAAKeystroke\{\meta{code}\}},
+% \cs{AddAAMouseUpMC\{\meta{code}\}}, and \cs{AddAAMouseUpMS\{\meta{code}\}}, though
+% this is not enforced due to the obscure nature their use. The action settings remain
+% in force until you cancel them out with \cs{AddAAKeystroke\{\}}, for example.
+% \changes{v7.8k}{2017/07/22}{Added \string\cs{setActionKeys}}
+% \changes{v7.8j}{2017/07/23}{Restricted the use of \string\cs{setActionKeys} to a
+% selected number of keys}
+% \begin{macrocode}
+\def\eq@SupActnLst{{\AddAAKeystroke}{\AddAAMouseUpMC}%
+ {\AddAAMouseUpMS}{\AddAAFormat}}
+\newcommand\setActionKeys{\edef\catOfAt{\the\catcode`@}%
+ \ifnum\catOfAt=11 \let\eq@CatTail\relax\else
+ \makeatletter\let\eq@CatTail\makeatother\fi\setActionKeysi}
+\def\setActionKeysi#1{\let\eq@itsGood\eq@One
+ \def\setActionKeys@cont{\processAppArgs#1\end\@nil}%
+ \begingroup\eq@checkivValidKeys#1\end\ef@nil\endgroup\eq@CatTail}
+\def\eq@checkivValidKeys#1#2{\def\eq@GOOD{good}\expandafter
+ \@tfor\expandafter
+ \@ction\expandafter:\expandafter=\eq@SupActnLst\do{%
+ \expandafter\def\@ction{good}}%
+ \ifx\end#1% if #1=\end, #2=\ef@nil.
+ \def\eq@next{\aftergroup\setActionKeys@cont}%
+ \else
+ \if\eq@itsGood\eq@One
+ \let\itp@ss0\let\@@next\relax
+ \expandafter\@tfor\expandafter
+ \@ction\expandafter:\expandafter=\eq@SupActnLst\do{%
+ \expandafter\ifx\expandafter#1\@ction
+ \let\itp@ss\eq@One\@break@tfor
+ \fi}% do
+ \if\itp@ss\eq@Zero\let\eq@itsGood\eq@Zero
+ \def\eq@next{\def\eq@lastArg{#1}\expandafter
+ \eq@sqkErrorMsg\ef@gobbletonil}\else
+ \let\eq@next\eq@checkivValidKeys\fi
+ \else\let\eq@next\ef@gobbletonil\fi
+ \fi %\ifx\end
+ \eq@next
+}
+\def\eq@sqkErrorMsg#1{\PackageError{exerquiz}{The key \expandafter
+ \string\eq@lastArg\space is not supported by
+ \string\setActionKeys.\MessageBreak
+ Remove the key or correct the spelling of the key}{}}
+% \end{macrocode}
+% The \DescribeMacro{\addToAction}\cs{addToAction} is a companion to \cs{setActionKeys}. When
+% \cs{setActionKeys} sets a key, later in the document, you might want to add to that action
+% earlier defined. Thus, \verb~\addToAction{\AddAAFormat}{var x=2;}~ appends
+% \texttt{var x=2;} to the code already defined earlier by
+% \cs{setActionKeys}, I hope. The first argument is one of the keys in \cs{eq@SupActnLst}
+% (the only ones accepted), the second argument is the script to add to the previously added script.
+% The optional \texttt{*}-argument reverses the order the code is arranged.
+% \begin{macrocode}
+\def\addToAction{\makeatletter\@ifstar{\let\isSt@r\eq@YES\@ddToAction}
+ {\let\isSt@r\eq@NO\@ddToAction}}
+\def\@ddToAction#1#2{\let\eq@itsGood\eq@One
+ \def\setActionKeys@cont{\@@ddToAction{#1}{#2}}\begingroup
+ \eq@checkivValidKeys{#1}{#2}\end\ef@nil\endgroup\makeatother}
+\def\@@ddToAction#1#2{\@getCmdName{#1}%
+ \if\isSt@r\eq@YES\toks2={#2}%
+ \toks@=\aeb@exiii{\csname eq\@CmdName\endcsname}%
+ \edef\tmp@tokshold{\the\toks2 \the\toks@}%
+ \toks@=\expandafter{\tmp@tokshold}\else
+ \toks@=\aeb@exiii{\csname eq\@CmdName\endcsname#2}\fi
+ \expandafter\edef\csname eq\@CmdName\endcsname{\the\toks@}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AddAAKeystroke}
+% The value of this key is JS code that executes after the input box has been processed.
+% Created to use with AcroFleX for showing graphs after the user enters a response.
+%
+%\changes{v6.3b}{2008/06/29}
+%{
+% Added the \cs{AddAAKeystroke} to the recognizable set of keys. This will be obeyed
+% within the optional arguments of \cs{RespBoxMath} and \cs{RespBoxTxt}.
+%}
+% \begin{macrocode}
+\def\@eqAddAAKeystroke#1{\def\argi{#1}\ifx\argi\@empty
+ \def\eqAddAAKeystroke{}\else\def\eqAddAAKeystroke{#1}\fi} %\r
+\def\eqAddAAKeystroke{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\AddAAMouseUpMC}
+% \begin{macro}{\AddAAMouseUpMS}
+% Added form keys (for MC and MS questions), can be use to add additional
+% action with a mouse up event.
+% \changes{v7.8j}{2017/07/21}{Added form keys \string\cs{@eqAddAAMouseUpMC}
+% and \string\cs{@eqAddAAMouseUpMS}}
+% \begin{macrocode}
+\def\@eqAddAAMouseUpMC#1{\def\argi{#1}\ifx\argi\@empty
+ \def\eqAddAAMouseUpMC{}\else\def\eqAddAAMouseUpMC{#1}\fi}
+\def\eqAddAAMouseUpMC{}
+\def\@eqAddAAMouseUpMS#1{\def\argi{#1}\ifx\argi\@empty
+ \def\eqAddAAMouseUpMS{}\else\def\eqAddAAMouseUpMS{#1}\fi}
+\def\eqAddAAMouseUpMS{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \subsection{An pushbutton to hold an icon appearance}
+% I don't remember much about the \cs{eqIcon} command, don't remember
+% how this is used.
% \begin{macro}{\eqIcon}
% Create a push button for displaying an icon. I've set this on read only, this
% can be removed by saying \verb+\Ff{-\FfReadOnly}+/
@@ -9526,6 +10096,7 @@ if (!isQuizInitialized("@currQuiz")) {
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
+\eq@restoreCats
%</package>
% \end{macrocode}
%
@@ -9580,6 +10151,21 @@ if (!isQuizInitialized("@currQuiz")) {
% \end{macrocode}
% \begin{macrocode}
\newcommand{\dlLibSpecRespJS}{"none","undefined","empty"}
+\newif\ifSubstVars\SubstVarsfalse % dps17
+\newif\ifShowAppr\ShowApprtrue % dps17
+\def\altApprOn{\ShowApprtrue} % dps17
+\def\altApprOff{\ShowApprfalse} % dps17
+\def\corrChoiceFullyOn{\def\eqCorrChoiceFully{true}}
+\def\corrChoiceFullyOff{\def\eqCorrChoiceFully{false}}
+\corrChoiceFullyOn
+% \end{macrocode}
+% Implement a local version of full corrections of MS and MS
+% \changes{v8.1l}{2018/02/07}{Add local version of \string\cs{corrChoiceFullOn}}
+% \begin{macrocode}
+\def\corrLocalChoiceFullyOn{\def\eqCorrLocalChoiceFully{true}} % dpsf07
+\def\corrLocalChoiceFullyOff{\def\eqCorrLocalChoiceFully{false}} % dpsf07
+\def\resetLocalChoiceFully{\let\eqCorrLocalChoiceFully\@empty} % dpsf07
+\resetLocalChoiceFully % no local implementation
\begin{insDLJS*}[exerquizLoaded]{exerquiz}
% \end{macrocode}
% \subsection{Global Data}
@@ -9638,12 +10224,15 @@ var Score=0;
var ptScore=0;
var pcScore=0;
var quizGrade="C";
+var NQuestions=0;
+var NPointTotal=0;
var e = Math.E;
var pi = Math.PI;
var replaceExclaim = \replaceexclaim;
var negPointsAllowed = \negpointsallowed;
var negPointsMarkupAllowed = \negpointsmarkupallowed;
-var aQuizControl = new Array();
+%var aQuizControl = new Array();
+var aQuizControl = new Object;
var RightWrong=new Array();
var ProbValue = new Array();
var ProbDist = new Array();
@@ -9961,10 +10550,18 @@ function addMathObject(UserInput)
function ParseInput(UserInput)
{
var re, repi;
+% \end{macrocode}
+% When `a' is a variable, and the user types in `a cos(x)', exerquiz eventually removes spaces and this
+% becomes `acos(x)', which is not is wanted. Early on, we replace `a' with `(a)' so it is interpreted as
+% a factor: `a cos(x) becomes `(a) cos(x)', which when spaces are stripped out, becomes `(a)cos(x)'.
+% \changes{v8.1b}{2017/09/06}{Enclosed literal `a' in parentheses to disambiguate `a cos' from `acos'.}
+% \begin{macrocode}
+ re = /\b(a)\b/g;
+ UserInput = UserInput.replace(re, "(a)");
UserInput = stripWhiteSpace (UserInput);
if (!ok2Continue) return null;
% \end{macrocode}
-% See if there are matching `\texttt{[]}', `\texttt{\{\}}' and `\texttt{()}'.
+% See if there are matching `\texttt{[]}', `\verb~{}~' and `\texttt{()}'.
% \begin{macrocode}
for(var i=0; i< aGroup.length; i++)
{
@@ -9976,12 +10573,10 @@ function ParseInput(UserInput)
}
}
% \end{macrocode}
-% Replace `\texttt{[]}' and `\texttt{\{\}}' with `\texttt{()}'; only parentheses
+% Replace `\texttt{[]}' and `\verb~{}~' with `\texttt{()}'; only parentheses
% are used in JavaScript for grouping.
% \begin{macrocode}
UserInput = ChngAllGrpsToParens(UserInput);
-% UserInput = UserInput.replace(/\[|\{/g, "\(");
-% UserInput = UserInput.replace(/\]|\}/g, "\)");
% \end{macrocode}
% If the \texttt{fact} function is defined, we attempt to replace user's input of the form
% \texttt{<number>!} with \texttt{fact(<number>)}.
@@ -10360,25 +10955,34 @@ function TypeParameters(v)
% \end{macro}
% \begin{macro}{ProcResp}
% This function handles numerical answers or function of a single variable, x,
-% that evaluate to a number.
+% that evaluate to a number
% \begin{macrocode}
-function ProcResp(flag,CorrAns,n,epsilon,domain,indepVar,oComp)
+function ProcResp(flag,CorrAns,n,epsilon,domain,indepVars,oComp)
{
if (!ProcessIt) return null;
var fieldname = event.target.name;
- var UserAns = event.value;
+ var bSubstVars=(arguments.length>7); // dps17
+% \end{macrocode}
+% The introduction of multi-letter variables, necessitates a slight revision of the JavaScript function
+% \texttt{ProcResp()}. This fundamental function, changes to this function must be propagated
+% to \pkg{dljslib} to all `proc resp' function.
+% \begin{macrocode}
+ var UserAns=(arguments.length>7)?arguments[7]:event.value;
var success = _ProcResp(flag,CorrAns,UserAns,%
-n,epsilon,domain,indepVar,oComp);
+n,epsilon,domain,indepVars,oComp);
% \end{macrocode}
% 09/07/09 Added next line to avoid double alert boxes
% \begin{macrocode}
- if ( success == -1 || !ok2Continue ) return null;
- if ( success == null ) { return syntaxError(), null; }
+ if ( success == -1 || !ok2Continue )
+ { resetHeadsUp(flag,fieldname); return null; } // dps17
+ if ( success == null )
+ { resetHeadsUp(flag,fieldname);
+ return syntaxError(), null; } // dps17
return notifyField(success, flag, fieldname);
}
// changed name of var comp -> oComp
-function _ProcResp(flag,CorrAns,UserAns,n,epsilon,domain,indepVar,oComp)
-{
+function _ProcResp(flag,CorrAns,UserAns,n,epsilon,domain,%
+indepVars,oComp){
ok2Continue = true;
% \end{macrocode}
% by preprocessing.
@@ -10442,14 +11046,14 @@ function _ProcResp(flag,CorrAns,UserAns,n,epsilon,domain,indepVar,oComp)
% \begin{macrocode}
UserAns = ParseInput(UserAns);
% \end{macrocode}
-% Originally, the value of \texttt{indepVar} is a string of variables \texttt{"xyz"}. You can
+% Originally, the value of \texttt{indepVars} is a string of variables \texttt{"xyz"}. You can
% now have variables of the form \texttt{"r:x,i:n,r:y"}. Where the identifier \texttt{"r:"} indicates a
-% real variable and \texttt{"i:"} indicates an integer variable. \texttt{indepVar} must be either
+% real variable and \texttt{"i:"} indicates an integer variable. \texttt{indepVars} must be either
% of the old style, or the new style, not a mixture of both, e.g. \texttt{"xyi:n"}.
% \begin{macrocode}
- indepVar = TypeParameters(indepVar);
+ indepVars = TypeParameters(indepVars);
if (!ok2Continue) return null;
- var success=randomPointCompare(n,domain,indepVar,%
+ var success=randomPointCompare(n,domain,indepVars,%
epsilon,CorrAns,UserAns,comp);
% \end{macrocode}
% \paragraph*{postParse} (2011/10/05) The beginning of an idea, \texttt{postParse}. After it is determined
@@ -10523,7 +11127,7 @@ function processSpecialParse(oParse,UserAns) {
% true if the error of the random comparison is less than epsilon
% false if the error of the random comparison is greater than epsilon
% \begin{macrocode}
-function randomPointCompare (n,domain,indepVar,epsilon,%
+function randomPointCompare (n,domain,indepVars,epsilon,%
CorrAns,userAns,comp)
{
var error, i, j, k;
@@ -10544,7 +11148,7 @@ CorrAns,userAns,comp)
-eval(endpoints[0]))*Math.random();
}
var cXY = aXY.toString();
- error = comp(domain,cXY,indepVar,CorrAns,userAns);
+ error = comp(domain,cXY,indepVars,CorrAns,userAns);
if (error == null) return null;
if ( (error == -1) || (error > epsilon) ) {j=-1; break;}
}
@@ -10765,6 +11369,87 @@ function requireFormNot(UserAns, regexpr) {
}
}
\end{newsegment}
+\begin{newsegment}{Eq: Support for multi-letter variables}
+if (!String.prototype.trim) {
+ String.prototype.trim = function () {
+ return this.replace(/^[\s\string\uFEFF\string\xA0]+|%
+[\s\string\uFEFF\string\xA0]+$/g, '');
+ };
+}
+function _rplVarsBy(str1,str2) {
+ var re=new RegExp(str1,"g");
+ var result=str1.replace(re,str2);
+ return result;
+}
+function processMathVars(str) {
+ var pos1,pos2,lead,tmp;
+ while ((pos1=str.indexOf("_rplVarsBy"))!=-1) {
+ pos2=str.indexOf("@");
+ lead=str.substring(0,pos1);
+ tmp=str.substring(pos1,pos2);
+ str=str.substring(pos2+1);
+ tmp=eval(tmp);
+ str=lead+tmp+str;
+ }
+ str=str.replace(/\s/g,"");
+ return str;
+}
+getSubstValue.aSubsts=new Array(); // dps17
+function getSubstValue(v,s){
+/*
+ v=variable list, it may have the form "xyz", or if there
+ substitutions, it might look like "_rplVarsBy('theta','x')@";
+ s=Either the user's answer or the author's answer.
+
+ First develop an array of all variables are their substitutes.
+ ie, getSubstValue.aSubsts=[ "c","h", ["theta",x"], ["alpha",y],...];
+*/
+ var pos1,pos2,tmp,args,re,arg1,arg2;
+/*
+ change new style to old
+ New style: v="c,_rplVarsBy('theta->\u03B8','r:x')@,%
+_rplVarsBy('alpha->\u03B1','r:y')@";
+ Old style: v="c_rplVarsBy('theta->\u03B8','x')@%
+_rplVarsBy('alpha->\u03B1','y')@";
+*/
+ re=/([^'])(,)/g;
+ v=v.replace(re,'$1');
+ re=/([ri]\string\:)+(\string\w)/g;
+ v=v.replace(re,'$2');
+ getSubstValue.aSubsts=[]; // dps17
+ var start=0;
+ while (true) {
+ v=v.substring(start);
+ pos1=v.indexOf("_rplVarsBy");
+ if (pos1==-1) break;
+ pos2=v.indexOf("@");
+ args=v.substring(pos1+10+1,pos2-1);
+ tmp=args.split(",");
+ arg1=eval(tmp[0].toString());
+ tmp1=arg1.split("->");
+ for (var i=0; i<tmp1.length; i++)
+ tmp1[i]=tmp1[i].trim();
+ if (tmp1.length==1) getSubstValue.aSubsts.push(tmp1[0]);
+ else getSubstValue.aSubsts.push(tmp1);
+ arg2=eval(tmp[1].toString());
+ re=new RegExp(tmp1[0],"g");
+ s=s.replace(re,arg2);
+ start=pos2+1;
+ }
+ return s;
+}
+function RespBoxAppr(e){
+ var value=(typeof e=="object")?e.value:e;
+ var re;
+ for (var i=0; i<getSubstValue.aSubsts.length; i++) {
+ if (typeof getSubstValue.aSubsts[i]=="object") {
+ re=new RegExp(getSubstValue.aSubsts[i][0],"g");
+ value=(value.replace(re,getSubstValue.aSubsts[i][1],"g"));
+ }
+ }
+ return value;
+}
+\end{newsegment}
% \end{macrocode}
% \subsection{Text Fill-in}
% Now the JS functions that process text fill-in questions.
@@ -10893,7 +11578,7 @@ function InitMsg(msg) { return (\eqInitQuizMsg) }
function syntaxError() { eqAppAlert(\eqSyntaxErrorUndefVar,3); }
% \end{macrocode}
% \begin{macrocode}
-var lstOfQuizzes=new Array();
+var lstOfQuizzes=new Object();
% \end{macrocode}
% There are four required parameters, if there is a fifth, that means
% we have a grouped question, parameter 5 will be the group sub-problem number.
@@ -11037,6 +11722,18 @@ function InitializeQuiz(qtfield,mark) {
}
return null;
}
+function resetHeadsUp(flag,fieldname) {
+ if (flag==1) return;
+ var pos1=fieldname.indexOf(".");
+ var pos2=fieldname.indexOf(".",pos1+1);
+ var baseName=fieldname.substring(pos1+1,pos2);
+ var oQName=eval(baseName);
+ var defaultColor=(typeof oQName.DefaultColorJSLoc=="undefined")%
+?\defaultColorJS:oQName.DefaultColorJSLoc;
+ var f=this.getField(fieldname);
+ if (f!=null) f.strokeColor=defaultColor;
+
+}
function neutralizeQuizzes()
{
for ( var qtfield in aQuizControl ) aQuizControl[qtfield] = 0;
@@ -11107,11 +11804,11 @@ function GrpRight( a, nProb, qtfield )
var prod = 1;
for ( var i=1; i <= l; i++) prod *= !!a[i];
return prod;
-
}
function DisplayQuizResults(qtfield,nPointTotal,nQuestions)
{
Score = 0; ptScore = 0;
+ NPointTotal=nPointTotal; NQuestions=nQuestions;
for (var i=1; i < RightWrong.length; i++)
{
if ( (typeof RightWrong[i] == "object" ) %
@@ -11155,7 +11852,7 @@ function DisplayQuizResults(qtfield,nPointTotal,nQuestions)
}
}
}
-if ( !negPointsAllowed && (ptScore < 0) ) ptScore = 0;
+ if ( !negPointsAllowed && (ptScore < 0) ) ptScore = 0;
if (ptScore == nPointTotal) pcScore = 100;
else pcScore = util.printf("\%.1f", (100 * ptScore) / nPointTotal);
var oQName=eval(qtfield);
@@ -11287,10 +11984,52 @@ function correctQuiz(qtfield,nQuestions)
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
+% \end{macrocode}
% MC or MS questions
% \begin{macrocode}
var f = this.getField("mcq." + qtfield);
- if ( f != null) f.display = display.visible;
+% if ( f != null) f.display = display.visible;
+% \end{macrocode}
+% \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))?%
+display.visible:display.hidden;
+ }
+ } else {
+ var ck=h.getArray();
+ for (var j=0; j< g.length; j++) {
+ g[j].display=(ck[j].isBoxChecked(0))?%
+display.visible:display.hidden;
+ }
+ }
+ }
+ }
+ }
+ }
f = this.getField("obj." + qtfield);
if ( f != null ) {
var a = f.getArray();
@@ -11537,30 +12276,30 @@ function chooseJSColor( b, c1, c2 ) {
return ( b ) ? c1 : c2;
}
function notifyField(success, flag, fieldname) {
- if ( flag != 0 )
- return (success)?true:false;
+ if ( flag != 0 )
+ return (success)?true:false;
% \end{macrocode}
% if \texttt{flag == 0}, then we are working with a \texttt{shortquiz}, and immediate response
% is needed.
% \begin{macrocode}
- var f = this.getField(fieldname);
- var re=/^(obj|grpobj)\./;
- var gname=fieldname.replace(re,"rbmarkup\.");
- var g =this.getField(gname);
- var isthereRBUP = ( g !=null );
+ var f = this.getField(fieldname);
+ var re=/^(obj|grpobj)\./;
+ var gname=fieldname.replace(re,"rbmarkup\.");
+ var g =this.getField(gname);
+ var isthereRBUP = ( g !=null );
% \end{macrocode}
% Extract the quiz name from the field name: \texttt{obj.QName.num} or \texttt{grpobj.QName.num}
% \begin{macrocode}
- var h = fieldname.replace(re,"");
- var index=h.indexOf(".");
- var oQName = eval(h.substring(0,index));
- var rightColor=(typeof oQName.RightColorJSLoc=="undefined")%
+ var h = fieldname.replace(re,"");
+ var index=h.indexOf(".");
+ var oQName = eval(h.substring(0,index));
+ var rightColor=(typeof oQName.RightColorJSLoc=="undefined")%
?\rghtColorJS:oQName.RightColorJSLoc;
- var rightSymb=(typeof oQName.RightColorJSLoc=="undefined")%
+ var rightSymb=(typeof oQName.RightColorJSLoc=="undefined")%
?\rghtAnsSymbJS:oQName.RightAnsSymbJSLoc;
- var wrongColor=(typeof oQName.WrongColorJSLoc=="undefined")%
+ var wrongColor=(typeof oQName.WrongColorJSLoc=="undefined")%
?\wrngColorJS:oQName.WrongColorJSLoc;
- var wrongSymb=(typeof oQName.WrongAnsSymbJSLoc=="undefined")%
+ var wrongSymb=(typeof oQName.WrongAnsSymbJSLoc=="undefined")%
?\wrngAnsSymbJS:oQName.WrongAnsSymbJSLoc;
if (success) {
f.strokeColor = rightColor;
@@ -11652,37 +12391,37 @@ app.clearTimeOut(oNoPeekTimer);",5);
var oCB=\bcheckboxused
function OnBlurRespBox (retn)
{
- var qname = arguments[1];
- var oQName = eval(qname);
- var respMsg;
- var cTitle = "AcroTeX eDucation Bundle";
- if (retn != null) {
- if ( typeof appAlerts[qname] == "undefined")
- appAlerts[qname] = {bAfterValue: false, %
+ var qname = arguments[1];
+ var oQName = eval(qname);
+ var respMsg;
+ var cTitle = "AcroTeX eDucation Bundle";
+ if (retn != null) {
+ if ( typeof appAlerts[qname] == "undefined")
+ appAlerts[qname] = {bAfterValue: false, %
cMsg: "\doNotShowAgainMsg"};
- var respMsg = (retn) ? \eqsqrtmsg\space : \eqsqwgmsg;
- if ( (event.target == this) || !oCB)
- eqAppAlert({ cMsg: respMsg, nIcon: 3, cTitle: cTitle });
- else {
- if ( ! appAlerts[arguments[1]].bAfterValue )
- eqAppAlert({ cMsg: respMsg, nIcon: 3, cTitle: cTitle, %
+ var respMsg = (retn) ? \eqsqrtmsg\space : \eqsqwgmsg;
+ if ( (event.target == this) || !oCB)
+ eqAppAlert({ cMsg: respMsg, nIcon: 3, cTitle: cTitle });
+ else {
+ if ( ! appAlerts[arguments[1]].bAfterValue )
+ eqAppAlert({ cMsg: respMsg, nIcon: 3, cTitle: cTitle, %
oCheckbox: appAlerts[qname]});
- }
}
- else {
- var re=/^(obj|grpobj)\./;
- var gname=event.target.name.replace(re,"rbmarkup\.");
- var g =this.getField(gname);
- var isthereRBUP = ( g !=null );
- var str = event.target.value.toString();
- if (str.replace(/\s/g,"") == "") {
- var defaultColor=%
+ }
+ else {
+ var re=/^(obj|grpobj)\./;
+ var gname=event.target.name.replace(re,"rbmarkup\.");
+ var g =this.getField(gname);
+ var isthereRBUP = ( g !=null );
+ var str = event.target.value.toString();
+ if (str.replace(/\s/g,"") == "") {
+ var defaultColor=%
(typeof oQName.DefaultColorJSLoc=="undefined")%
?color.black:oQName.DefaultColorJSLoc;
- if (isthereRBUP) g.display=display.hidden;
- event.target.strokeColor = defaultColor;
- }
+ if (isthereRBUP) g.display=display.hidden;
+ event.target.strokeColor = defaultColor;
}
+ }
}
function jmpToNamedDest(fName,cDest,bAlert) {
if ( (typeof appAlerts[fName]!="undefined" %
diff --git a/texmf-dist/source/latex/acrotex/insdljs.dtx b/texmf-dist/source/latex/acrotex/insdljs.dtx
index 4194957b..5181c985 100644
--- a/texmf-dist/source/latex/acrotex/insdljs.dtx
+++ b/texmf-dist/source/latex/acrotex/insdljs.dtx
@@ -4,7 +4,7 @@
%<*copyright>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% insdljs.sty package, %%
-%% Copyright (C) 2001-2017 D. P. Story %%
+%% Copyright (C) 2001-2018 D. P. Story %%
%% dpstory@uakron.edu %%
%% %%
%% This program can redistributed and/or modified under %%
@@ -16,7 +16,7 @@
%</copyright>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{insdljs}
-%<package> [2017/03/02 v2.3f Insert Document Level JavaScripts (dps)]
+%<package> [2017/09/03 v2.3g Insert Document Level JavaScripts (dps)]
%<*driver>
\documentclass{ltxdoc}
\usepackage[colorlinks,hyperindex=false]{hyperref}
@@ -398,11 +398,13 @@
%
% The options are \texttt{dvipsone}, \texttt{dvips}, \texttt{pdftex} and
% \texttt{dvipdfm}. The default is \texttt{dvipsone}/\texttt{dvips}.
+% \chages{v2.3g}{2017/09/03}{Added ifluatex package}
% \begin{macrocode}
%<*package>
\usepackage{xkeyval}
\RequirePackage{ifpdf}[2006/02/20]
\RequirePackage{ifxetex}[2006/08/21]
+\RequirePackage{ifluatex}
% \end{macrocode}
%
% Standard driver options.\par\medskip\noindent
@@ -420,11 +422,14 @@
% \end{macrocode}
%\textbf{Those not using Distiller}
% \IndexOpt{pdftex}
+% \IndexOpt{luatex}
% \IndexOpt{dvipdfm}
% \IndexOpt{dvipdfmx}
% \IndexOpt{xetex}
+% \chages{v2.3g}{2017/09/03}{Added luatex option}
% \begin{macrocode}
\DeclareOptionX{pdftex}{\def\dljs@drivernum{1}}
+\DeclareOptionX{luatex}{\def\dljs@drivernum{1}}
\DeclareOptionX{dvipdfm}{\def\dljs@drivernum{2}}
\DeclareOptionX{dvipdfmx}{\def\dljs@drivernum{2}}
\DeclareOptionX{xetex}{\def\dljs@drivernum{2}}
@@ -2607,7 +2612,6 @@ var EFSpecial_Keystroke=AFSpecial_Keystroke;
var EFSpecial_Format=AFSpecial_Format;
var EFSpecial_KeystrokeEx=AFSpecial_KeystrokeEx;
var EFRange_Validate=AFRange_Validate;
-var EFRange_Validate=AFRange_Validate;
var EFSimple_Calculate=AFSimple_Calculate;
var EFMergeChange=AFMergeChange;
\end{insDLJS}
diff --git a/texmf-dist/source/latex/acrotex/web.dtx b/texmf-dist/source/latex/acrotex/web.dtx
index d3ae26b8..36ddc705 100644
--- a/texmf-dist/source/latex/acrotex/web.dtx
+++ b/texmf-dist/source/latex/acrotex/web.dtx
@@ -4,7 +4,7 @@
%<*copyright>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Web package, %%
-%% Copyright (C) 1999-2017 D. P. Story %%
+%% Copyright (C) 1999-2018 D. P. Story %%
%% dpstory@uakron.edu %%
%% %%
%% This program can redistributed and/or modified under %%
@@ -5442,11 +5442,21 @@
\index{keys:\levelchar#1\actualchar{%
\string\ttfamily\space#1}\encapchar
usage}\@esphack}
+\def\SpecialMainJSIndex#1{\@bsphack\index{%
+ #1\actualchar
+ {\string\ttfamily\space#1}
+ (JS function)%
+ \encapchar usage}%
+ \index{JS functions:\levelchar#1\actualchar{%
+ \string\ttfamily\space#1}\encapchar
+ usage}\@esphack}
\makeatother
\def\IndexOpt#1{\SpecialMainOptIndex{#1}%
\marginpar{\raggedleft\PrintDescribeMacro{#1}}}
\def\IndexKey#1{\SpecialMainKeyIndex{#1}%
\marginpar{\raggedleft\PrintDescribeMacro{#1}}}
+\def\IndexJS#1{\SpecialMainJSIndex{#1}%
+ \marginpar{\raggedleft\PrintDescribeMacro{#1}}}
%</docdefs>
%<dnidefs>% \DoNotIndex{\",\-,\#,\%,\&,\',\),\(,\*,\+,\-,\.,\,,\/,\<,\>,\@}
%<dnidefs>% \DoNotIndex{\def,\edef,\gdef,\xdef,\global,\long,\let, \catcode}