summaryrefslogtreecommitdiff
path: root/texmf-dist/doc/latex/acrotex/examples/webeqtst.tex
blob: 0662bd7371903a41a826ce2062d6fd33844e35a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
\documentclass{article}
\usepackage{amsmath}
\usepackage[tight,designvi]{web}
\usepackage{exerquiz}

% \previewOn \pmpvOn

\title{\texorpdfstring{Acro\!\TeX}{AcroTeX} eDucation Bundle
    \texorpdfstring{\\[1ex]}{:}Exercises and Quizzes}
\author{D. P. Story}
\subject{File to test web and exerquiz packages}
\keywords{LaTeX, hyperref, PDF, exercises, quizzes}
\university{NORTHWEST FLORIDA STATE COLLEGE\\
   Department of Mathematics}
\email{dpstory@acrotex.net}
\version{3.0}
\copyrightyears{1999-\the\year}
\nocopyright
\revisionLabel{}

\sqTurnOffAlerts


% To insert a message on the cover page, uncomment the lines below,
% and insert the 'nodirectory' option into the web package line above.
\usepackage{pifont}
\optionalPageMatter{\par\minimumskip\vspace{\stretch{1}}
    \begin{center}
    \fcolorbox{blue}{webyellow}{%
    \begin{minipage}{.67\linewidth}
    \noindent\textcolor{red}{\textbf{Legend:}} In \hyperref[s:corrections]
    {Section~\ref*{s:corrections}}, a \textcolor{red}{\ding{52}}
    indicates that the student gave the correct response; a
    \textcolor{red}{\ding{56}}, indicates an incorrect response,
    in this case, the correct answer is marked with a \textcolor{webgreen}
    {\ding{108}}.
    \end{minipage}}
    \end{center}
}

\newcounter{probno}[section]
\renewcommand{\theprobno}{\thesection.\arabic{probno}}
%
% Define a problem environment with its own counter.
\newenvironment{problem}{%
\renewcommand\exlabel{Problem}%
\renewcommand\exlabelformat{\textbf{\exlabel\ \theprobno.}}%
\renewcommand\exsllabelformat
   {\noexpand\textbf{\exlabel\ \theprobno.}}%
\renewcommand\exrtnlabelformat{$\blacktriangleleft$}%
\renewcommand\exsecrunhead{Solutions to Problems}%
\begin{exercise}[probno]}
{\end{exercise}}


% Define a example environment with no counter
\newenvironment{example}{%
\renewcommand\exlabel{Example}%
\renewcommand\exlabelformat{\textbf{\exlabel.}}%
\renewcommand\exrtnlabelformat{$\square$}%
\SolutionsAfter
\begin{exercise}[0]}%
{\end{exercise}}

% Below is a new command to change the page layout for paper
% Useful for documents such as homework assignments and other
% hand-outs to the students. Try it when the forpaper, or
% forcolorpaper is in effect.
% \useFullWidthForPaper

% Use circles for MC questions in quiz environments.
\useMCCircles

\begin{document}

\maketitle

\tableofcontents


\section{Introduction}

This is a sample file to give templates of the environments
defined in \texttt{exerquiz}. The file illustrates the
\texttt{exercise}, the \texttt{shortquiz} and \texttt{quiz}
environments.

In the case of the quiz environments, only multiple-choice
questions are illustrated. Open ended, or objective style
questions are demonstrated in other sample files.

\section{Online Exercises}

A well-designed sequences of exercises can be of aid to the student.  The
\texttt{exercise} environment makes it easy to produce electronic
exercises.  By using the \texttt{forpaper} option, you can also make a
paper version of your exercises. See the \texttt{aeb\_man.pdf} reference
manual.

