\documentclass{article}
\usepackage[%
    driver=dvipsone,
    web={pro,tight,nodirectory},
    eforms,
    uselayers
]{aeb_pro}
\usepackage[lang=custom,nonrandomized]{dps}
\usepackage[uselayers]{aeb_pro}
\usepackage{graphicx}
\usepackage{pstricks-add}
\usepackage[absolute,overlay]{textpos}

\margins{.5in}{.5in}{.5in}{.5in} % left,right,top, bottom
\screensize{8in}{8.5in} % height, width

\DeclareDocInfo
{
    title=Stat Matching Game,
    author=D. P. Story,
    university=OKALOOSA-WALTON COLLEGE\\Department of Mathematics,
    email=storyd@owc.edu,
    subject=First extra credit assignment,
    keywords={statistics, matching, game},
    talksite=http://www.acrotex.net,
    copyrightyears=2006-\the\year,
}
\talkdateLabel{Version}
\version{1.0}\nocopyright

\everyTextField{\textFont{TiRo}}

%
% A command for typesetting content in a layer, using absolute coordinates
% of textblock environment of the texpos package.
%
\def\setTextBlock#1{%
    \par\begin{textblock*}{2\linewidth}[0,0](.33\paperwidth,.42\paperheight)
    \xBld{#1}\psshadowbox[framesep=0pt]{\fcolorbox{red}{cornsilk}{%
    \parbox{\linewidth}{\insertRC{#1}}}}\eBld
    \end{textblock*}
}
%
% Convenience macro to set the content of the layer.
% #1 = the letter in the puzzle corresponding to the current question
% #2 = the content of the layer
%
\newcommand{\setContent}[2]{\defineRC{#1}{\textbf{Problem \theenumi:} #2}\setTextBlock{#1}}

\optionalPageMatter
{%
    \par\minimumskip\vspace{\stretch{1}}
    \begin{center}
    \fcolorbox{blue}{white}{%
    \begin{minipage}{.75\linewidth}\parskip3pt
    \textbf{\textcolor{red}{Instructions: }}
    On the next page of this document is a little matching game covering
    some of the statistical concepts discussed in class.
    \begin{itemize}
        \item When you turn to the next page, type in your name in the name field
        provided near the top of the page.
        \item Follow the instructions on that page on how to answer the questions.
        \item After you have correctly answered the last question correctly, a message
        appears at the bottom of the page with an evaluation of your effort.
        \item Print the completed page and turn it in to me at the next class meeting
        for (extra) credit.
    \end{itemize}
    Adobe Reader 6.0 or later is required for this document. Adobe
    Reader does not allow you to save your work, so please complete
    the assignment in one sitting, there are not many questions.
    \end{minipage}}\par\bigskip
    \end{center}
}

\rheader{}

\parindent0pt
\parskip6pt

\DeclarePuzzle
{%
    {R}{R}
    {o}{o}
    {n}{n}
    {a}{a}
    {l}{l}
    {d}{d}
    {F}{F}
    {i}{i}
    {s}{s}
    {h}{h}
    {e}{e}
    {r}{r}
}

%\writeComposingEnv
%\begin{document}
%\end{document}

\begin{Composing}

\begin{cQ}{R}
Branches of Statistics\setContent{R}{The two branches of statistics
are descriptive and \underbar{\hspace{\ublength}}.}
\end{cQ}
\begin{cA}{R}
inferential
\end{cA}

\begin{cQ}{o}
Definition\setContent{o}{\underbar{\hspace*{\ublength}} is the
science of collecting, organizing, analyzing and interpreting data
in order to make decisions.}
\end{cQ}
\begin{cA}{o}
statistics
\end{cA}

\begin{cQ}{n}
A frequency distribution is an example of
\underbar{\hspace*{\ublength}}
\end{cQ}
\begin{cA}{n}
data reduction
\end{cA}

\begin{cQ}{a}
Find the median\setContent{a}{Find the median of the following
data:\\[1ex]
\begin{tabular}{r|ll}
2&2334&\kern6pt Key $2\,|\,4=24$\\
2&57888\\
3&344\\
3&55666\\
4&0023\\
4&566
\end{tabular}}
\end{cQ}
\begin{cA}{a}
$34.5$
\end{cA}

\begin{cQ}{l}
Compute mean and standard deviation\setContent{l}{Given that $n=5$,
$\sum x = 26$ $\sum x^2 = 154$, compute $\bar x$ and $s$.}
\end{cQ}
\begin{cA}{l}
$5.2$ and $2.17$
\end{cA}

\begin{cQ}{d}
Definition\setContent{d}{A \underbar{\hspace{\ublength}} is a sample
in which every possible sample of the same size has the same change
of being selected.}
\end{cQ}
\begin{cA}{d}
simple random sample
\end{cA}

\begin{cQ}{F}
Measures of Position\setContent{F}{The number
\underbar{\hspace{\ublength}} divides a data set in such a way that
$75\%$ of the data is less than it and $25\%$ of the data is greater
than it.}
\end{cQ}
\begin{cA}{F}
$Q_3$
\end{cA}

\begin{cQ}{i}
Measure of Central Tendency\setContent{i}{The
\underbar{\hspace{\ublength}} is the measure of central tendency
that is sensitive to outliers in the data set.}
\end{cQ}
\begin{cA}{i}
sample mean
\end{cA}

\begin{cQ}{s}
$\mu$ refers to the \underbar{\hspace{\ublength}}
\end{cQ}
\begin{cA}{s}
population mean
\end{cA}

\begin{cQ}{h}
Calculating the $z$-score\setContent{h}{In a data set with sample
mean of $4.5$ and sample standard deviation of $1.5$, the $z$-score
of $x = 4$ is $ z = \underbar{\hspace{\ublength}}$.}
\end{cQ}
\begin{cA}{h}
$-0.33$
\end{cA}

\begin{cQ}{e}
Interpreting the $z$-score\setContent{e}{If a $z$-score of a data
entry is negative, then that data entry is
\underbar{\hspace{\ublength}} than mean.}
\end{cQ}
\begin{cA}{e}
less
\end{cA}

\begin{cQ}{r}
The Empirical Rule\setContent{r}{The mean value of land and building
per acre from a sample of farms is $\$1200$ with a standard
deviation of $\$350$. Assuming the distribution of the data set is
bell shaped, approximately what percentage of the sample of farmers
had value of land and building (per acre) between $\$1200$ and
$\$1550$?}
\end{cQ}
\begin{cA}{r}
$34$
\end{cA}

%-------------------

\begin{cA}{fake1}
$5.2$ and $1.94$
\end{cA}

\begin{cA}{fake2}
sample
\end{cA}

\begin{cA}{fake3}
$0.33$
\end{cA}

\begin{cA}{fake4}
greater
\end{cA}

\begin{cA}{fake5}
median
\end{cA}

\begin{cA}{fake6}
mode
\end{cA}

\begin{cA}{fake7}
$Q_1$
\end{cA}

\begin{cA}{fake8}
variance
\end{cA}

\begin{cA}{fake9}
$35$
\end{cA}

\end{Composing}

%----------------
%
% The two commands \afterQhookA and \OnFocusQhookAA are hooks onto
% the \dpsQ command of the dps package. This allows us to post process
% the user's choice of a questions, and allows us to execute JS on focus.
% We use these two to call to JS function to support these additional
% features.
%
\def\afterQhookA#1{dpsShowLayer("#1")}
\def\OnFocusQhookAA#1{dpsHidePreviousLayer("#1")}

\begin{insDLJS}[dpsShowLayer]{dpslayer}{DPS Layer Support}
var studentSignedIn = false;
function dpsShowLayer(name)
{
    if ( studentSignedIn ) {
        var o = getxBld(name);
        if ( o != null  ) o.state = true;
    } else {
        var f = this.getField("dpsSignInName");
        if ( f == null ) {
            studentSignedIn = true;
            dpsShowLayer(name);
        }
        else event.target.value = "Off";
    }
}
function dpsHidePreviousLayer(name)
{
//    console.println("dpsShowLayer: activeQuestion = " + activeQuestion);
    if (!studentSignedIn) {
        var f = this.getField("dpsSignInName");
        if ( f != null ) {
            var nameField = f.value;
            if ( nameField.replace(/\s*/g,"") == "" )
                app.alert("You must enter your name in the field at the top of the page to get credit for this assignment.");
            else
                studentSignedIn = true;
        }
    } else studentSignedIn = true;
    if ( activeQuestion != "" ) {
        var activename = activeQuestion.replace(/ckbxQ\./,"");
        dpsHideLayer(activename);
    }
}
function dpsHideLayer(name)
{
    var o = getxBld(name);
    if ( o != null  ) o.state = false;
}
function afterCorrectChoiceHook()
{
    var name = activeQuestion.replace(/ckbxQ\./,"");
//    console.println( "afterCorrectChoiceHook(): name = " + name);
    try { if (pic[name] != null ) dpsShowLayer(pic[name]); } catch(e) {};
    dpsHideLayer(name);
}
function dpsFinishedHook()
{
    var name = activeQuestion.replace(/ckbxQ\./,"");
    dpsHideLayer(name);
    var o = getxBld("owclogo");
    if ( o != null  ) o.state = true;
}
\end{insDLJS}

\begin{document}

\maketitle

%
% Include a logo that will appear at the end of the puzzle. The function
% dpsFinishedHook() to show this logo.
%
\begin{textblock*}{2\linewidth}[0,0](.33\paperwidth,.425\paperheight)
\xBld{owclogo}\parbox{\linewidth}{\includegraphics{owc_self}}\eBld
\end{textblock*}


\def\answidth{1.7in}
\def\queswidth{2in}

{\bfseries\noindent
\makebox[\textwidth]{\rlap{STA 2023}\hfill\textcolor{blue}{\webtitle}\hfill\llap{Statistics}}
\makebox[\textwidth]{\rlap{\webauthor}\hfill\textcolor{blue}{Descriptive Statistics}\hfill\llap{Fall 2006}}}

\underbar{\textbf{Name:} \textField[\BC{}]{dpsSignInName}{2in}{11bp}}

\textcolor{red}{\textbf{Instructions:}} Select a question from the
left panel by clicking its checkbox. Find the answer listed in
either the right panel.  No guessing! A maximum of $\dsthreshold$
tries on any problem before you get $\dspenaltypoints$ penalty
points!  Passing is to complete the puzzle with only $\dspassing$
incorrect answers.

\def\answidth{1.7in}
\def\queswidth{2in}
\def\ublength{.5in}

\fbox{\begin{minipage}[t][5in][t]{\queswidth-2\fboxsep-2\fboxrule}\raggedright
\makebox[\linewidth]{\centering\textbf{Questions}}
\begin{enumerate}
\displayRandomizedQuestions
\end{enumerate}
\par\smallskip
\end{minipage}}%
%
\fbox{\begin{minipage}[t][5in][t]{\linewidth-\answidth-\queswidth-2\fboxsep-2\fboxrule}
Who is considered the founder of modern statistics? The answer is
hidden in the puzzle below.\par\smallskip
\begin{center}
\parbox{2.2in}{\insertPuzzle{6}}
\end{center}
\hspace*{-\fboxsep}\rule{\linewidth+2\fboxsep}{.4pt}
\vfill
\placeMessageField[\Ff\FfReadOnly\BC{}]{\linewidth}{10\baselineskip}
\end{minipage}}%
%
\fbox{\begin{minipage}[t][5in][t]{\answidth-2\fboxsep-2\fboxrule}\raggedright
\makebox[\linewidth]{\textbf{Answers}}
\begin{itemize}
\displayRandomizedAnswers
\end{itemize}
\par\smallskip
\end{minipage}}%

\textbf{\textcolor{red}{Important:}} Don't forget to print the puzzle page and to hand it in to me.

Print this page: \pushButton[\CA{Print}\A{\JS{%
    var pp = this.getPrintParams();\r
    pp.firstPage=1;\r
    pp.lastPage=1;\r
    pp.pageHandling = pp.constants.handling.shrink;\r
    var fv = pp.constants.flagValues;\r
    pp.flags |= (fv.suppressCenter | fv.suppressRotate);\r
    this.print(pp);}}]{printit}{}{11bp}

\clearpage

\end{document}
