path: root/texmf-dist/doc/latex/acrotex/examples/jtxttst.tex
diff options
authorNorbert Preining <>2017-07-12 23:26:39 +0900
committerNorbert Preining <>2017-07-12 23:26:39 +0900
commit01c9ee84c09adfc3efe1cd93191a9c0473f985fe (patch)
tree6fe7c1648fa25e3dcc9b4c67657b89ac1525f289 /texmf-dist/doc/latex/acrotex/examples/jtxttst.tex
parent542c5a785f8db8d4469e296c69c86bc030285f68 (diff)
add acrotex
Diffstat (limited to 'texmf-dist/doc/latex/acrotex/examples/jtxttst.tex')
1 files changed, 237 insertions, 0 deletions
diff --git a/texmf-dist/doc/latex/acrotex/examples/jtxttst.tex b/texmf-dist/doc/latex/acrotex/examples/jtxttst.tex
new file mode 100644
index 00000000..eb2747e4
--- /dev/null
+++ b/texmf-dist/doc/latex/acrotex/examples/jtxttst.tex
@@ -0,0 +1,237 @@
+ [tight,designi]{web}
+\title{Extending the Exerquiz Package Text Fill-in Questions}
+\author{D. P. Story}
+\subject{Sample file}
+\keywords{LaTeX, PDF, derivative, calculus, JavaScript}
+Department of Mathematics}
+\def\D{\dfrac {\hbox{\text{d}}}{\text{d}x}}
+\def\dPose#1{$\D#1=$ }
+ \makebox[\parindent][l]{\large\color{red}$\blacktriangleright$}}
+\section{Text Fill-in Questions}
+\textsf{Exerquiz} can now create text fill-in questions, questions
+in which the response is text (as opposed to a mathematical
+expression). The underlying JavaScript compares the user's
+response against acceptable alternatives, as supplied by the
+author of the question. If there is a match, the response is
+deemed correct. For example:
+Who was the first President\footnote{of the United States}?\
+\RespBoxTxt{0}{0}{4}{George Washington}{Washington}
+ {G. Washington}{Geo. Washington}
+The command \cs{RespBoxTxt} is the one that creates a text fill-in question. Its
+syntax is
+\RespBoxTxt[#1]#2#3[#4]#5<plus listing of alternatives>
+\item[\ttfamily\#1:]Optional parameter used to modify the appearance of the
+ text field.
+\item[\ttfamily\#2:]This required parameter is a number that indicates
+the filtering method to be used. Permissible values of this parameter are
+ \item[\ttfamily-1:] (The default) The author's and user's answers are not filtered
+ in any way. (Spaces, case, and punctuation are preserved.)
+ \item[\ttfamily0:] The author's and user's answers are converted to
+ lower case, any white space and non-word characters are removed.
+ \item[\ttfamily1:] The author's and user's answers are converted to
+ lower case, any white space is removed.
+ \item[\ttfamily2:] The author's and user's answers are stripped of
+ white space.
+See the JavaScript function \texttt{eqFilter} in \texttt{exerquiz.dtx} for
+program code details. Additional filtering options may be added.
+\item[\ttfamily\#3:] This parameter is a number that indicates the compare
+method to be used. Permissible values of this parameter are
+ \item[\ttfamily0:] (The default) The author's and user's answers are
+ compared for an exact match. (These answers are filtered before they are
+ compared.)
+ \item[\ttfamily1:] The user's response is searched in an attempt to
+ get a substring match with the author's alternatives. Additional comparison
+ methods may be added.
+See the JavaScript function \texttt{compareTxt} in
+\texttt{exerquiz.dtx} for the program code details.
+\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. If the forth parameter is a `\texttt*', then an automatic
+naming scheme is used instead.
+\item[\ttfamily\#5:] This required parameter is the
+number of alternative answers that are acceptable. The alternative
+answers are listed immediately after this parameter. (The example
+above specified that $4$ alternatives follow.)
+% remove label `Quiz' and gobble up the space that follows it.
+The following series of examples illustrate different combinations
+parameters~\texttt{\#2} and~\texttt{\#3}. All questions are in
+response to the question ``Who was the first president of the
+United States?''
+\item Remove all white space and non-word characters, convert to lower case,
+then look for a match.
+\RespBoxTxt{0}{0}{4}{George Washington}{Washington}
+ {G. Washington}{Geo. Washington}
+Of course, ``George Washington'' and ``G. Washington'' are correct, but
+so too are ``georgewashington''and ``gwashington''.
+\item Remove all white space, convert to lower case, then look for an
+exact match. Here we don't remove non-word characters, such as punctuation.
+\RespBoxTxt{1}{0}{4}{George Washington}{Washington}
+ {G. Washington}{Geo. Washington}
+For example, answers ``G. Washington'', ``georgewashington'' and
+``g. washington'' are correct, but ``gwashington'' is not.
+\item Remove all white space, then look for an exact match. (Here,
+we do not remove punctuation and do not convert to lower case.)
+\RespBoxTxt{2}{0}{4}{George Washington}{Washington}
+ {G. Washington}{Geo. Washington} The
+response ``G. Washington'' is correct, but ``g. washington'' is not.
+\item Now lets put parameter~\texttt{\#3} equal to \texttt1. Here, we convert
+to lower case, remove white space, and look for a substring match.
+\RespBoxTxt{1}{1}{4}{George Washington}{Washington}
+ {G. Washington}{Geo. Washington} Note that ``President Washington'',
+``General Geo. Washington'', and ``Washington, George'' are correct.
+Also ``Fred Washington'' is correct, since it matches the second
+alternative, Washington. (If we eliminate Washington as an
+alternative, then ``Fred Washington'' would be judged incorrect,
+let's test that theory:
+\begin{oQuestion}{wash2}\RespBoxTxt{2}{1}{3}{George Washington}
+{G. Washington}{Geo. Washington}\end{oQuestion}
+\section{Short Quiz Environment}
+Answer each of the following. Passing is 100\%.
+\item Who was the first president of the United States?\par\kern3pt\noindent
+\RespBoxTxt{0}{0}[geow]{4}{George Washington}{Washington}{G. Washington}{Geo. Washington}\hfill
+\CorrAnsButton{George Washington}\kern1bp\sqTallyBox
+Yes, George Washington was the first President of the United
+States of America.
+\item Name \emph{one} of the two people recognized as a founder of
+\RespBoxTxt{2}{0}{5}{Isaac Newton}{Newton}{I. Newton}{Gottfried Leibniz}{Leibniz}\hfill
+\CorrAnsButton{Isaac Newton or Gottfried Leibniz}\kern1bp\sqTallyBox
+\item If $f$ is differentiable, then $f$ is continuous.
+\Ans1 True &
+\Ans0 False
+\dPose {4 x^{-1/2}}\RespBoxMath{-2*pow(x,-3/2)}{4}{.0001}{[1,2]}\hfill
+$\displaystyle\int \frac 1x\,dx = $\space
+\section{Quiz Environment}
+Here is a mixture of all types of questions, all with solutions.
+\begin{quiz}*{calcquiz} Answer each of the following. Passing
+is 100\%.
+\item If $\lim_{x\to a} f(x) = f(a)$, then we say that $f$ is\dots
+\Ans0 differentiable &\Ans1 continuous &\Ans0 integrable
+A function $f$ is said to be continuous at $x=a$ if $x\in\operatorname{Dom}(f)$,
+$\lim_{x\to a} f(x) $ exists and $\lim_{x\to a} f(x) = f(a)$.
+\item Name \emph{one} of the two people recognized as a founder of
+\RespBoxTxt{0}{0}[calc]{4}{Isaac Newton}{Newton}{Gottfried Leibniz}{Leibniz}%
+\CorrAnsButton{Isaac Newton or Gottfried Leibniz}
+Isaac Newton and Gottfried Leibniz are the co-creators of Calculus.
+\item $\cos(\pi) = \RespBoxMath{-1}[cospi]{1}{.0001}{[2,4]}\CorrAnsButton{-1}$
+Oh, come on now. You know that $\cos(\pi)=-1$.
+\item $\displaystyle\int \sin(x)\,dx =
+ \int \sin(x) \,dx = -\cos(x) + C
+Answers: \AnswerField\currQuiz