\begin{exercise}
Evaluate the integral \(\displaystyle\int x^2 e^{2x}\,dx\).
\begin{solution}
We evaluate by \texttt{integration by parts}:\normalsize
\begin{alignat*}{2}
 \int x^2 e^{2x}\,dx &
   = \tfrac12 x^2 e^{2x} - \int x e^{2x}\,dx &&\quad
           \text{$u=x^2$, $dv=e^{2x}\,dx$}\\&
   = \tfrac12 x^2 e^{2x} -
           \Bigl[\tfrac12 x e^{2x}-\int \tfrac12 e^{2x}\,dx\Bigr] &&\quad
           \text{integration by parts}\\&
   = \tfrac12 x^2 e^{2x} - \tfrac12 x e^{2x} + \tfrac12\int e^{2x}\,dx &&\quad
           \text{$u=x^2$, $dv=e^{2x}\,dx$}\\&
   = \tfrac12 x^2 e^{2x} - \tfrac12 x e^{2x} + \tfrac14 e^{2x} &&\quad
           \text{integration by parts}\\&
   = \tfrac14(2x^2-2x+1)e^{2x} &&\quad
           \text{simplify!}
\end{alignat*}
\end{solution}
\end{exercise}

In the preamble of this document, we defined a \texttt{problem}
environment with its own counter.  Here is an example of it.

\begin{problem}
Is $F(t)=\sin(t)$ an antiderivative of $f(x)=\cos(x)$?  Explain
your reasoning.
\begin{solution}
The answer is yes. The definition states that $F$ is an
antiderivative of $f$ if $F'(x)=f(x)$.  Note that
$$
       F(t)=\sin(t) \implies F'(t) = \cos(t)
$$
hence, $F(x) = \cos(x) = f(x)$.
\end{solution}
\end{problem}

\begin{problem}
Is $F(t)=\sin(t)$ an antiderivative of $f(x)=\cos(x)$?  Explain
your reasoning.
\begin{solution}
The answer is yes. The definition states that $F$ is an
antiderivative of $f$ if $F'(x)=f(x)$.  Note that
$$
       F(t)=\sin(t) \implies F'(t) = \cos(t)
$$
hence, $F(x) = \cos(x) = f(x)$.
\end{solution}
\end{problem}

\noindent By modifying the \texttt{exercise} environment, you can
also create an \texttt{example} environment.  The one defined in
the preamble of this document has no associated counter.

\begin{example}
Give an example of a set that is \textit{clopen}.
\begin{solution}
The real number line is both closed and open in the usual topology of the
real line.%
\end{solution}
\end{example}

There is an \texttt{exercise*} environment, using it signals the presence
of a multiple part exercise question. The following exercise illustrates
this environment.

\begin{exercise*}\label{ex:parts}
Suppose a particle is moving along the $s$-axis, and that its position
at any time $t$ is given by $s=t^2 - 5t + 1$.
\begin{parts}
\item[h]\label{item:part} Find the velocity, $v$, of the particle at any time
$t$.
\begin{solution}
Velocity is the rate of change of position with respect to time. In
symbols:
$$
                    v = \frac{ds}{dt}
$$
For our problem, we have
$$
        v = \frac{ds}{dt} =\frac d{dt}(t^2 - 5t + 1) = 2t-5.
$$
The velocity at time $t$ is given by $\boxed{v=2t-5}$.
\end{solution}

\item Find the acceleration, $a$, of the particle at any time $t$.
\begin{solution}
Acceleration is the rate of change of velocity with respect to time.
Thus,
$$
                    a = \frac{dv}{dt}
$$
For our problem, we have
$$
        a = \frac{dv}{dt} =\frac d{dt}(2t-5)=2.
$$
The acceleration at time $t$ is constant: $\boxed{a=2}$.
\end{solution}
\end{parts}
\end{exercise*}

References can be made to a particular part of an exercise; for example,
``see \hyperref[item:part]{Exercise~\ref*{ex:parts}(\ref*{item:part})}.''
Part (a) is in \textcolor{webblue}{blue}; the solutions for that part is
``hidden''.  This is a new option for the \texttt{exercise} environment.

There is now an option for listing multi-part question in tabular form.
This problem style does not obey the \texttt{solutions\-after} option.

\begin{exercise*}
Simplify each of the following expressions in the complex number
system. \textit{Note}: $\bar z$ is the conjugate of $z$;
$\operatorname{Re} z$ is the real part of $z$ and
$\operatorname{Im} z$ is the imaginary part of $z$.
\begin{parts}[2]
\item $i^2$
\begin{solution}[]
$i^2 = -1$
\end{solution}
&
\item $i^3$
\begin{solution}[]
$i^3 = i i^2 = -i$
\end{solution}
\\
\item $z+\bar z$
\begin{solution}[]
$z+\bar z=\operatorname{Re} z$
\end{solution}
&
\item[h] $1/z$
\begin{solution}[]
$\displaystyle\frac 1z=\frac 1z\frac{\bar z}{\bar z}=\frac z{z\bar z}=\frac z{|z|^2}$
\end{solution}
\end{parts}
\end{exercise*}

