summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/fc_arith/examples/fc04.tex
blob: 537e02981e258eb046d2343e7f9d6527023457f4 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
\documentclass{article}
\usepackage[
    web={usetemplates,pro,usesf},
    eforms
]{aeb_pro}
\usepackage{fc_arith}
\margins{.25in}{.25in}{.25in}{.25in}
\screensize{4.3in+25bp}{4.4in}
\textBgColor{webyellow}

\DeclareDocInfo
{
    university={\AcroTeX.Net},
    title={PDF Flash Card: Arithmetic},
    author={D. P. Story, AcroTeX.Net, Northwest Florida State College, The University of Akron},
    email={dpstory@acrotex.net},
    subject={Practice elementary arithmetic operations},
    talksite={\url{www.acrotex.net}},
    version={1.0},
    keywords={AcroTeX.Net, arithmetic, flash cards},
    copyrightStatus=True,
    copyrightNotice={Copyright (C) \the\year, D. P. Story},
    copyrightInfoURL={http://www.acrotex.net}
}
\DeclareInitView{windowoptions={showtitle}}

%
% Set the ranges of the operations
%
\DeclareArithParams
{%
    addT={[2,20]},addB={[5,30]},
    subT={[1,5]},subB={[5,10]},
    mulT={[1,12]},mulB={[1,10]},
    divQ={[1,4]},divB={[1,10]},
}

%
% Optionally insert a logo in the upper right corner using \rheader (part of the running header.
%
\rheader{\parbox[t]{.5in}{\kern0pt\includegraphics[width=\linewidth]{graphics/nwfsc_logo}}}

\begin{popupmenu}{fcMenu}
    \item{title=Options, return=0}
    \item{title=Toggle Keypad,return=1}
    \item{title=About PDF Flash Cards, return=2}
\end{popupmenu}

% Import and place icon appearances
\declareMultiImages
{%
    {path=graphics/fc_icons.pdf,page=0,placement=StartAgain}
    {path=graphics/fc_icons.pdf,page=1,placement=[1]StartAgain}
    {path=graphics/fc_icons.pdf,page=2,placement=NewProblem}
    {path=graphics/fc_icons.pdf,page=3,placement=[1]NewProblem}
}
\begin{docassembly}
\insertPreDocAssembly
\end{docassembly}

\parskip0pt\parindent0pt%\previewtrue

\begin{document}

\begin{center}

{%
    \LARGE\bfseries\color{blue}PDF Flash Cards\\[1ex]Elementary Arithmetic
}

%
% The arithmetic problem, \arithProb: top, bottom and operation. This command is REQUIRED.
% This command generates three text fields stacked so that form a standard arithmetic
% problem:     top
%          op  bot
%

\arithProb

%
% \alertbox is a text field where a right or wrong message is written--REQUIRED
% \startAgain clears the statistics field, re-initializes a variables--REQUIRED
% \inputRegion is where the user enters his/her answer--REQUIRED
% \Keypad allows user to enter answer with mouse--OPTIONAL
% \newCard random selects a new arithmetic problem (add, sub, mul, div) depending on the
%   combo box \cbOperation, described below.
%
% These components can be moved around to a new design, thought I don't know what that would
% be.  I have no imagination for design myself.

\mbox{\vbox{\smash{\alertbox}\startAgain}\fcSep\inputRegion\fcSep\vbox{\smash{\raisebox{4bp}{\Keypad}}\newCard}}%

\medskip
%
% \cbTiming is combo box use to set a time limit on answer the problem--OPTIONAL
%   There is also a package option, notimedscores, that removes timing calculations
%   from the PDF, no statistics, no alerts. The option notimedscores makes the combo
%   box created y \cbTiming into a readonly field.
%
% \ansField is the field the user enters his/her answer into---REQUIRED
% \cbOperation a combo box to select what operation to use---REQUIRED

\mbox{\cbTiming\fcSep\ansField\fcSep\cbOperation}

\medskip

%
% This calculation computes the width of the previous row of fields, and sets \cs{fcWidth},
% a dimension in this package, to that width.
%
\settowidth{\fcWidth}{\cbTiming\fcSep\ansField\fcSep\cbOperation}
%
% \statsFields is a collection of text fields to display user statistics---OPTIONAL
%
\makebox[\fcWidth][s]{\statsFields}

\end{center}
\end{document}