★ | right first attempt |
✓ | right |
✗ | wrong |
The use of WebQuiz is described in the next section. Later sections describe how each of the WebQuiz environments are used.
The discussion environment in WebQuiz can also be used to write Web Pages like this one (The pages you are reading here were written using WebQuiz.)
> latex quiz1 % latex a quiz file
> pdflatex quiz1 % a PDF versio of the quiz
> xdvi quiz1 % view the quiz using xdvi
> dvips quiz1 % print the quiz
> webquiz quiz1 % converts the quiz to html
Converting the quiz to html can take quite a long time, particularly if a large number of images need to be created.
\documentclass{webquiz}
\title{Quiz 1: Complex numbers}
\UnitCode{MATH1001}
\UnitName{Differential Calculus}
\UnitURL{/u/UG/JM/MATH1001/}
\QuizzesURL{/u/UG/JM/MATH1001/Quizzes/}
\begin{document}
\begin{discussion}[short heading][optional heading]
. . . % optional discussion
\end{discussion}
\begin{question} % question 1
. . .
\end{question}
\begin{question} % question 2
. . .
\end{question}
.
.
\end{document}
In the preamble of the LATEX file you can specify the unit code, the name of the unit of study, the location of the homepage for the unit and the index file for the quizzes for this unit; this is done using the commands \UnitCode, \UnitName, \UnitURL and \QuizzesURL respectively. If the command \QuizzesURL is omitted then the URL for the quiz index file is set to \UnitURL/Quizzes.
The title of the quiz can be set in the preamble using the \title command. Note that the \title command must appear before the \begin{document} command. As in any LATEX document, the preamble can define macros and load other LATEX packages the usual way .
By using the discussion environment you can summarise the
material for the students or add introductory material for the quiz. For
example, discussion environments can be used to recall that main
concepts being covered by the quiz or to give references to the lecture notes
for the unit. The syntax for the discussion environment is as
follows:
\begin{discussion}[optional short heading][optional heading]
. . .
\end{discussion}
Anything you like (text, mathematics, …) can go inside discussion environments. The optional heading, which defaults to Discussion”, is used both as the section heading on the web page and as the heading in the side-menu on left hand side of the page. If a short heading is also given then it is used in the side-menu. The quiz can contain zero or more discussion items ( and zero or more quiz questions).
Questions are set inside a question environment. The text is followed by the answers.
WebQuiz supports three types of questions:
With each of these types of questions you can (and should) provide feedback to the students depending on whether their answer is correct or incorrect. Below we describe how to produce these different types of questions.
The different choices in a multiple choice question must be inside a choice environment. This environment behaves like a standard LATEX list environment except that instead of using \item for list item you use:
\begin{question}
. . .question text
\begin{choice}
\(in)correct . . . text for (in)correct option
\feedback . . . feedback on response
\(in)correct . . . text for (in)correct option
\feedback . . . feedback on response
.
.
.
\end{choice}
\end{question}
At most one \feedback response should be given for each \correct and each \incorrect response. The \feedback commands are optional; however, it is recommended that you use them because targeted feedback to the students based on their responses can be beneficial.
For example, the code below, when run through WebQuiz, produces
1 in the online
manual quiz.
\begin{question}
The shaded region in the graph
\begin{center}
\begin{pspicture}(-3,-1.5)(3,4)
\pscircle[linewidth=1pt,linestyle=dashed,%
fillcolor=SkyBlue,fillstyle=solid](1,1){2}
\psaxes[linecolor=red,linewidth=1pt,labels=none]%
{->}(0,0)(-1.5,-1.5)(3.5,3.5)
\rput(3.75,0){$x$}
\rput(0,3.85){$iy$}
\rput(3,-0.4){3}
\rput(-0.4,3){3$i$}
\psdots(1,1)
\end{pspicture}
\end{center}
is equal to which of the following sets of complex numbers?
\begin{choice}
\incorrect $\{z \in \C : (z-1)^{2}+(z-(i+1))^{2}<2\}$
\feedback The equation of a circle in the complex plane with
centre $a+ib$ and radius $r$ is
\begin{displaymath}
\{z\in\C : |z-(a+ib)|<r \}.
\end{displaymath}
\incorrect $\{z \in \C : z+(i+1)<2\}$
\feedback You want the set of points whose \textit{distance}
from $1+i$ is less than $2$.
\correct $\{z \in \C : |z-(i+1)|<2\}$
\feedback The graph shows the set of complex numbers whose
distance from $1+i$ is less than $2$.
\incorrect $\{z \in \C : |z-2|<|i+1-2|\}$
\feedback As $|i+1-2|=\sqrt 2$, this is the set of complex
numbers whose distance from $2$ is less than
$\sqrt 2$.
\incorrect None of the above.
\feedback The graph shows the set of complex numbers whose
distance from the centre of the circle is less than $2$.
\end{choice}
\end{question}
The only difference to the previous case is that zero or more \correct commands can appear.
\begin{question}
. . .question text. . .
\begin{choice}[multiple]
\(in)correct . . . text for (in)correct option
\feedback . . . feedback on response
\(in)correct . . . text for (in)correct option
\feedback . . . feedback on response
.
.
.
\end{choice}
\end{question}
For example,
2 below was typed into WebQuiz using the following commands:
\begin{question}
Which of the following numbers are prime?
\begin{choice}[multiple]
\incorrect 1
\feedback By definition, a prime is a number greater than 1
whose only factors are 1 and itself.
\correct 19
\feedback The only factors of 19 are 1 and itself.
\incorrect 6
\feedback 2 is a factor of 6
\correct 23
\feedback The only factors of 23 are 1 and itself.
\correct 191
\feedback The only factors of 191 are 1 and itself.
\end{choice}
\end{question}
\begin{question}
. . .question text. . .
\begin{choice}[multiple, columns=n] . . . n columns
\(in)correct . . . text for (in)correct option
\feedback . . . feedback on response
\(in)correct . . . text for (in)correct option
\feedback . . . feedback on response
.
.
.
\end{choice}
\end{question}
If the optional argument [multiple] is not present, then the question admits precisely one correct answer.
For example,
3 below was typed into WebQuiz using the following commands:
\begin{question}
What are suitable parametric equations for this plane curve?
\begin{center}
\psset{unit=.6cm}
\begin{pspicture}(-2.5,-0.5)(5,5.5)
\psaxes[linecolor=red,linewidth=1pt,labels=none]%
{->}(0,0)(-2.5,-1.5)(5,5)
\psellipse[linecolor=SkyBlue,linewidth=2pt](1,2)(3,2)
\end{pspicture}
\end{center}
\begin{choice}[columns=1]
\incorrect $x=2\cos t + 1$, $y=3\sin t + 2$
\feedback This is an ellipse with centre $(1,2)$ and with axes of
length $4$ in the $x$-direction and $6$ in the $y$-direction.
\begin{center}
\psset{unit=.6cm}
\begin{pspicture}(-2.5,-0.5)(5,5.5)
\psaxes[linecolor=red,linewidth=1pt,labels=none]%
{->}(0,0)(-2.5,-1.5)(5,5)
\parametricplot[linecolor=SkyBlue,linewidth=2pt]{0}{360}%
{t cos 2 mul 1 add t sin 3 mul 2 add}
\end{pspicture}
\end{center}
\correct $x=3\cos t + 1$, $y=2\sin t + 2$
\feedback The curve is an ellipse centre (1,2) with axes length 6
in the $x$ direction and 4 in the $y$ direction.
\incorrect $x=3\cos t - 1$, $y=2\sin t - 2$
\feedback This is an ellipse with centre $(-1,-2)$ and with axes
of length $6$ in the $x$-direction and $4$ in the $y$-direction.
\begin{center}
\psset{unit=.6cm}
\begin{pspicture}(-5,-4)(1,2)
\psaxes[linecolor=red,linewidth=1pt,labels=none]%
{<-}(0,0)(-4.5,-5.5)(1,2)
\parametricplot[linecolor=SkyBlue,linewidth=2pt]{0}{360}%
{t cos 3 mul 1 sub t sin 2 mul 2 sub}
\end{pspicture}
\end{center}
\incorrect $x=2\cos t - 1$, $y=3\sin t - 2$
\feedback This is an ellipse with centre $(-1,-2)$ and with axes
of length $4$ in the $x$-direction and $6$ in the $y$-direction.
\begin{center}
\psset{unit=.6cm}
\begin{pspicture}(-4,-5)(1,2)
\psaxes[linecolor=red,linewidth=1pt,labels=none]%
{<-}(0,0)(-4.5,-5.5)(1,2)
\parametricplot[linecolor=SkyBlue,linewidth=2pt]{0}{360}%
{ t cos 2 mul 1 sub t sin 3 mul 2 sub}
\end{pspicture}
\end{center}
\end{choice}
\end{question}
Feedback for correct and incorrect answers is given using the macros \whenRight and \whenWrong, respectively. The structure of questions with \answer’s is as follows:
\answer[comparison method]{correct answer}
\begin{question}
. . .question text. . .
\answer[*][complex|integer|lowercase|number|string]{actual answer}
\whenRight . . . feedback when right (optional)
\whenWrong . . . feedback when wrong (optional)
\end{question}
See the WebQuiz manual for details of the different comparison types. For example,
4 below was typed into WebQuiz using the following commands:
\begin{question}
If the vectors $\vect{a}$ (of magnitude 8 units) and $\vect{b}$
(of magnitude 3 units) are perpendicular, what is the value
of
\begin{displaymath}
|\vect{a} -2\vect{b}|~?
\end{displaymath}
(Hint: Draw a diagram!)
\answer[number]{10}
\whenRight The vectors $\vect{a}$, \(-2\vect{b}\), and
$\vect{a} - 2\vect{b}$ form the sides of a right-angled
triangle, with sides of length $8$ and $6$ and
hypotenuse of length $|\vect{a} -2\vect{b}|$. Therefore
by Pythagoras’ Theorem,
\(|\vect{a} -2\vect{b}|=\sqrt{8^2+6^2}=10\).
\whenWrong Draw a diagram and then use Pythagoras’ theorem.
\end{question}
If no URL is given as an optional argument to \quiz then WebQuiz sets the url(s) to quiz1.html, quiz2.html and so on.
\begin{quizindex}
\quiz[url1]{title for quiz 1}
\quiz[url2]{title for quiz 2}
. . .
\end{quizindex}
To write quizzes using WebQuiz it is only necessary to know LATEX, however, the WebQuiz system has three components:
The LATEX component of WebQuiz was written by Andrew Mathas and the python, CSS and Javascript code was written by Andrew Mathas (and Don Taylor), based on an initial prototype of Don Taylor’s from 2001. Since 2004 the program has been maintained and developed by Andrew Mathas. Although the program has changed substantially since 2004, Don’s idea of using TEX4ht, and some of his code, is still in use.
Thanks are due to Bob Howlett for general help with CSS and, for Version 5, to Michal Hoftich for technical advice.