\section{Short Quizzes with or without Solutions}


Short quizzes are quizzes with immediate response. As soon as the
user enters an answer, that answer is immediately evaluated, the
results of the evaluation are communicated to the user.

Solutions can optionally be included in each question. Below is a
\texttt{shortquiz} without solution.

\begin{shortquiz}
Was it in Xanadu did Kubla Kahn a stately pleasure dome
decree?
\begin{answers}{4}
\bChoices
    \Ans1 True\eAns
    \Ans0 False\eAns
\eChoices
\end{answers}
\end{shortquiz}

\noindent Below is a \texttt{shortquiz} with a solution.

\goodbreak

\begin{shortquiz*}[KublaKhan]
In what year did Columbus sail the ocean blue?
\begin{answers}[qzcolumbus1]{4}
\bChoices
    \Ans0 1490\eAns
    \Ans0 1491\eAns
    \Ans1 1492\eAns
    \Ans0 1493\eAns
\eChoices
\end{answers}
\begin{solution}
\begin{quote}
  In 1492, \\
  Columbus sailed the ocean blue.\hfill

  Profound was the logic in his quest,\\
  to get to the east, he headed west.\footnote{This poem was obtained by personal
  communication from Leonard A. Stefanski,
Department of Statistics, North Carolina State University.}
\end{quote}
\end{solution}
\end{shortquiz*}

\noindent These two types can be bundled together using the
\texttt{questions} environment.

\begin{shortquiz}
Answer each of the following. Passing is 100\%.

\begin{questions}

\item Was it in Xanadu did Kubla Kahn a stately pleasure dome
decree?
\begin{answers}{4}
\Ans1 True & \Ans0 False \\
\end{answers}

\item In what year did Columbus sail the ocean blue?
\begin{answers}[qzcolumbus2]{4}
\Ans0 1490 &\Ans0 1491 &\Ans1 1492 &\Ans0 1493
\end{answers}
\begin{solution}
\begin{quote}
  In 1492, \\
  Columbus sailed the ocean blue.

  Profound was the logic in his quest,\\
  to get to the east, he headed west.\footnote{This poem was obtained by personal
  communication from Leonard A. Stefanski,
Department of Statistics, North Carolina State University.}
\end{quote}
\end{solution}
\end{questions}
\end{shortquiz}

\noindent Try using the \texttt{proofing} option of \textsf{exerquiz}. In
this case, the correct answer is indicated to the side; useful, perhaps,
for proof-reading the document


\section{Graded Quizzes with JavaScript}

\CorrectionsOff % Don't want corrections for these two quizzes.

You can create graded quizzes using the \texttt{quiz} environment.
Here is a graded quiz using simple links.  This might be suitable for a
limited number of questions.

\begin{quiz}{qzdiscr1} Using the discriminant, $b^2-4ac$, respond to each of the
following questions.

\begin{questions}
\item Is the quadratic polynomial $x^2-4x + 3$ irreducible?
\begin{answers}{4}
\Ans0 Yes & \Ans1 No
\end{answers}
\item Is the quadratic polynomial $2x^2 - 4x + 3 $ irreducible?
\begin{answers}{4}
\Ans1 Yes &\Ans0 No
\end{answers}
\item How many solutions does the equation $2x^2 - 3x - 2= 0$ have?
\begin{answers}{4}
\Ans0 none &\Ans0 one &\Ans1 two
\end{answers}
\end{questions}
\end{quiz}\qquad\ScoreField{qzdiscr1}

\noindent By  using the \texttt*-option, you can create a multiple choice
set of question using check boxes.

\begin{quiz*}{qzdiscr2}
Using the discriminant, $b^2-4ac$, respond to each of the
following questions.

