summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/interactiveworkbook/samplefiles/popup.tex
blob: 5d619c84d8d8caa03c863feaf698b28b5adf67e4 (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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  POPUP MENU LATEX FILE EXAMPLE: USES QUESTIONANDRESPONSES COMMAND, 7 ARGUMENTS
%       1ST ARGUMENT INDICATES THIS IS "POPUP" TYPE QUESTION
%       2ND, 3RD, 4TH ARGUMENTS GIVE NAMES OF PREVIOUS, INDEX, NEXT LINKING FILES
%       5TH ARGUMENT GIVES QUESTION, WITH UP TO 5 MENUS, AND
%           WHATEVER THESE MENUS ARE SET TO (A,B,C,D,E,F,G,H OR I)
%       6TH, 7TH ARGUMENTS GIVE RESPONSES IF USER ANSWER CORRECT OR INCORRECT
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[dvips]{article}
\usepackage{interactiveworkbook} % put in style directory; cannot appear in any other directory

\begin{document}

% questionandresponses command has *seven* arguments

\questionandresponses{popup} % popup menu kind of question, needed in style file
{check.pdf}{ndex.pdf}{field.pdf} % previous, index and next files are 2nd, 3rd, 4th arguments
{ Question 2. $\;$ A multiple popup question. % question is 5th argument
    \begin{center}
    a is correct \popupone \answerpopupone{a} $\quad$ % user gives "a" as the correct answer
    try b \popuptwo \answerpopuptwo{b} $\quad$ % question giver gives "b" as the correct answer
    c, not "c" \popupthree \answerpopupthree{c} \\ % "popupthree" is what question taker sees
    g \popupfour \answerpopupfour{g}  $\quad$
    and i \popupfive \answerpopupfive{i}
    \end{center}
} % end of 5th argument
{Yes, correct, because all choices correspond to the preset answers.} % correct response hint
{No, try again.} % incorrect response hint is 7th argument

\end{document}