| 1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 |
% |
| 3 |
% RADIO BUTTON LATEX FILE EXAMPLE: USES QUESTIONANDRESPONSES COMMAND, 7 ARGUMENTS |
| 4 |
% 1ST ARGUMENT INDICATES THIS IS "RADIO" TYPE QUESTION |
| 5 |
% 2ND, 3RD, 4TH ARGUMENTS GIVE NAMES OF PREVIOUS, INDEX, NEXT LINKING FILES |
| 6 |
% 5TH ARGUMENT GIVES QUESTION, WITH UP TO 5 BUTTONS, AND |
| 7 |
% WHETHER OR NOT THESE RADIO BUTTONS ARE "ON" OR "OFF" |
| 8 |
% ONE AND ONLY ONE RADIO BUTTON IS ALLOWED TO BE "ON" |
| 9 |
% 6TH, 7TH ARGUMENTS GIVE RESPONSES IF USER ANSWER CORRECT OR INCORRECT |
| 10 |
% |
| 11 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12 |
\documentclass[dvips]{article} |
| 13 |
\usepackage{interactiveworkbook} % put in style directory; cannot appear in any other directory |
| 14 |
|
| 15 |
\begin{document} |
| 16 |
|
| 17 |
\questionandresponses{radio} % radio button kind of question |
| 18 |
{popup.pdf}{ndex.pdf}{ndex.pdf} % previous, index and next files are 2nd, 3rd, 4th arguments |
| 19 |
{Question 4. $\;$ A multiple radio button question. |
| 20 |
\begin{center} |
| 21 |
not the one \radioone{} \answerradioone{Off} $\quad\quad$ % incorrect answer is "Off" |
| 22 |
nope \radiotwo{} \answerradiotwo{Off} $\quad\quad$ % another incorrect answer |
| 23 |
not yet \radiothree{} \answerradiothree{Off} \\ % radiothree has no argument {} |
| 24 |
On \radiofour{} \answerradiofour{On} $\quad\quad$ % *one* of five radio buttons "On" |
| 25 |
Off \radiofive{} \answerradiofive{Off} % radiofive{} appears on question and response pages |
| 26 |
\end{center} |
| 27 |
} |
| 28 |
{Yes, correct.} % correct response hint is 6th argument of questionandresponses command |
| 29 |
{No, incorrect.} % incorrect response hint is 7th argument |
| 30 |
|
| 31 |
\end{document} |