\begin{questions}
\item Is the quadratic polynomial $x^2-4x + 3$ irreducible?
\begin{answers}{4}
\Ans0 Yes &\Ans1 No
\end{answers}
\item Is the quadratic polynomial $2x^2 - 4x + 3 $ irreducible?
\begin{answers}{4}
\Ans1 Yes &\Ans0 No
\end{answers}
\item How many solutions does the equation $2x^2 - 3x - 2= 0$ have?
\begin{answers}{4}
\Ans0 none &\Ans0 one &\Ans1 two
\end{answers}
\end{questions}
\end{quiz*}\quad\ScoreField\currQuiz

\noindent The \texttt{proofing} option of \textsf{exerquiz} can be used to
mark the correct answer to the side; useful, perhaps, for proof-reading
the document


\section{Correcting Quizzes with JavaScript}\label{s:corrections}

\CorrectionsOn  % Now we want corrections

Beginning with version 1.2 of \textsf{exerquiz}, you can now grade
the quizzes created by the \texttt{quiz} environment.
In this section, we illustrate the \texttt{quiz} environment with
corrections.

There are two types: link-style and form-style.
This is the link-style format:


\begin{quiz}{qzTeXl} Answer each of the following. Passing
is 100\%.
\begin{questions}
\item Who created \TeX?
\begin{answers}4
\Ans1 Knuth &\Ans0 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\item Who originally wrote \LaTeX?
\begin{answers}{4}
\Ans0 Knuth &\Ans1 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\end{questions}
\end{quiz}\quad\ScoreField\currQuiz\CorrButton\currQuiz

\medskip
We can obtain the forms-style quiz simply by inserting an \texttt*
before the quiz field name.
\textcolor{red}{Important!}  Be sure to name each quiz field
differently!

%\previewtrue

%\useMCRects


\begin{quiz*}{qzTeXf} Answer each of the following. Passing
is 100\%.
\begin{questions}
\item Who created \TeX?
\begin{answers}*{4}
\Ans1 Knuth &\Ans0 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\begin{solution}
Yes, it was Donald Knuth who first created \TeX.
\end{solution}
\item Who originally wrote \LaTeX?
\begin{answers}*{4}
\Ans0 Knuth &\Ans1 Lamport &\Ans0 Carlisle &\Ans0 Rahtz
\end{answers}
\begin{solution}
Yes, it was Leslie Lamport who first created \TeX.
\end{solution}
\end{questions}
\end{quiz*}\quad\ScoreField\currQuiz\CorrButton\currQuiz

The ``corrections'' button can be modified to fit your needs. The quiz
below queries your knowledge of the people who maintain various freeware
\TeX\ Systems.\footnote{This quiz is a bit out of date.} The corrections
button has been modified to take on a different look.

\begin{quiz*}{qzTeXc} Answer each of the following. Passing
is 100\%.
\begin{questions}
\item What \TeX\ System does Thomas Esser maintain?
\begin{answers}{4}
\Ans0 Mik\TeX &\Ans0 cs\TeX &\Ans1 te\TeX &\Ans0 fp\TeX
\end{answers}
\item What \TeX\ System does Fabrice Popineau maintain?
\begin{answers}{4}
\Ans0 Mik\TeX &\Ans0 cs\TeX &\Ans0 te\TeX &\Ans1 fp\TeX
\end{answers}
\item What \TeX\ System does Christian Schenk maintain?
\begin{answers}{4}
\Ans1 Mik\TeX &\Ans0 cs\TeX &\Ans0 te\TeX &\Ans0 fp\TeX
\end{answers}
\end{questions}
\end{quiz*}\quad
\ScoreField{qzTeXc}\cgBdry\relax
   \CorrButton[\BC{0 0 1}       %  blue border color
   \CA{TeX}                     %  Button text
   \RC{Users}                   %  rollover text
   \AC{Group}                   %  pushed text
   \DA{/TiRo 10 Tf 0 0 1 rg}    % times roman, 10 pt, blue text
   \W{1}\S{I}                   % border width 1, inset button
   ]{qzTeXc}

\section{Objective-Style Questions}

It is possible to pose objective-style questions (fill-in-the-blank). The
demo file for this style question is called
\href{http://www.math.uakron.edu/~dpstory/acrotex/examples/html/jquiztst.pdf}{jquiztst.pdf}
(relative link: \href{jquiztst.pdf}{jquiztst.pdf}). Click on the link to
review this demo file.

\end{document}