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