| 1 |
\documentclass[tikz]{webquiz} |
| 2 |
\usepackage{tikz} |
| 3 |
\title{A tikz example} |
| 4 |
\begin{document} |
| 5 |
\begin{question} % a quiz question |
| 6 |
What number is represented by the dot on the following number line? |
| 7 |
\begin{center} |
| 8 |
\begin{tikzpicture} |
| 9 |
\foreach \x in {-3,...,3} { \draw(\x,0.25) --(\x,0)node[below]{$\x$}; } |
| 10 |
\foreach \x in {-2.5,...,2.5} { \draw(\x,0.18) --(\x,0); } |
| 11 |
\draw[thick,<->](-3.5,0)--(3.5,0); |
| 12 |
\filldraw[blue!50!white](1.5,0) circle (1mm); |
| 13 |
\end{tikzpicture} |
| 14 |
\end{center} |
| 15 |
\answer[number]{1.5} % inserts an answer box and specifies the answer as 1.5 |
| 16 |
\whenRight Correct! |
| 17 |
\whenWrong Incorrect! |
| 18 |
\end{question} |
| 19 |
\end{document} |