path: root/texmf-dist/doc/latex/acrotex/examples/jquiztst.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/jquiztst.tex
parent542c5a785f8db8d4469e296c69c86bc030285f68 (diff)
add acrotex
Diffstat (limited to 'texmf-dist/doc/latex/acrotex/examples/jquiztst.tex')
1 files changed, 284 insertions, 0 deletions
diff --git a/texmf-dist/doc/latex/acrotex/examples/jquiztst.tex b/texmf-dist/doc/latex/acrotex/examples/jquiztst.tex
new file mode 100644
index 00000000..097882db
--- /dev/null
+++ b/texmf-dist/doc/latex/acrotex/examples/jquiztst.tex
@@ -0,0 +1,284 @@
+ [tight,
+% dvips, % <- replace with any supported driver
+ designi,%forpaper,
+ navibar
+ ]{web}
+\title{Extending the Exerquiz Package Math Fillin Questions}
+\author{D. P. Story}
+\subject{Sample file}
+\keywords{LaTeX, PDF, derivative, calculus, JavaScript}
+Department of Mathematics}
+% Uncomment the lines below to create buttons
+% for "Begin Quiz", "End Quiz" instead of links
+% Uncomment this line to require the student
+% to answer all questions in the quiz before
+% the quiz is evaluated.
+\font\hv=cmtt10 \def\hvperk{\char`^}
+%\font\hv=hv at 9pt \def\hvperk{\char142 }
+\gdef\js{\bgroup\hv\catcode`\^=\active \let^=\hvperk \jsi}
+\def\D{\dfrac {\text{d}}{\text{d}x}}
+\def\dPose#1{$\D#1=$ }
+\section{Math Fill-In Question}
+The current version of \textsf{exerquiz} included only multiple
+choice questions. That's all well and good, but instructors would
+occasionally like to ask questions that would require the student
+to fill in the answer, whether it be numerical or symbolic.
+This new question type, the Math Fill-in, can be used in either
+the \texttt{shortquiz} or \texttt{quiz} environment. In the
+former case, there is immediate feedback as to right or wrong; in
+the latter case, correction is delayed until the quiz is completed
+and the user requests to be corrected.
+In either case, you can choose to include the correct answer,
+which can be obtained by the click of a button.
+The next section outlines the syntax for the user to enter the
+When responding to a Math Fill-in question, you answer by typing
+in your answer. Use the following notation to enter your answers.
+\item Use \js{*} to indicate multiplication: Type \js{4*x} for $4x$;
+\item Use \js{^} to indicate powers: Type \js{4*x^3} for
+$4x^3$; \js{12*x^-6} for $12x^{-6}$.
+\item Use parentheses to delimit the argument of a function; i.e., type
+\js{sin(x)} rather than \js{sin x}.
+\item Use parentheses to define the {\it scope\/} of an operation: For
+example, type \js{4*x*(x^2+1)^3} for $4x(x^2+1)^3$; \js{ 4^(2*x+1)} for
+$4^{2x+1}$; \js{(sin(x))^2} for $(\sin(x))^2$. {\it Do not\/} type
+\js{sin^2(x)} for $\sin^2(x)$, type \js{(sin(x))^2} instead.
+\item You can also use brackets \js{[ ]} or braces \js{\{ \}},
+to delimit a mathematics expression.
+\item Functions you may use:
+ \item Trig: \js{sin}, \js{cos}, \js{tan}, \js{cot}, \js{sec}, \js{csc};
+ \item Inverse Trig: \js{asin}, \js{acos}, \js{atan};
+ \item Log: \js{ln} (natural log), or use \js{\tt log}; e.g. \js{ln(x)};
+ \item Exponential: The natural exponential function, $e^x$,
+ can be entered as \js{exp(x)} or as \js{e^x}.
+ \item The absolute function, \js{abs($\cdot$)} can also be written
+ in the usual way \js{|$\cdot$|}; thus, you can type either
+ \js{abs(x)} or \js{|x|}.
+ \item Misc.: \js{sqrt}, usage \js{sqrt(x)} for $\sqrt{x}$ (or, use
+ exponential notation: \js{x^(1/2)}).
+When you enter your response, some attempt will be made to
+determine whether the response is a valid mathematical expression.
+For example, if you say \js{san(x)}, the function `\js{san}' will
+not be recognized as a valid mathematical function; an error
+message is generated, and the user is not penalized for a possible
+typing error. The JavaScript routines will also check for
+unbalanced parentheses; thus, \js{((x^4+1) + sin(x)^2} will be
+flagged as a syntax error.
+\medskip\noindent\hr{\textbf{Important:}} When you enter a function
+of a single variable---the only type currently supported---use as
+the independent variable implied by the statement of the problem.
+If the problem statement involves the variable $x$, use \js{x} as
+the independent variable; if the problem statement uses $t$, use
+\js{t} in your answer. To enter a function of $t$ when a function
+of $x$ is expected will, no doubt, result in missed problem.
+\subsection{Answers and Solutions}
+For fill-in questions, if the document author so wishes, answers
+and (optionally) solutions can be provided. The author provides
+an ``Ans'' button. This button is visible for a \texttt{shortquiz}
+and hidden for a \texttt{quiz}.
+For a \texttt{shortquiz}, the ``Ans'' button can be clicked at
+anytime. In the case of a \texttt{quiz}, after a \texttt{quiz} has
+been completed, the hidden ``Ans'' buttons appear. Click on the
+button to get an answer to the problem.
+Concerning solutions. If the ``Ans'' button has a green boundary,
+that means that question has a solution. Performing a
+\texttt{Shift-Click} on the ``Ans'' button causes the viewer to
+jump to the solution. For multiple choice questions, the boundary
+for the correct answer is colored green as well. Click on the
+answer field to jump to the solution.
+Solutions to a \texttt{quiz} can be protected from prying eyes
+with the \texttt{\string\NoPeeking} command. See the
+\hyperref[s:quiz] {Section~\ref*{s:quiz}} for an example and a
+brief discussion.
+\subsection{Practice Example}
+\noindent\hb{\textbf{Example:}} Consider the following sample question.
+Practice by typing in the answer:
+\noindent$\dfrac{\text{d}}{\text{d}x} {(x^4 + 1)^{1/2}} =
+\underset{\text{\rotatebox{-45}{\rlap{The Response Box}}}}
+ {\underbrace{\STRUT\efKern{1bp}{0bp}\RespBoxMath{2*x^3*(x^4+1)^(-1/2)}{4}{.0001}{[1,2]}\relax\efKern{1bp}{0bp}}}\kern-1bp
+\underset{\text{\rotatebox{-45}{\rlap{Answer Button}}}}
+ {\underbrace{\STRUT\efKern{1bp}{0bp}\CorrAnsButton{2*x^3*(x^4+1)^(-1/2)}\efKern{1bp}{0bp}}}\kern-1bp
+\underset{\text{\rotatebox{-45}{\rlap{Num.\ of incorrect tries}}}}
+ {\underbrace{\STRUT\efKern{1bp}{0bp}\sqTallyBox\relax\efKern{1bp}{0bp}}}\olBdry\efKern{-1bp}{0bp}\sqClearButton$
+When a correct answer is input into the response box, the color of
+the border surrounding the response box changes to \textcolor{webgreen}{green}.
+The answer can also be expressed correctly using the \js{sqrt}
+operator, try modifying the answer using \js{sqrt}.
+\subsection{Short Quiz Environment}\label{s:shortquiz}
+%In the following problems, answer by typing in your
+%response using the correct syntax.
+Problem \#2 illustrates how to define a problem with a variable
+other than the default $x$. Click on the ``Ans'' button to get
+answers, shift-click on ``Ans'' buttons that have a green boundary
+to get a solution.
+\begin{shortquiz*}[answer] Answer each of the following. Passing is 100\%.
+\item If $f$ is differentiable, then $f$ is continuous.
+\Ans1 True & \Ans0 False
+Yes, differentiability at a point implies continuity at that point.
+%If you want another variable other than $x$, then specify the variable immediately
+%following the correct answer in the \RespBoxMath command. Following the optional
+%variable specification is the optional named destination for the solution the
+%the problem.
+\item $\dfrac{\text{d}}{\text{d}t} {4 t^{-1/2}}
+ = \RespBoxMath{-2*t^(-3/2)}(t)[diffprob]{4}{.0001}{[1,2]}$\hfill
+We use the power rule:
+ 4 t^{-1/2}
+ = 4(-1/2) t^{-3/2}
+ = \boxed{-2 t^{-3/2}}
+Or, in the syntax of this quiz: \js{-2*t^(-3/2)}.
+\item \dPose{e^{x^2}}\RespBoxMath{2*x*e^(x^2)}{4}{.0001}{[0,1]}\hfill
+\item $\displaystyle\int_0^\pi \sin(x)\,dx
+ = \RespBoxMath{2}{1}{.0001}{[0,1]}$\hfill\CorrAnsButton{2}\olBdry\sqTallyBox
+\subsection{Quiz Environment}\label{s:quiz}
+The example below illustrates multiple choice questions
+and objective math questions in the \texttt{quiz} environment
+and is protected by the \texttt{\string\NoPeeking}
+command. First, browse the solutions at the end
+of the file, when you encounter a solution protected by
+\texttt{\string\NoPeeking}, see what happens.
+Click on the ``Ans'' button to get answers, shift-click on ``Ans''
+buttons that have a green boundary to get a solution.
+\NoPeeking % or put in preamble
+\begin{quiz}{mathquiz} 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 $\cos(\pi) = \RespBoxMath{-1}[cospi]{1}{.0001}{[2,4]}\cgBdry\kern1bp\CorrAnsButton{-1}$
+Of course, everyone knows that $\cos(\pi) = -1 $.
+\item \dPose{e^{x^2}}\RespBoxMath{2*x*e^(x^2)}[diffexp]{4}{.0001}{[0,1]}\cgBdry\kern1bp
+First apply the rule for differentiating an the natural exponential, then apply
+the power rule:
+ \dfrac d{dx}\,e^{x^2} &
+ = e^{x^2}\,\dfrac d{dx}\,x^2 \\&
+ = e^{x^2}\,(2x) \\&
+ = 2x e^{x^2}
+In the syntax of this document, \js{2*x*e^(x^2)}.
+Answers: \AnswerField\currQuiz