diff options
Diffstat (limited to 'texmf-dist/source/latex/jj-game')
12 files changed, 3775 insertions, 0 deletions
diff --git a/texmf-dist/source/latex/jj-game/designs/design_bahamas.def b/texmf-dist/source/latex/jj-game/designs/design_bahamas.def new file mode 100644 index 00000000..98157e1b --- /dev/null +++ b/texmf-dist/source/latex/jj-game/designs/design_bahamas.def @@ -0,0 +1,72 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% JEOPARDY DESIGNS %% +%% %% +%% The AcroTeX Software Development Team (Copyright 2007) %% +%% %% +%% The Bahamas Color Scheme %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Diverse Color Definitions + +\definecolor{APBdarkgreen}{rgb}{0.00,0.33,0.28} +\definecolor{jj_banner_bg}{named}{APBdarkgreen} +\definecolor{jj_banner_txt}{named}{white} +\definecolor{jj_bg}{named}{OliveGreen} +\DeclareColors +{ + fillCells: lightgray, + fillBanner: jj_banner_bg, + textBanner: jj_banner_txt, + textBoard: jj_banner_txt, + fillInstructions: jj_bg, + fillGameBoard: jj_bg, + fillQuestions: jj_bg, + linkColor: Turquoise, + dollarColor: Turquoise, +} + +\APDollar +{ + Font: Helv, + TextColor: 0 0 0, % color of text for the gameboard cells + BorderColor: 0 0 0, % color of border for the gameboard cells + FillColor: .55 0.98 0.2, % the fill color for the gameboard cells +} + +\APHidden +{ + Font: Helv, + TextColor: 0 0 1, + BorderColor: 0 0 0, + FillColor: 0 1 0, +} + +\APRight +{ + Font: Helv, + TextColor: .996 .133 .133, +} + +\APWrong +{ + Font: Helv, + TextColor: 0 0 0, +} + +\APScore +{ + Font: Arial, + CellWidth: 2.25in, + FillColor: .827 .827 .827, +} + +% ------------------- graphical backgrounds ------------------------ +\jjgdesigngraphics +\defineInstructionPageGraphic{jjg_bg_3} +\defineGameboardPageGraphic{jjg_bg_3} +\defineQuestionPagesGraphic{} + diff --git a/texmf-dist/source/latex/jj-game/designs/design_florida.def b/texmf-dist/source/latex/jj-game/designs/design_florida.def new file mode 100644 index 00000000..0e3c1fc8 --- /dev/null +++ b/texmf-dist/source/latex/jj-game/designs/design_florida.def @@ -0,0 +1,60 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% JEOPARDY DESIGNS %% +%% %% +%% The AcroTeX Software Development Team (Copyright 2007) %% +%% %% +%% The FLORIDA Color Scheme %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Diverse Color Definitions + +\definecolor{jj_banner_bg}{named}{PineGreen} +\definecolor{jj_banner_txt}{named}{Yellow} + +\DeclareColors +{ + fillCells: lightgray, + fillBanner: jj_banner_bg, + textBanner: jj_banner_txt, + textBoard: jj_banner_txt, + fillInstructions: cornsilk, + fillGameBoard: cornsilk, + fillQuestions: cornsilk, +} + +\APDollar +{ + Font: Helv, + TextColor: 0.9 .8 .9, % color of text for the gameboard cells + BorderColor: 0.2 0.2 0.2, % color of border for the gameboard cells + FillColor: .25 0.51 .31 % the fill color for the gameboard cells +} +\APHidden +{ + Font: Helv, + TextColor: 0 0 1, + BorderColor: 0 0 0, + FillColor: .827 .827 .827 +} +\APRight +{ + Font: Helv, + TextColor: .996 .133 .133 +} + +\APWrong +{ + Font: Helv, + TextColor: .286 .533 .433 +} + +\APScore +{ + Font: Arial, + CellWidth: 2.25in, + FillColor: .827 .827 .827 +} diff --git a/texmf-dist/source/latex/jj-game/designs/design_germany.def b/texmf-dist/source/latex/jj-game/designs/design_germany.def new file mode 100644 index 00000000..2e8e5f7d --- /dev/null +++ b/texmf-dist/source/latex/jj-game/designs/design_germany.def @@ -0,0 +1,72 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% JEOPARDY DESIGNS %% +%% %% +%% The AcroTeX Software Development Team (Copyright 2007) %% +%% %% +%% The Germany Color Scheme %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Diverse Color Definitions + +\definecolor{APBdarkred}{rgb}{0.73,0.00,0.00} +\definecolor{APBdarkgray}{rgb}{0.35,0.36,0.44} + +\definecolor{jj_banner_bg}{named}{APBdarkred} +\definecolor{jj_banner_txt}{named}{white} +\definecolor{jj_bg}{named}{Yellow} + +\definecolor{APBdarkred}{rgb}{0.73,0.00,0.00} +\definecolor{APBdarkgray}{rgb}{0.35,0.36,0.44} + +\DeclareColors +{ + fillCells: APBdarkgray, + fillBanner: APBdarkred, + textBanner: jj_banner_txt, + textBoard: jj_banner_txt, + fillInstructions: jj_bg, + fillGameBoard: jj_bg, + fillQuestions: jj_bg, + linkColor: APBdarkred, + dollarColor: APBdarkred, +} + +\APDollar +{ + Font: Helv, + TextColor: 0 0 0, % color of text for the gameboard cells + BorderColor: 0 0 0, % color of border for the gameboard cells + FillColor: 0.97 0.65 0.00, % the fill color for the gameboard cells +} + +\APHidden +{ + Font: Helv, + TextColor: 0 0 1, + BorderColor: 0 0 0, + FillColor: 0 1 0, +} + +\APRight +{ + Font: Helv, + TextColor: .996 .133 .133, + FillColor: 0 1 0, +} + +\APWrong +{ + Font: Helv, + TextColor: 0 0 0, +} + +\APScore +{ + Font: Arial, + CellWidth: 2.25in, +} + diff --git a/texmf-dist/source/latex/jj-game/designs/design_hornet.def b/texmf-dist/source/latex/jj-game/designs/design_hornet.def new file mode 100644 index 00000000..edb03c48 --- /dev/null +++ b/texmf-dist/source/latex/jj-game/designs/design_hornet.def @@ -0,0 +1,63 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% JEOPARDY DESIGNS %% +%% %% +%% The AcroTeX Software Development Team (Copyright 2007) %% +%% %% +%% The HORNET Color Scheme %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\definecolor{jj_banner_bg}{named}{Yellow} +\definecolor{jj_banner_txt}{named}{black} +\definecolor{jj_bg}{rgb}{0.922, 0.973, 0.98} + +\DeclareColors +{ + fillCells: SkyBlue, + fillBanner: jj_banner_bg, + textBanner: jj_banner_txt, + textBoard: jj_banner_txt, + fillInstructions: jj_bg, + fillGameBoard: jj_bg, + fillQuestions: jj_bg, + linkColor: red, + dollarColor: red, +} + +\APDollar +{ + Font: Helv, + TextColor: 0 0 0, % color of text for the gameboard cells + BorderColor: 0 0 0, % color of border for the gameboard cells + FillColor: .235 0.718 .149, % the fill color for the gameboard cells +} + +\APHidden +{ + Font: Helv, + TextColor: 0 0 1, + BorderColor: 0 0 0, + FillColor: 0 1 0, +} + +\APRight +{ + Font: Helv, + TextColor: .996 .133 .133, +} + +\APWrong +{ + Font: Helv, + TextColor: 0 0 0, +} + +\APScore +{ + Font: Arial, + CellWidth: 2.25in, + FillColor: .827 .827 .827, +} diff --git a/texmf-dist/source/latex/jj-game/designs/design_iceland.def b/texmf-dist/source/latex/jj-game/designs/design_iceland.def new file mode 100644 index 00000000..9873d7e0 --- /dev/null +++ b/texmf-dist/source/latex/jj-game/designs/design_iceland.def @@ -0,0 +1,72 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% JEOPARDY DESIGNS %% +%% %% +%% The AcroTeX Software Development Team (Copyright 2007) %% +%% %% +%% The ICELAND Color Scheme %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\definecolor{jj_banner_bg}{named}{ProcessBlue} +\definecolor{jj_banner_txt}{named}{white} +\definecolor{jj_bg}{named}{lightgray} + + +\DeclareColors +{ + fillCells: SkyBlue, + fillBanner: ProcessBlue, + textBanner: jj_banner_txt, + textBoard: jj_banner_txt, + fillInstructions: jj_bg, + fillGameBoard: jj_bg, + fillQuestions: jj_bg, + linkColor: webblue, + dollarColor: webblue, +} + +\APDollar +{ + Font: Helv, + Size: 20, + TextColor: 0.95 .95 .95, % color of text for the gameboard cells + BorderColor: 0.2 0.2 0.2, % color of border for the gameboard cells + FillColor: .204 0.671 .753, % the fill color for the gameboard cells +} + +\APHidden +{ + Font: Helv, + TextColor: 0 0 1, + BorderColor: 0 0 0, +} + +\APRight +{ + Font: Helv, + TextColor: .996 .133 .133, +} + +\APWrong +{ + Font: Helv, + TextColor: .286 .533 .433, +} + +\APScore +{ + Font: Arial, + CellWidth: 2.25in, + FillColor: .827 .827 .827, +} + +% ------------------- graphical backgrounds ------------------------ +\jjgdesigngraphics +\defineInstructionPageGraphic{jjg_bg_2} +\defineGameboardPageGraphic{jjg_bg_2} +\defineQuestionPagesGraphic{} + + diff --git a/texmf-dist/source/latex/jj-game/designs/design_jeopardy.def b/texmf-dist/source/latex/jj-game/designs/design_jeopardy.def new file mode 100644 index 00000000..7e0dad4e --- /dev/null +++ b/texmf-dist/source/latex/jj-game/designs/design_jeopardy.def @@ -0,0 +1,82 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% JEOPARDY DESIGNS %% +%% %% +%% The AcroTeX Software Development Team (Copyright 2007) %% +%% %% +%% The JEOPARDY Color Scheme %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%% Diverse Color Definitions + +\definecolor{jj_bg}{rgb}{0.92,0.67,0.1} +\definecolor{jj_banner_bg}{rgb}{0.067,0.325,0.62} +\definecolor{jj_banner_txt}{rgb}{0.92,0.67,0.1} +\definecolor{jj_instr_blue}{rgb}{0.1,0.48,0.922} +\definecolor{jj_instr_red}{rgb}{0.96,0.38,0.1} +\definecolor{jj_instr_author}{rgb}{0.38,0.38,0.38} + +\definecolor{jj_gb_title_bg}{rgb}{0.067,0.325,0.62} +\definecolor{jj_gb_title_txt}{rgb}{0.92,0.67,0.1} +\definecolor{jj_gb_cell_bg}{rgb}{0.1,0.48,0.922} +\definecolor{jj_gb_cell_bg_hidden}{rgb}{0.92,0.67,0.1} +\definecolor{jj_gb_cell_txt}{rgb}{0,0,0} +\definecolor{jj_gb_cell_txt_right}{rgb}{0.62,0.55,0.067} +\definecolor{jj_gb_cell_txt_wrong}{rgb}{0.96,0.38,0.12} +\definecolor{jj_gb_score_bg}{rgb}{0.87,0.87,0.87} + + +\DeclareColors +{ + fillCells: lightgray, + fillBanner: jj_banner_bg, + textBanner: jj_banner_txt, + textBoard: jj_banner_txt, + fillInstructions: jj_bg, + fillGameBoard: jj_bg, + fillQuestions: jj_bg, + dollarColor: red, + linkColor: red, +} + + +\APDollar +{ + Font: Helv, + TextColor: 0 0 0, % color of text for the gameboard cells + BorderColor: 0 0 0, % color of border for the gameboard cells + FillColor: 0.1 0.48 0.922 % the fill color for the gameboard cells +} +\APHidden +{ + Font: Helv, + TextColor: 0 0 0, + BorderColor: 0 0 0, + FillColor: 0.92 0.67 0.1 +} +\APRight +{ + Font: Helv, + TextColor: 0.62 0.55 0.067 +} +\APWrong +{ + Font: Helv, + TextColor: 0.96 0.38 0.12 +} +\APScore +{ + Font: Arial, + CellWidth: 2.25in, + FillColor: .87 .87 .87 +} + +% ------------------- graphical backgrounds ------------------------ +\jjgdesigngraphics +\defineInstructionPageGraphic{jeopardy_bg} +\defineGameboardPageGraphic{jeopardy_bg} +\defineQuestionPagesGraphic{} diff --git a/texmf-dist/source/latex/jj-game/designs/design_norway.def b/texmf-dist/source/latex/jj-game/designs/design_norway.def new file mode 100644 index 00000000..6cb1b6a3 --- /dev/null +++ b/texmf-dist/source/latex/jj-game/designs/design_norway.def @@ -0,0 +1,70 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% JEOPARDY DESIGNS %% +%% %% +%% The AcroTeX Software Development Team (Copyright 2007) %% +%% %% +%% The Norway Color Scheme %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Diverse Color Definitions + +\definecolor{jj_banner_bg}{named}{Blue} +\definecolor{jj_banner_txt}{named}{white} +\definecolor{jj_bg}{named}{Emerald} + +\DeclareColors +{ + fillCells: lightgray, + fillBanner: jj_banner_bg, + textBanner: jj_banner_txt, + textBoard: jj_banner_txt, + fillInstructions: jj_bg, + fillGameBoard: jj_bg, + fillQuestions: jj_bg, + linkColor: webblue, + dollarColor: webblue, +} + +\APDollar +{ + Font: Helv, + TextColor: 1 1 1, % color of text for the gameboard cells + BorderColor: 0 0 0, % color of border for the gameboard cells + FillColor: .25 0.38 .77, % the fill color for the gameboard cells +} + +\APHidden +{ + Font: Helv, + BorderColor: 0 0 0, + FillColor: 0 1 0, +} + +\APRight +{ + Font: Helv, + TextColor: .996 .133 .133, +} + +\APWrong +{ + Font: Helv, + TextColor: 0 0 0, +} + +\APScore +{ + Font: Arial, + CellWidth: 2.25in, + FillColor: .827 .827 .827, +} + +% ------------------- graphical backgrounds ------------------------ +\jjgdesigngraphics +\defineInstructionPageGraphic{jjg_bg_4} +\defineGameboardPageGraphic{jjg_bg_4} +\defineQuestionPagesGraphic{} diff --git a/texmf-dist/source/latex/jj-game/designs/design_qatar.def b/texmf-dist/source/latex/jj-game/designs/design_qatar.def new file mode 100644 index 00000000..7f3e9e96 --- /dev/null +++ b/texmf-dist/source/latex/jj-game/designs/design_qatar.def @@ -0,0 +1,70 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% JEOPARDY DESIGNS %% +%% %% +%% The AcroTeX Software Development Team (Copyright 2007) %% +%% %% +%% The Qatar Color Scheme %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Diverse Color Definitions + +\definecolor{qatar_moccasin}{rgb}{1,0.894,0.71} +\definecolor{qatar_golden}{rgb}{0.98,0.98,0.824} +\definecolor{qatar_blue}{rgb}{0.098,0.098,0.439} + +\definecolor{jj_banner_bg}{named}{Maroon} +\definecolor{jj_banner_txt}{named}{white} + +\DeclareColors +{ + fillCells: lightgray, + fillBanner: jj_banner_bg, + textBanner: jj_banner_txt, + textBoard: qatar_golden, + fillInstructions: qatar_moccasin, + fillGameBoard: qatar_golden, + fillQuestions: qatar_moccasin, + linkColor: qatar_blue, + dollarColor: qatar_blue, +} + +\APDollar +{ + Font: Helv, + TextColor: 0 0 0, % color of text for the gameboard cells + BorderColor: 0 0 0, % color of border for the gameboard cells + FillColor: 1 0.894 0.71, % the fill color for the gameboard cells +} + + +\APHidden +{ + Font: Helv, + TextColor: 0 0 1, + BorderColor: 0 0 0, + FillColor: 0 1 0, +} + +\APRight +{ + Font: Helv, + TextColor: 0.682 0.341 0, +} + +\APWrong +{ + Font: Helv, + TextColor: 0 0 0, +} + +\APScore +{ + Font: Helv, + CellWidth: 2.25in, + FillColor: .827 .827 .827, +} + diff --git a/texmf-dist/source/latex/jj-game/designs/design_spain.def b/texmf-dist/source/latex/jj-game/designs/design_spain.def new file mode 100644 index 00000000..e90dfa7c --- /dev/null +++ b/texmf-dist/source/latex/jj-game/designs/design_spain.def @@ -0,0 +1,72 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% %% +%% JEOPARDY DESIGNS %% +%% %% +%% The AcroTeX Software Development Team (Copyright 2007) %% +%% %% +%% The SPAIN Color Scheme %% +%% %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\definecolor{jj_banner_bg}{named}{Green} +\definecolor{jj_banner_txt}{named}{white} +\definecolor{jj_bg}{named}{GreenYellow} + + +\DeclareColors +{ + fillCells: lightgray, + fillBanner: jj_banner_bg, + textBanner: jj_banner_txt, + textBoard: jj_banner_txt, + fillInstructions: jj_bg, + fillGameBoard: jj_bg, + fillQuestions: jj_bg, + linkColor: Green, + dollarColor: Green, +} + +\APDollar +{ + Font: Helv, + Size: 20, + TextColor: 0 0 0, % color of text for the gameboard cells + BorderColor: 0 0 0, % color of border for the gameboard cells + FillColor: .465 0.818 .049, % the fill color for the gameboard cells +} + +\APHidden +{ + Font: Helv, + Champion: You are FuncTerrific!, + Size: 20, + TextColor: 0 0 1, + BorderColor: 0 0 0, + FillColor: 0 1 0, +} + +\APRight +{ + Font: Helv, + Size: 20, + TextColor: .996 .133 .133, +} + +\APWrong +{ + Font: Helv, + Size: 20, + TextColor: 0 0 0, +} + +\APScore +{ + Font: Arial, + Size: 20, + CellWidth: 2.25in, + Score: "Score: ", + FillColor: .827 .827 .827, +} + diff --git a/texmf-dist/source/latex/jj-game/doc/jjg_man.tex b/texmf-dist/source/latex/jj-game/doc/jjg_man.tex new file mode 100644 index 00000000..923921ec --- /dev/null +++ b/texmf-dist/source/latex/jj-game/doc/jjg_man.tex @@ -0,0 +1,1332 @@ +% makeindex < aebpro_man.idx > aebpro_man.ind + +\documentclass{article} +\usepackage{amsmath} +\usepackage[ + web={centertitlepage,designv,forcolorpaper,tight*,latextoc,pro}, + eforms, +% linktoattachments, +% attachments={../aeb_pro.dtx}, +% uselayers, + aebxmp +]{aeb_pro} +\usepackage{aeb_mlink} +\usepackage{graphicx,array,subfigure} +%\usepackage{myriadpro} +\usepackage[altbullet]{lucidbry} +\usepackage{pstricks,pstricks-add} +\usepackage{pst-node} + +%\usepackage{makeidx} +%\makeindex + +\usepackage{acroman} +\usepackage[active]{srcltx} + +\def\pstnodescale{72 72.27 div dup scale }% + +% \usepackage[active]{srcltx} + +\urlstyle{rm} + +\def\tutpath{doc/tutorial} +\def\tutpathi{tutorial} +\def\expath{../examples} + +\DeclareDocInfo +{ + university={\AcroTeX.Net}, + title={JJ\_Game Class}, + author={D. P. Story}, + email={dpstory@acrotex.net}, + subject={How to create Jeopardy-like game boards}, + talksite={\url{www.acrotex.net}}, + version={v3.1, 2016/11/24}, + keywords={Jeopardy, LaTeX, games}, + copyrightStatus=True, + copyrightNotice={Copyright (C) \the\year, D. P. Story}, + copyrightInfoURL={http://www.acrotex.net} +} +\nocopyright + +\def\dps{$\hbox{$\mathfrak D$\kern-.3em\hbox{$\mathfrak P$}% + \kern-.6em \hbox{$\mathcal S$}}$} + +\universityLayout{fontsize=Large,fontfamily=sffamily} +\titleLayout{fontsize=LARGE,fontfamily=sffamily} +\authorLayout{fontsize=Large,fontfamily=sffamily} +\tocLayout{fontsize=Large,color=aeb,fontfamily=sffamily} +\sectionLayout{indent=-62.5pt,fontsize=large,color=aeb} +\subsectionLayout{indent=-31.25pt,color=aeb,fontfamily=sffamily} +\subsubsectionLayout{indent=0pt,color=aeb,fontfamily=sffamily} +\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}} + +%\pagestyle{empty} + +\makeatletter +\newcommand{\jjgCng}{\@ifstar{\@jjgCng}{\@jjgCng}}% +\newcommand{\@jjgCng}[1][]{\@gobbletwo} +%\newcommand{\jjgCng}{\@ifstar{\def\jjg@checked{*}\@jjgCng}{\def\jjg@checked{x}\@jjgCng}}% +%\newcommand{\@jjgCng}[1][]{% +% \if\jjg@checked*\def\jjg@marker{\textcolor{blue}{jjg 3.0}~\textcolor{red}{\ding{052}}\goodbreak}\else +% \def\jjg@marker{\textcolor{red}{jjg 3.0}}\fi +% \def\argi{#1}\ifx\argi\@empty +% \marginpar{\scriptsize\jjg@marker}% +% \else\marginpar{\scriptsize\jjg@marker\goodbreak\raggedright#1}\fi} +\makeatother + +\chngDocObjectTo{\newDO}{doc} +\begin{docassembly} +var titleOfManual="The JJ_Game Manual"; +var manualfilename="Manual_BG_Print_jjg.pdf"; +var manualtemplate="Manual_BG_Brown.pdf"; // Blue, Green, Brown +var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate; +var doc; +var buildIt=false; +if ( buildIt ) { + console.println("Creating new " + manualfilename + " file."); + doc = \appopenDoc({cPath: _pathToBlank, bHidden: true}); + var _path=this.path; + var pos=_path.lastIndexOf("/"); + _path=_path.substring(0,pos)+"/"+manualfilename; + \docSaveAs\newDO ({ cPath: _path }); + doc.closeDoc(); + doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true}); + f=doc.getField("ManualTitle"); + f.value=titleOfManual; + doc.flattenPages(); + \docSaveAs\newDO({ cPath: manualfilename }); + doc.closeDoc(); +} else { + console.println("Using the current "+manualfilename+" file."); +} +var _path=this.path; +var pos=_path.lastIndexOf("/"); +_path=_path.substring(0,pos)+"/"+manualfilename; +\addWatermarkFromFile({ + bOnTop:false, + bOnPrint:false, + cDIPath:_path +}); +\executeSave(); +\end{docassembly} +%\def\bUrl{http://www.math.uakron.edu/~dpstory} +% +%\hypersetup{linktocpage} +% +%\makeatletter +%\let\web@copyright=\@gobble +%\makeatother +% +% +%%\makeatletter +%%\renewcommand{\@oddhead}{\normalfont\small\ifodd\c@page\rightmark\hfil\web@rightheader\else\hfil\fi} +%%\makeatother +% +\renewcommand\redpoint{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi +\vskip\medskipamount\noindent + \makebox[0pt][r]{\makebox[20pt][l]{\large\color{red}$\blacktriangleright$}}} + +\newcommand\bluepoint{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi +\vskip\medskipamount\noindent + \makebox[0pt][r]{\makebox[20pt][l]{\large\color{blue}\ding{42}}}} + +\newcommand{\NO}[1]{% +\pscircle(0,0){9pt} +\rput(0,0){#1} +} + +\def\cS#1#2{\textField[\Ff\FfReadOnly\textSize{10}\textFont{Arial}\uDV{FEFF#2}\uV{FEFF#2}\BC{}]{#1}{20bp}{11bp}} + +% +%\newcommand{\cs}[1]{\texttt{\char`\\#1}} +%\def\Y&Y{Y\kern-.2em{\footnotesize\&}\kern-.2emY} +%\def\parss{\par\smallskip} +%\def\dps{$\mbox{$\mathfrak D$\kern-.3em\mbox{$\mathfrak P$}% +% \kern-.6em \hbox{$\mathcal S$}}$} +% +% +% +\frenchspacing + +\def\jj{\textsf{jj\_game}} + +\begin{document} + + +\maketitle + +\changelinkcolorto{black} +\tableofcontents +\changelinkcolorto{webgreen} + +\section{Introduction} + +The ``\textcolor{red}JavaScript \textcolor{red}Jeopardy +\textcolor{red}Game'', a.k.a., \jj\ (\url{http://ctan.org/pkg/jj-game}), is a \LaTeX{} class file that +can be used to construct a Jeopardy-like game board and the +accompanying answers and questions. The \jj{} is capable of +constructing a game board for an arbitrary number of categories and +an arbitrary number of questions per category. + +There are options for users of \textsf{dvipsone} (from the now defunct \Y&Y), +\textsf{dvips}, \textsf{pdflatex}, \textsf{lualatex}, or \textsf{xelatex} to build a Jeopardy game. + +A Jeopardy game, as constructed by {\jj}, consists of three parts: the instructions, +the game board and the question pages. See figures~1, 2 and 3 below. + +\begin{figure}[ht] +\centering +\hskip-62.5pt +\begin{minipage}{\linewidth+62.5pt} +\parbox{.3\linewidth}{\includegraphics[width=\linewidth]{jj_instructions1} +\caption{Instructions Page}\label{fig:instrPage}}\hfill +\parbox{.3\linewidth}{\includegraphics[width=\linewidth]{jj_gameboard1} +\caption{Game Board Page}\label{fig:gameboard}}\hfill +\parbox{.3\linewidth}{\includegraphics[width=\linewidth]{jj_questions1} +\caption{Question Page}\label{fig:questions}} +\end{minipage} +\end{figure} + +Corresponding to each of these pages are environments and commands +that allow you create content for your Jeopardy quiz game and to designate the +color scheme to be used. + +After reading your detailed instructions, the contestant arrives at +the game board page. The contestant chooses a category and a +question in that category (``I'll take `Candles and Wicks' for +200''). When the contestant clicks on the cell, the game jumps to +the question page (``Which end of the candle do you light? What +is\dots''\footnote{The author is making a vague and rather poor play +on words with Wiccan. pooh.}) corresponding to that choice and a +question is posed. + +A question can be multiple choice, math fill-in or text fill-in. In +the case of the fill-in type questions, the \pkg{exerquiz} package is +needed. After the contestant answers the question, the game returns +to the game board page, and the score is updated. + +Should the contestant reach the goal set by the \texttt{Goal} +property of the \cs{GameDesign} command, when the contestant has +finished answering all questions, a hidden field under that banner +of the game board appears with a short message, as defined by the +\texttt{Champion} property of \cs{GameDesign} command. + +There is no reset button, so if you want to play again, just close the game, +and reopen it. Do not save the game before it closes, this will save the form +data and when you open it again, the initial state of the game will not be +restored. + +You should be aware of the following features, which are meant to +discourage contestants from looking at the questions by paging +through the PDF or attempting to edit earlier responses. +\begin{itemize} +\item When a question page is opened, the cell in the + game board that corresponds to that page is blanked out. When + the contestant returns to the game board, that cell is no longer + clickable, hence, the contestant cannot legally answer that + question. When a contestant is on a question page illegally, a + nasty message appears in an alert box if the contestant answers + the question on that page. +\item If the contestant answers the question legally, then later returns + to that same question page and tries to edit the question + (perhaps because it was missed earlier), a (less than nasty) + message appears saying that you cannot change your answer. +\end{itemize} + +I do hope there will be people out in Cyberland who will use {\jj} +and construct some interesting games for us to enjoy. + +\medskip\noindent +Now, I simply must get back to my retirement. \dps + +\section{Preliminaries} + +%\subsection{Unpackaging the Class}\label{unpack} + +%Several modern {\TeX} systems download package and install them with little or no pain; this +%is the easiest way to do it. You can find the {\jj} package at + +%To unpack the \texttt{jj\_game.dtx}, `\texttt{latex}' the installation +%file \texttt{jj\_game.ins}. If you use \textsf{Acrobat 5.0}, open the file +%\texttt{jj\_game.ins} in your favorite editor and change the line +%\begin{Verbatim} +%\def\AcrobatOption{Acrobativ} % Acrobativ or Acrobatv +%\end{Verbatim} +%to +%\begin{Verbatim} +%\def\AcrobatOption{Acrobatv} % Acrobativ or Acrobatv +%\end{Verbatim} +%then do a `\texttt{latex jj\_game.ins}'. +% +%When you distill with the \textsf{Acrobat Distiller~5.0}, the +%document level JavaScripts needed to operate this game are +%automatically inserted when the game is opened in \textsf{Acrobat} +%for the first time. See the section \Nameref{s:buildgame} for +%more details. + +\subsection{Requirements} + +The new {\jj} class now uses many of the standard package files from AeB +(\cAcroEB); in particular, the AeB components used are \pkg{web}, +\pkg{insdljs} and \pkg{eforms}. The \pkg{exerquiz} package can optionally +be used as well to pose math and text fill-in questions. Therefore, AeB should already be installed +(\url{http://ctan.org/pkg/acrotex}). + + +The {\jj} class usse the very fine package \texttt{xkeyval} (2006/11/18 +v2.5f or later),\footnote{Located at +CTAN:/tex-archive/macros/latex/contrib/xkeyval}, and the equally nice package +\texttt{xcolor} (2005/11/25 v2.08 or +later),\footnote{CTAN:/tex-archive/macros/latex/contrib/xcolor} if available +on the system. The \texttt{comment} package is also used.\footnote{CTAN: +/tex-archive/macros/latex/contrib/comment} The \pkg{graphicx} package is needed if +you wish to insert graphical backgrounds. + +\newtopic\noindent +Requirements based on driver applications: +\begin{itemize} + +\item \app{pdflatex}, \app{lualatex}, and \app{xelatex}: {\jj} class works + with these two applications that that write a document in PDF. Some of + the features---the \texttt{forcredit} and \texttt{pro} options---of + {\jj} are not available to these applications. + +\item \app{dvips} and \app{dvipsone}: In these two cases, it is assumed that PDF is +creating \app{Acrobat Distiller}, not \app{Ghostscript}; in this case, the +\texttt{forcredit} option (see `\mlnameref{forcreditOption}', +page~\pageref*{forcreditOption}) is available. If the document author has +Acrobat 7.0 Pro (or later), the \texttt{pro} option (see +`\nameref{proOption}', page~\pageref*{proOption}) can be used as +well. + +\end{itemize} +Once the game is built, Adobe Reader 5.0 or later is sufficient to +enjoy the wonderfulness of the time-consuming pass time that is +Jeopardy. If the document author used the \texttt{pro} option, Adobe +Reader 7.0 or later is required. + + +\subsection{Listing of Sample Files} + +The sample files are good templates for designing your own game: +\begin{itemize} + \item \texttt{jjg\_test.tex}: The original demo file from the first version + of this class. + \item \texttt{jg\_ca.tex}: A Jeopardy quiz game constructed for and distributed + to a College Algebra class for extra credit. + \item \texttt{jjg\_custom.tex}: An example of a custom design. + \item \texttt{pro/jjg\_pro\_ca.tex}: Same as \texttt{jg\_ca.tex} but uses the \pkg{aeb\_pro} + package (with layers) with the \texttt{forcredit} option of \jj. (\app{dvips}/\penalty0\app{Distiller} workflow required) +\end{itemize} +The first three files can be successfully build with +\app{dvips}/\penalty0\app{Distiller}, \app{pdflatex}, \app{lualatex}, and \app{xelatex}. + + +\section{Options} + +The options of this class are listed below. In some cases, you are referred to +other sections of this manual for further details. +\begin{itemize} +\item Driver Options: {\jj} recognizes four drivers. Choose only one. +\begin{itemize} +\item \texttt{dvips}: The dvi-to-ps converter that comes with many \TeX\ + systems. The Adobe Acrobat Distiller must be used to convert from + Postscript to PDF. + +\item \texttt{dvipsone}: The dvi-to-ps converter by \Y&Y.\footnote{Now + out of business, but this author still uses it.} In this case, the + Adobe Acrobat Distiller must be used to convert from Postscript to + PDF. + +\item \texttt{pdftex}: The tex-to-pdf converter. The distiller is not + needed in this case. + +\item \texttt{luatex}: The tex-to-pdf converter. The distiller is not + needed in this case. + +\item \texttt{xetex}: The tex-to-pdf converter. The distiller is not + needed in this case. + +\item \texttt{dvipdfm} and \texttt{dvipdfmx}: Less used dvi-to-pdf + converters. The distiller is not needed in this case. +\end{itemize} +In the cases of \texttt{pdftex}, \texttt{luatex}, and \texttt{xetex}, \pkg{\jj} performs automatic driver detection +so none of these need to be actually specified in the option list of \pkg{\jj}. If you use +the \texttt{dvips} driver, specify it in the \texttt{jj\_game.cfg} file, as explained on the next page. + +%\item \verb+\documentclass[dvips,foils]{jj_game}+\\ This class seems to +%work well with \jj. There is a switch, \verb+\iffoils+, that you +%can use if you want to switch between a formatting that does not +%use \texttt{foils}, and \texttt{foils}. + +\item \texttt{debug}: In the developmental stage, you can use the +\texttt{debug} option that will give you more information in the log +about what is going on. + +\item \texttt{double}: The face values of all cells are doubled. +(Double JavaScript Jeopardy!) Use it if you have time, energy and motivation +to write two Jeopardy games. + +\item \texttt{final}: After you have completed your +{\jj}, you can, optionally, build it one more time with +the \texttt{final} option. This option removes the menu, the +toolbar, the GUI interface of the Acrobat Viewer; all that is left +is your game. + + +\item \texttt{pro}: The \texttt{pro} option is available only with +the \texttt{dvips} or \texttt{dvipsone} driver. You are required to +use the AeB Pro package. This package requires that you use Acrobat +7.0 Pro (or later) and to create you PDF using Acrobat Distiller. +For the pro option, the questions are placed in OCGs (optional +content groups, or simply layers). See `\nameref{proOption}' on +page~\pageref*{proOption}. + +\item \texttt{forcredit}: This option brings in some security measures +that helps the instructor set up a Jeopardy game that can be used +for (extra) credit in the classroom. See the section titled +\nameref{forcreditOption} on page~\pageref*{forcreditOption}. + +\item \texttt{design=\ameta{design\_name}}: There are a limited number of +predefined designs. The values of the design parameter are +\texttt{jeopardy}, \texttt{florida}, \texttt{iceland}, +\texttt{hornet}, \texttt{qatar}, \texttt{norway}, \texttt{bahamas}, +and \texttt{spain}. These are in addition to the default color design scheme. + +\item \texttt{nodesigngraphics}: Some of the designs specified by +the \texttt{design} option have graphical backgrounds. To use a +specific design without the designed graphical background, use the +\texttt{nodesigngraphics}. In the preamble, you can optionally +specify your own graphical background using the graphical background +insert commands, see \Nameref{graphicsBGs}. + +\item \texttt{lang=\ameta{\upshape{english|german}}}: The Jeopardy game has some +language strings, most notably, the semi-humorous messages that +appear after the player responds to one of the questions. The +\texttt{lang} option allows these common strings to appear in +\texttt{german}. The default is \texttt{english}. When the \texttt{german} +option is in effect, a crude euro symbol is typeset instead of the +dollar, and the euro symbol is used in the score board as well. + +\item \texttt{allowpeeking}: The normal behavior of the game is that +if the contestant looks ahead at a question, then the tile on the +game board corresponding to the question viewed is hidden. The +contestant is not allowed to answer that question. Use this switch +to remove this feature of the game. + +\item \texttt{twoplayer}: At the request of a user, I've created a \texttt{twoplayer} option; +useful for classroom participation. See \Nameref{tpj} for details. + +\end{itemize} + +\newtopic\noindent +An example of usage of some of these options is +\begin{Verbatim}[xleftmargin=\amtIndent] +\documentclass[dvips,forcredit,lang=german, + design=florida]{jj_game} +\end{Verbatim} +You can also set your favorite driver as the default. Edit the file +\texttt{\jj.cfg} that comes with the distribution and place in it, for +example, the command +\begin{Verbatim}[xleftmargin=\amtIndent] +\ExecuteOptions{dvips} +\end{Verbatim} +\noindent(This sets \textsf{dvips} as the default driver.) In this case +the above example becomes +\begin{Verbatim}[xleftmargin=\amtIndent] +\documentclass[forcredit,lang=german,design=florida]{jj_game} +\end{Verbatim} +Specifying a driver as an optional parameter in the +\cs{documentclass} declaration will override whatever default set in +the \texttt{\jj.cfg} file. + +%\newtopic\noindent +%\textbf{\textcolor{red}{Option Removed:}} Previous versions (prior +%to version 3.0) of {\jj} class had a \texttt{foils} option. As far +%as I know, no one used this option, so I am removing it. + +% Changes +% Removed support for foils +% Now uses web package, with templates +% eforms, comment + + + +\section{Designing the Game and Posing the Questions} + +The following sections outline the design of the game. If you +don't specify a particular part of the design of the game, then a +default value will be substituted. + +The sample file \texttt{jj\_test.tex} represents a prototype game +that you can modify. + +\subsection{Stuff for the Preamble} + +There is potentially a lot of stuff that goes into the design of the +game. Again, all have default values, but there are some required +design parameters. + +\subsubsection{Banners and Backgrounds} + +Throughout the document, there are many colors living in {\LaTeX} space +that are under the control of the document author. Most all colors +can be set through the argument of the \cs{DeclareColors} command. + +\redpoint \cs{DeclareColors}: The argument of \cs{DeclareColors} +consist of key-value pairs. These key-values are in the JavaScript +style, key and value are separated by `\verb*!: !', the space is +required to follow the colon. The key references some color aspect +of the game, the value is named color. A color of +\texttt{transparent} is also recognized. The following is a +\cs{DeclareColors} structure listing all possible keys, with some +named color values.{\small +\begin{Verbatim} +\DeclareColors +{ + fillCells: lightgray, % background for cells + fillBanner: PineGreen, % color of banner + textBanner: Yellow, % color of text in banner + textBoard: Yellow, % color of text in categories on game board + fillInstructions: cornsilk, % background of the instructions page(s) + fillGameBoard: cornsilk, % background of the game board page + fillQuestions: cornsilk, % background of the questions pages + dollarColor: blue, % color of the heading of questions page + linkColor: red, % color of any hypertext links used +} +\end{Verbatim} +}% +If \cs{DeclareColors} is not present in the preamble, or if present, if the keys are not fully populated, +the default values are used. + +See \hyperref[colorscheme]{Section~\ref*{colorscheme}}, +beginning page~\pageref*{colorscheme}, for a visual representation of +these colors. + +\redpoint \cs{titleBanner}: On the instructions page, see +\hyperref[fig:instrPage]{Figure~\ref*{fig:instrPage}}, +page~\pageref*{fig:instrPage}, there is a banner heading. The text of this +banner is set by \cs{titleBanner} +\bVerb\takeMeasure{\string\titleBanner\darg{\ameta{Banner Text}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\titleBanner{!ameta(Banner Text)} +\end{dCmd} +\eVerb +This command is required, though if not set, the default text will appear, +``You are the Winner!''. For example +\begin{Verbatim} +\titleBanner{The \TeX\ Game!} +\end{Verbatim} +You can format the banner text using \cs{bannerTextFont} by redefining it. Its default +definition is +\begin{Verbatim}[xleftmargin=\amtIndent] +\newcommand{\bannerTextFont}{\sffamily\huge} +\end{Verbatim} +There are other banners in the Jeopardy game, the ones on the questions pages. +The text for these banners are the categories of question you declare +in the \cs{GameDesign} command, discussed in the next section. The +\cs{bannerTextFont} effects these banners as well. + +Finally, there is \cs{bannerTextControl} used for finer positioning of the banner text. +The default definition is +\begin{Verbatim}[xleftmargin=\amtIndent] +\newcommand{\bannerTextControl}[1]{#1} +\end{Verbatim} +This can be redefined for whatever purpose. Normally it is not needed. But, for example +\begin{Verbatim}[xleftmargin=\amtIndent] +\renewcommand{\bannerTextControl}[1]{\raisebox{3pt}{#1}} +\end{Verbatim} +The above example raises the banner text \texttt{3pt}. + +\subsubsection{Game Design}\label{gamedesign} + +\redpoint \cs{GameDesign}: In order to design a game, you must +have categories and questions in each category. The +\cs{GameDesign} is the macro that is used for this purpose. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\GameDesign +{ + Cat: \TeX, % list the categories + Cat: \LaTeX, % " + Cat: Classes \&~Packages, % " + NumQuestions: 3, % number questions per category + Goal: {3,500}, % set a goal, just for fun + GoalPercentage: 0, % goal as a percentage of money + CellWidth: 1in, % cell width + CellHeight: .5in, % cell height + ExtraWidth: 0pt, % additional width if needed + ExtraHeight: .2in, % additional height if needed + Champion: You are a Champion! % this text appears if goal is met +} +\end{Verbatim} +The key-value pairs can appear in any order. + +\newtopic\noindent +\textbf{Required Keys: } The \texttt{Cat} and +\texttt{NumQuestions} keys are required, though this is not +enforced. + +\newtopic\noindent +\textbf{Format for key-value paires.} The format is `\texttt{\ameta{key}: +\ameta{value}}'. Multiple key-values are separated by a comma (,). If the +value contains a comma, enclose the value in braces, as I did above with the +\texttt{Goal}. The last item can have an optional comma (,). + +Each key, except \texttt{Cat}, has a default value. The values of +these keys may need to be adjusted depending on the number of +categories, number of questions, and font size. + +\bluepoint The value of \texttt{Cat} has an optional argument, you +can say +\begin{Verbatim}[xleftmargin=\amtIndent] +Cat: [\small] Classes \&~Packages, +\end{Verbatim} +The value of the optional argument is inserted just before the +``Classes \&~Packages'' in the category heading of the game board. +In this case, its size is reduced to fit into the bounding +rectangle. + +\bluepoint The parmeter \texttt{GoalPercentage} needs comment. You +can set the goal by setting the percentage of the total money in +the game; i.e., \texttt{GoalPercentage: 90}, sets the goal to 90\% +of the total money. If \texttt{GoalPercentage} is present in the +\cs{GameDesign}, and its value differs from the default value of +zero (\texttt0), then the value of the \texttt{Goal} parameter, +if present, is discarded, and a new goal is calculated based on +the percentage of the total money, which is a function of the +number of categories, the number of questions per category, and +whether the \texttt{double} option has been invoked. + +\medskip +The {\jj} class takes these entries and computes the values for \cs{paperheight}, +\cs{paperwidth} and \cs{textheight}. + +I've used some code from Radhakrishnan C V's \textsf{pdfscreen}. In +that regard, you can, however, use \cs{marginsize} to set the +margins around the page, the default is +\begin{Verbatim}[xleftmargin=\amtIndent] +\marginsize{.25in}{.25in}{.25in}{.25in} +\end{Verbatim} + +We now turn to defining the attributes of the Acrobat form fields +that appear in the game. + +In the next few paragraphs, covering the appearance attributes of +the fields corresponding to \cs{APHidden}, \cs{APDollar}, +\cs{APRight}, \cs{APWrong} and \cs{APScore}, colors are specified in +the RGB color space; for example \texttt{0.98 0.92 0.73}. Note that +unlike the color package of {\LaTeX}, the numbers are separated by +spaces not commas. Also, the keys that begin with the word ``Fill'' +(e.g., \texttt{FillColor}) recognize the word \texttt{transparent} +as a value, in this case, there is no background color for that +field. + +\redpoint There is a hidden text field in the banner above the game board that is +revealed when the game is over (all questions are answered) and +the goal, set in \cs{GameDesign}, is met. The \cs{APHidden} +controls the appearance of this hidden banner. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\APHidden +{ + Champion: You are a Champion!, % this text appears if goal met + Font: TiRo, % font to be used + Size: 20, % size of the font + TextColor: 0 0 1, % color of the text + BorderColor: 0 0 0, % border color + FillColor: 0.98 0.92 0.73, % background color +} +\end{Verbatim} +The Champion key can be placed in the \cs{GameDesign} structure; +this is more convenient for creating pre-packaged designs +(such as \texttt{design=jeopardy} and \texttt{design=florida}). + +\redpoint \cs{APDollar}: The \cs{DesignGame} just sets basic +parameters, it does nothing towards defining color. For that, I +have the \cs{APDollar} macro. This macro sets the attributes of the +numbers that appear as the game cells on the game board. +\begin{Verbatim}[fontsize=\small,xleftmargin=\amtIndent] +\APDollar +{ + Font: TiRo, % font to be use for the numbers + Size: 20, % size of font + TextColor: 0 0 1, % color for the numbers + BorderColor: 0 0 0, % color of border + FillColor: 1 .35 1, % the fill color for the cell face +} +\end{Verbatim} +The above are all the defaults. The \cs{APDollar} +macro does not have to appear, unless you want to change one of +the defaults. + +\redpoint \cs{APRight} and \cs{APWrong}: Under the face of the +cells are two hidden text fields, one for a ``Right'' answer, one +for a ``Wrong'' answer. The two macros \cs{APRight} and \cs{APWrong} +have the same key-value arguments. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\APRight{ + Font: TiRo, Size: 20, TextColor: 0 0 1, Message: Right!} + +\APWrong{ + Font: TiRo, Size: 20, TextColor: 1 0 0, Message: Wrong!} +\end{Verbatim} +The default value for the \texttt{Message} parameter is +``\texttt{Right!}'' (``\texttt{Wrong!}''), but these can be changed with +\cs{correctText} (\cs{incorrectText}). For German, for example, you can put +in the preamble \verb+\correctText{Richtig!}+ (\verb+\incorrectText{Falsch!}+), +this command lends itself to customization. + +\redpoint \cs{APScore}: There is a text field, set by the command +\cs{ScoreBoard}, to keep track of the score. The following macro +designs the appearance attributes for the score board. +\begin{Verbatim}[fontsize=\footnotesize] +\APScore{ + Font: TiRo, % font to be used + Size: 20, % font size to be used + TextColor: 0 0 1, % text color + BorderColor: 0 0 0, % border color + FillColor: 0.98 0.92 0.73, % background color + CellHeight: \the\cellHeight, % default same as cells (usually not specified) + CellWidth: \the\cellWidth, % default same as cells (usually not specified) + AutoPlacement: true, % auto placement of score, values: true or false + Score: "", % score text + Currency: "$", % currency + align: r, % horizonal align: l (left), c (center), r (right) +} +\end{Verbatim} + + +\bluepoint To get a currency of a EURO or some other currency symbol, use +Unicode; in the case of the EURO, use \verb!Currency: "\string\\u20AC"!. +When the \texttt{lang} option is set to \texttt{german}, the EURO +automatically becomes the default currency symbol. + +The following is a listing of some of the common currency signs. Keep in mind, that +these must be escaped like so \verb!Currency: "\string\\00A5"! (Yen Sign). +\begin{center} +\begin{tabular}{lll||lll} +Description & Unicode & Symbol & Description & Unicode & Symbol \\\hline +Dollar Sign & \cs{u0024}& \cS{Dollar}{0024} & Lira Sign & \cs{u20A4} &\cS{Lira}{20A4}\\ +Pound Sign & \cs{u00A3}& \cS{Pound}{00A3} & Peseta Sign & \cs{u20A7} &\cS{Pesta}{20A7}\\ +Currency Sign & \cs{u00A4}& \cS{Currency}{00A4} & New Sheqel Sign & \cs{u20AA} &\cS{Sheqel}{20AA}\\ +Yen Sign & \cs{u00A5}& \cS{Yen}{00A5} & Dong Sign & \cs{u20AB} & \cS{Dong}{20AB}\\ +French Franc & \cs{u20A3}& \cS{Franc}{20A3} & Euro Sign & \cs{u20AC} &\cS{Euro}{20AC}\\ +\end{tabular} +\end{center} +The Font key needs to have a value of a font that contains the currency symbol. For example, +\texttt{TiRo} and \texttt{Arial} (the open type font versions) both have these currency symbols. + +Some currency symbols, and I don't know which are appended to the end of the number. Use +\bVerb\takeMeasure{\string\prependCurrency}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\prependCurrency +\appendCurrency +\end{dCmd} +\eVerb +The first, which is the default, prepends the currency sign to the number, whereas, +the command \cs{appendCurrency} appends it to the end of the number. Execute these in the preamble. + +\bluepoint The \texttt{align} parameter horizontally aligns the +contestant's current total in the text field. Permissible values are +\texttt{l} (for left aligned), \texttt{c} (for centered), and +\texttt{r} (for right aligned, the default). + +\bluepoint Then \texttt{AutoPlacement} is \texttt{true}, the \cs{ScoreBoard} is +centered directly under the game board. If \texttt{false}, then +you have to provide a placement for the \cs{ScoreBoard}. In this case, use the macro +\cs{PlaceScoreBoard}: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\PlaceScoreBoard{\vfill\hspace{\rulewidth}\hspace{\extraWidth}% + \medskip\ScoreBoard} +\end{Verbatim} +This places the score board at the bottom of the page, aligned +with the left edge of the game board. + +\subsection{The Stuff in the Body of the Document} + +Now that we've finished laying out the design of the game, we are ready to +actually pose the questions. This is done in the body of the document, +following \verb!\begin{document}!, don't you know. First come the instructions, +the contestant can't play the game without instructions! + +\subsubsection{The Instructions} + +The first page of the game consists of the instructions. Place the +instructions in the \texttt{instructions} environment. +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()] +\begin{instructions} +!ameta(instructions go here) %!rm perhaps a graphic as well +... +\end{instructions} +\end{Verbatim} + +The \verb+\end{instructions}+ ends the page, and inserts the +game board on the next page. + +Should you need more than one page of instructions, use +\cs{insertJJTitleBanner}. This command will start a new page and +place the title banner at the top of the page. + +\subsubsection{The Questions} + +Following the instructions environment comes the question and +multiple choice alternatives. For this, there is a \texttt{Category} +environment, within which is placed a series of \texttt{Question} +environments. The number of questions per category must be the same +as declared as the value of \texttt{NumQuestions} in the +\cs{GameDesign} macro. + +The format is as follows: +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()] +\begin{Category}{!ameta(category_name)} +\begin{Question}[!ameta(num_of_columns)] +!ameta(Text of the question) +\Ans0 ... % a wrong answer +\Ans1 ... % the right answer +\Ans0 ... % another wrong answer +\end{Question} +\end{Category} +.......... +.......... +\end{Verbatim} +The number of categories must be the same as was listed in macro +\cs{GameDesign}. +The \ameta{category\_name} is required; it is used to send +messages to the log about whether you are listing the categories +in the correct order. It doesn't have to be exactly the same as +was defined in \cs{GameDesign}. + +\bluepoint The macro \cs{Ans} typesets the answers, it takes one +argument. An argument of `\texttt0', e.g., \cs{Ans0}, means that +answer is wrong, an argument of `\texttt1', e.g., \cs{Ans1}, means +the answer is the correct one. + +\bluepoint The default behavior is a column listing of the answers. You can +have a tabular format by specifying an optional number in the +brackets, \ameta{num\_of\_columns}. + +% jman says add a two column example + +Beginning with version 3.0 of {\jj}, you can now pose +fill-in questions, in addition to multiple choice questions. Use +\cs{RespBoxMath} for math fill-in questions and \cs{RespBoxTxt} for +text fill-in questions. See the manual \texttt{aeb\_man.pdf}, the manual +of usage for the \cAcroEB. + +Enclose the two commands \cs{RespBoxMath} and \cs{RespBoxTxt} in a special +environment, \texttt{oAnswer}. This environment redefines the actions of these +two standard \textsf{exerquiz} commands. + +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\begin{Question} + If $f(x) = 2x^2 + x $, what is $f(2x)$? + \begin{oAnswer} + \begin{equation*} + f(2x)=\RespBoxMath{2*(2x)^2 + 2*x}{4}{.0001}{[1,2]} + \end{equation*} + \end{oAnswer} +\end{Question} +\end{Verbatim} + +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\begin{Question} + He was the first president of the United States? Who was\dots + \begin{oAnswer} + \RespBoxTxt{2}{1}{3}{George Washington} + {G. Washington}{Geo. Washington} + \end{oAnswer} +\end{Question} +\end{Verbatim} +Do not use the optional argument for the \texttt{Question} environment, it is +not needed for fill-in questions. + +\redpoint The questions page consist of three parts: (1) The banner that +states the category for this question; (2) the currency heading +which typically says ``\textcolor{blue}{For \$100:}''; and (3) the question. + +There are two other commands that can be used to change the +appearance of the questions page. +\bVerb\takeMeasure{\string\currencyHeading\darg{\ameta{currencyHeading}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\currencyHeading{!ameta(currencyHeading)} +\aboveCurrencySkip{!ameta(skip)} +\end{dCmd} +\eVerb The \cs{currencyHeading} heading is a command that can be used to change the text that sets up +the question for the page, The default value is +\begin{Verbatim}[xleftmargin=\amtIndent] +\currencyHeading{\bfseries For~\$\theCurrencyAmt:} +\end{Verbatim} +where \cs{theCurrencyAmt} is a command that expands to the correct amount (of currency) for +this question. Use this command in the preamble to redefine the text. For \texttt{lang=german}, +this text is automatically redefined. + +\cs{aboveCurrencySkip} adjusts the amount of vertical space between the page banner, and the currency +heading. The default is +\begin{Verbatim}[xleftmargin=\amtIndent] +\aboveCurrencySkip{0pt} +\end{Verbatim} + +\newtopic\noindent And that's all there is to it! + +\section{Building the Game}\label{s:buildgame} + +For people using \textsf{pdftex} or \textsf{dvipdfm}, there is no +special processing. Just `\textsf{pdflatex}-it' or `\textsf{dvipdfm}-it', +and you are ready to play! + +For \textsf{dvipsone} and \textsf{dvips}, some additional steps +are necessary. The \jj{} class uses Document Level JavaScripts to +control the game as it progresses. + +For users of \textsf{Acrobat~5.0} or later, the document level +JavaScript is automatically inserted when the game is open in +\textsf{Acrobat} for the first time following distillation, provided +the \textsf{PDF} was saved back into the same folder as the source +file. (It is in this folder that \TeX{} has written the DLJS in the +form of an \textsf{FDF} file.) + +Finally, do a `\texttt{Save As}\dots' from \textsf{Acrobat} to +save the DLJS that have just been inserted. You are now ready to play! + +\section{Jeopardy for Credit} + +This section outlines the support implemented to enable the Jeopardy games produced +by {\jj} to be offered up for credit in a relatively secure environment. + +\subsection{AeB No Go Pro} + +Should you wish to offer a Jeopardy game for class credit or extra +credit, you need to include \cs{contestantName} to allow the ``contestant'' to +enter his/her name. +\bVerb\takeMeasure{\string\contestantName\darg{\ameta{length}}\darg{\ameta{width}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\contestantName{!ameta(length)}{!ameta(width)} +\end{dCmd} +\eVerb +where \ameta{length} and \ameta{width} are the height and width of the text +field. See item \ding{194} of \hyperref[instructionsPage]{Figure~\ref*{instructionsPage}}, +page~\pageref*{instructionsPage}. + +\CmdLoc Place this command within the \texttt{instructions} environment. + +An example of usage: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\textcolor{red}{\textbf{Name:}} + \underbar{\contestantName{1.5in}{11bp}} +\end{Verbatim} +In the preamble you can use \cs{afterGameBoardInsertion} to insert material just below +the game board and score board. Whereas this is a general purpose command, you can +use it to insert a print button +\begin{Verbatim}[xleftmargin=\amtIndent] + \afterGameBoardInsertion{\medskip\gameboardPrintButton} +\end{Verbatim} +The command \cs{gameboardPrintButton} creates three form fields, a +print-this-page button, a read only text field with the contestant's +name pre-filled (remember, contestant entered her/his name in the +instructions page), and a read only text field that documents when +the contestant first opened the Jeopardy game. There is an optional +argument for \cs{gameboardPrintButton}, this is a standard argument +for changing the appearance of the button (see eForms manual). + +The three fields have labels that appear in front of the fields, these labels +can be changed using the following commands: +\bVerb\takeMeasure{\string\contestantNameLabel\darg{\ameta{label for contestant name field}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\printButtonCaption{!ameta(caption on button)} +\printButtonLabel{!ameta(button label)} +\contestantNameLabel{!ameta(label for contestant name field)} +\timestampLabel{!ameta(label for time stamp field)} +\timeStampFormat{!ameta(util.printd formatting string)} +\end{dCmd} +\eVerb +Use \cs{printButtonCaption} to change the text that appears on the +button face, called the button caption.\footnote{This label will be part of the button, it is not part of +{\LaTeX} space, so no formatting is used here.} The argument of +\cs{timeStampFormat} is the formatting string of the +\texttt{util.printd()} method, see the documentation on that method +from the \emph{JavaScript for Acrobat API Reference}. + +The defaults are, respectively, +\begin{Verbatim}[xleftmargin=\amtIndent] +\printButtonCaption{Print} +\printButtonLabel{Print this page:} +\contestantNameLabel{Student:} +\timestampLabel{Time stamp:} +\timeStampFormat{mm-dd-yy, H:MM:ss.} +\end{Verbatim} +All the above commands are available for all the drivers. + +Should you wish to offer up a Jeopardy game for class credit, the +document needs to be secured. If you have Acrobat, version 5.0 or +later, you can give the document a no-printing attribute to prevent +the students from printing the document and handing it around. Wait, +they need to print the game board and hand it in! So setting the +document on no-printing does not help. + +How can we print the game board page, yet not allow the students +to print the questions? The answer to this question is in \Nameref{proOption}. + +\subsection{AeB Pro} + +The techniques described in this section assume the use of the new +AeB Pro (Acro\,\TeX{} eDucation Bundle Professional). The +requirement for AeB Pro is the document author, that's you, must use +Acrobat Pro, version 7 or later, and must create PDF using Acrobat +Distiller. If you are not one of these types, read no further; +however, it's okay if you read on, maybe the AeB Pro and its +applications will intrigue you enough to convert to the use of Acrobat Pro and +its little brother Distiller. + +\subsubsection{The \texttt{forcredit} Option}\label{forcreditOption} + +When you take the \texttt{forcredit} option and are using AeB +Pro,\footnote{If you are not using AeB Pro, this option does +nothing.} JavaScript code is added to the document that prevents the +student (contestant :-) from continuing on to the game board page +(or any of the questions page) without first identifying themselves +in the text field created by the \cs{contestantName} command. + +This ``annoyance factor'' guarantees the student has identified +himself before playing the game; hence, no excuses when they +turn in the game board with the name hand written in. + +This is just one more piece of the puzzle to the problem of Jeopardy +for credit, but it does not solve the printing problem. See the next +section for that. + +\subsubsection{The \texttt{pro} Option}\label{proOption} + +The \texttt{pro} option brings in the use of layers from AeB +Pro.\footnote{Adobe refers to layers as optional content groups +(OCG).} Layers are content that are placed in different groups. The +groups can be turned on (made visible) or off (made hidden). + +The content of each of the question pages is placed in its own +layer and made hidden. If you scroll to a question page, the +question is not visible, as it is still in a hidden state. When you +arrive on the page \emph{legally} via choosing a cell from the game +board, the layer for that question is made visible. + +The layers are given a ``no-print even if visible'' +attribute,\footnote{Yes, layers, and AeB Pro can do that!} so if the +student prints the document, the layers do not print! + +Adobe Reader and Acrobat have a Layers Navigation Panel through +which layers can be made visible, but {\jj} through AeB Pro locks +the layers. A locked layer means that the document consumer cannot +change the state (visible, hidden) of the layer through the user +interface. The state of a locked layer can be changed, however, +through JavaScript API, and that is exactly what {\jj} does! + +When the \texttt{pro} option is used, Adobe Reader 7.0 or later is +required to view the layers (some JavaScript methods are used that +are first defined in version 7). To prevent people viewing the game +who do not have at least version 7, you can use the command +\cs{requiresVersion} from AeB Pro. In the preamble of your game place +\begin{Verbatim}[xleftmargin=\amtIndent] +\requiresVersion{7} +\end{Verbatim} +See the documentation of \cs{requiresVersion} for further details, +and related commands that may be useful. When someone opens the +document that does not have at least version 7, either the document +is closed immediately and an alert box is issued, or if the document +is viewed in a browser, an alert message is displayed, and the user +in redirected to another page on the Internet. + +This scheme is not air tight, it can be gotten around, but I'm not +telling. + +\section{Two Player Jeopardy!}\label{tpj} + +When the \texttt{twoplayer} option is taken, two score boards are +created and the two contestants alternate play. The two contestants +are labeled `Player 1' and `Player 2', the border of the score board +is highlighted to indicate whose turn it is. +There is also a check box with a red dot in it to indicated whose +turn it is. The game plays the same, except the +results of each contestant are tabulated in their respective score +board. The rest of this section describes customizations. + +In addition to the key-values of \cs{APScore} discussed earlier, see +\nameref{gamedesign}, page~\pageref*{gamedesign}, +the following key-values are specific to the \texttt{twoplayer} option. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\APScore { + tpScaledCellWidth: .5, + tpHighlightBorderColor: 1 0 0 +} +\end{Verbatim} +When the \texttt{twoplayer} option is used, \textsf{jj\_game} multiplies the \emph{value} of \texttt{CellWidth} +(as specified in \cs{APScore}) by \texttt{tpScaledCellWidth}; if the resultant value is less than the \cs{cellWidth} +(the width of the cells in the game board), \cs{cellWidth} is used for the width of the \texttt{twoplayer} score boards; +otherwise, the resultant value is used. The default value is \texttt{.5}. + +The key \texttt{tpHighlightBorderColor} specifies the highlight color; the color that is used to paint the boundary +of the score board of the player whose turn it is. This value is also used to color the check box, the other indicator +of whose turn it is. The value \texttt{tpHighlightBorderColor} is a three component value in RGB color space; the +default is \texttt{1 0 0} (red). Note that there are \emph{no commas} between the component values. + +The \textsf{jj\_game} creates a switch \cs{ifjjgtwoplayer} to signal the \texttt{twoplayer} option. This switch may +be used, for example when specifying the value of \texttt{CellWidth} in \cs{APScore}: + +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\APScore { + Size: 0, + tpScaledCellWidth: 1, + CellWidth: \ifjjgtwoplayer\cellWidth+20pt\else2in\fi, +} +\end{Verbatim} +In the above, for two player mode, we set the cell width of the score fields to be the \cs{cellWidth} +of the cells on the game board plus \texttt{20pt}; otherwise, the width is set to \texttt{2in}. +We also set \texttt{tpScaledCellWidth} to 1 so the calculated width of the two player score fields +will be \verb!\cellWidth+20pt! and not half this value, which is what it would be if +\texttt{tpScaledCellWidth} maintains its default value of .5.\footnote{Actually, if \texttt{tpScaledCellWidth} +were .5, the width of the score fields will be \cs{cellWidth}, see the description of +\texttt{tpScaledCellWidth} above.} + +\newtopic The \cs{setTwoPlayerOptions} command allows you to specify some other twoplayer key-values. + +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\setTwoPlayerOptions { + player1: Player 1, + player2: Player 2, + playerFmt: \sffamily\small, + checkbox: true +} +\end{Verbatim} +When in two player mode, there are two score fields. Beneath these fields are \emph{contestant labels}. The values +of \texttt{player1} and \texttt{player2} are used to specify these labels. (The default values are shown in +the example above.) The playerFmt key is a convenient way of specifying the formatting for the contestant +labels. The default is \verb!\sffamily\small!. Finally, there are two check boxes that appear, in addition to +the two score fields, that indicate the turn. The default is that these check boxes appear, if you say, +\texttt{checkbox: false}, the check boxes are not created. + + +\section{Additional Customizations} + +This section includes many commands for customizing +the look of a Jeopardy game. + +\subsection{Customize those Text Strings} + +In addition to the many strings already documented earlier in this +manual, there are a few others. These strings are either AcroForm +strings or JavaScript strings, so accents must use octal coding or +unicode. For example, use \verb!\string\344! or \verb!\string\u00E4! +(version 7.0 or later) for \"{a}. + +The following strings appear either as text on a button face or as a message +in an alert box. The meaning of each command should be clear. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\correctText{Right!} +\incorrectText{False!} +\enterNamePlease{Please, enter your name on the first + page before you begin the game!} +\illegalAccessMsg{You are peeking at this question. Choose a + question from the game board first! You may want to start + the game over now!} +\illegalAnswerTwiceMsg{Changing your answer is not allowed!} +\end{Verbatim} +New values of these commands must be entered into the preamble. + +There are some strings specific to the \texttt{twoplayer} option: + +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\playeriWinnerMsg{\jjg@playeri\space is the winner!} +\playeriiWinnerMsg{\jjg@playerii\space is the winner!} +\gameTiedMsg{It is all tied up! You are equally matched!} +\bothLosersMsg{You two either are not trying, + or you do not know anything about the subject!} +\end{Verbatim} +The commands \cs{jjg@playeri} and \cs{jjg@playerii} hold the contestant labels, +as defined by the values of \texttt{player1} and \texttt{player2} of \cs{setTwoPlayerOptions}. +New values of these commands must be entered into the preamble. + + +\subsection{Graphical Backgrounds}\label{graphicsBGs} + +Beginning with version 3.0 of \jj, graphical backgrounds can be inserted into +the Jeopardy game. The basic command for doing this is \cs{template}. +The \cs{template} command is defined in the Web package. An example +of its usage is +\begin{Verbatim} +\template{myCoolGraphic} +\end{Verbatim} +where \texttt{myCoolGraphic} is a graphic, an EPS file if the driver +is dvips or dvipsone, or a PDF graphic for pdftex. Generally, any +graphic the driver supports. Place the \cs{template} command +between pages, the graphic will be insert in the next page. + +However, to make things even easier, {\jj} defines three commands: +\bVerb\takeMeasure{\string\defineInstructionPageGraphic\darg{\ameta{graphic}}}% +\begin{dCmd}[commandchars=!()]{\bxSize} +\defineInstructionPageGraphic{!ameta(graphic)} +\defineGameboardPageGraphic{!ameta(graphic)} +\defineQuestionPagesGraphic{!ameta(graphic)} +\end{dCmd} +\endgroup +\CmdLoc Place in the preamble of the document. + +\CmdDescription The \cs{defineInstructionPageGraphic} command inserts the +graphic for the instruction page(s). The \cs{defineGameboardPageGraphic} command +inserts the graphic for the game board page. +Finally, \cs{defineQuestionPagesGraphic} inserts the graphic for the question +pages. See the \textcolor{blue}{AeB Manual} for more details on the use of templates. + +The \textsf{web} package manages the templates of the document. Web +will resize the graphic to fit the dimensions of the page; as a +result, any graphical design may be slightly or greatly distorted. A +slight distortion may be acceptable, but a large distortion is not. + +\redpoint The file \texttt{jeopardy\_demo} demonstrates the work of +Simon Singer and J\"{u}rgen Gilg, both of Germany. In that game, +there are four categories and five questions per category. The game +was built and the positioning of the various elements of the game +(banners, gameboard, score field, etc.) are then known. Simon +brought each of the three types of pages (instruction, game board, +and question) into Adobe Photoshop and designed graphics that fit +exactly around the various elements. Using these graphics for the +game then yielded the results you see in the Jeopardy game +\texttt{jeopardy\_demo.pdf}. Very swave! + +You may be satisfied with a colorful background, a simple graphic as +a background, or something based on a high skill level, such as what +is demonstrated by Simon Singer and J\"{u}rgen Gilg. In the end, it +is all up to you. + +\section{Color Summary}\label{colorscheme} + +In this section, a visual presentation of the colors that can be set +through the various commands. + +\begin{figure}[ht] +\begin{pspicture}(-2,0)(10,8.5) +\rput[lb](0,0){\includegraphics[scale=0.35]{jj_instructions}} +\psline[linecolor=red]{->}(-0.7,7.25)(0,8) +\rput(-1,7){\NO{1}} +\psline[linecolor=red]{->}(-0.7,6.25)(1.5,7.3) +\rput(-1,6){\NO{2}} +\psline[linecolor=red]{->}(-0.6,5)(2.5,4.8) +\rput(-1,5){\NO{3}} +\end{pspicture} +\caption{Instructions Page}\label{instructionsPage} +\end{figure} + +\paragraph{Explanations} +\labelsep20pt\itemsep18pt +\begin{itemize} +\item[\NO{1}] This is the background color of the Instruction page. + +\textbf{Setup:} \texttt{fillInstructions: myColor} in the \cs{DeclareColors} command +\item[\NO{2}] These are the colors of the title banner of the Instruction page. + +\textbf{Setup:} In the \cs{DeclareColors} command, use \texttt{fillBanner: myColor} for the banner background and + \texttt{textBanner: myColor} for the banner text + +\item[\NO{3}] This is a little special to integrate the user's name to identify who's the one that takes the game. + +\textbf{Setup:} \verb!\underbar{\contestantName{1.5in}{11bp}}! +\end{itemize} + +\begin{figure}[ht] +\begin{pspicture}(-2,0)(10,8.5) +\rput[lb](0,0){\includegraphics[scale=0.35]{jj_gameboard}} +\psline[linecolor=red]{->}(-0.7,7.25)(0,8) +\rput(-1,7){\NO{4}} +\psline[linecolor=red]{->}(-0.7,6.25)(0.6,7.3) +\rput(-1,6){\NO{5}} +\psline[linecolor=red]{->}(-0.6,5)(0.6,4.8) +\psline[linecolor=red]{->}(-0.6,5)(0.6,5.8) +\rput(-1,5){\NO{6}} +\psline[linecolor=red]{->}(-0.6,4)(3,6) +\rput(-1,4){\NO{7}} +\psline[linecolor=red]{->}(-0.6,3)(3,2.75) +\rput(-1,3){\NO{8}} +\psline[linecolor=red]{->}(-0.6,2)(2.5,1.9) +\rput(-1,2){\NO{9}} +%\psgrid +\end{pspicture} +\caption{Gameboard Page}\label{gameboardPage} +\end{figure} + +\paragraph{Explanations} +\labelsep20pt\itemsep18pt +\begin{itemize} +\item[\NO{4}] This is the background color of the Game Board page. + +\textbf{Setup:} \texttt{fillGameBoard: myColor} in the \cs{DeclareColors} command. +\item[\NO{5}] These are the colors of the game board Categories. + +\textbf{Setup:} In the \cs{DeclareColors} command, use \texttt{fillBanner: myColor} for the category +background and \texttt{textBanner: myColor} for the category text. + +\textbf{Note:} This is named equal to the instructions page and possible to be set locally. +\item[\NO{6}] These are the colors of the game board Cells \textbf{after} the questions are taken. + +\textbf{Setup:} \texttt{TextColor: 0 0 0, BorderColor}: 0 0 0, for +the cell text and border color in the \cs{APRight} and \cs{APWrong} +commands. The background color is set up using the +\texttt{fillCells} in the \cs{DeclareColors} command. + +\textbf{Note:} Here the colors are defined in the rgb color scheme. +\item[\NO{7}] These are the colors of the game board Cells \textbf{before} the questions are taken. + + +\textbf{Setup:} For the \cs{APDollar} command, use +\texttt{TextColor: 0 0 0, BorderColor: 0 0 0, FillColor: 0.92 +0.67 0.1} for the cell text, border and background color, respectively. + +\textbf{Note:} Here the colors are defined in the rgb color scheme. +\item[\NO{8}] These are the colors of the Score field. + +\textbf{Setup:} \texttt{BorderColor: 0 0 0, FillColor: 0.92 0.67 0.1} for the Score border and background color in the \cs{APScore} command. + +\textbf{Note:} The text color of the score is setup in the colors of the \cs{APRight} and \cs{APWrong} commands, so that the user may quickly see, if she/he is in positive or negative score. A minus is additionally setup if the user lost more points than she/he won. + +The customer can choose an individual currency as well. +\item[\NO{9}] This is a print option, to print out the game board, after the game is finished. This may be useful for teachers, to collect the individual results of her/his students. That's the reason, why in the instructions page the name was forced to be filled in. Now the name is as well on the print out. + +This is automatically setup when the \texttt{forcredit} option for the {\jj} class is taken. +\end{itemize} + +\begin{figure}[ht] +\begin{pspicture}(-2,0)(10,8.5) +\rput[lb](0,0){\includegraphics[scale=0.35]{jj_questions}} +\psline[linecolor=red]{->}(-0.7,7.25)(0,8) +\rput(-1,7){\NO{10}} +\psline[linecolor=red]{->}(-0.7,6.25)(0.6,7.3) +\rput(-1,6){\NO{11}} +\psline[linecolor=red]{->}(-0.6,5)(0.6,6) +\rput(-1,5){\NO{12}} +\psline[linecolor=red]{->}(-0.6,4)(0.4,4) +\rput(-1,4){\NO{13}} +\end{pspicture} +\caption{Questions Page}\label{questionPage} +\end{figure} +\paragraph{Explanations} +\labelsep20pt\itemsep18pt +\begin{itemize} +\item[\NO{10}] This is the background color of the Questions page. + +\textbf{Setup:} \texttt{fillQuestions: myColor} in the \cs{DeclareColors} command +\item[\NO{11}] These are the colors of the questions Categories. + +\textbf{Setup:} In the \cs{DeclareColors} command, use \texttt{fillBanner: myColor} for the questions category background and + \texttt{textBanner: myColor} for the questions category text. + +\textbf{Note:} This is named equal to the banner of the instructions page and possible to be set locally. +\item[\NO{12}] This is a referring text to the taken question score. + +\textbf{Setup:} \texttt{dollarColor:\,myColor} for the referring text color +in the \cs{DeclareColors} command. + +\textbf{Note:} Text changes can be done with the command: + +\verb!\currencyHeading{\bfseries For~\$\theCurrencyAmt:}! +\item[\NO{13}] This is the color of the links (answer possibilities). + +\textbf{Setup:} \texttt{linkColor: myColor} for the link color in the \cs{DeclareColors} command +\end{itemize} + + +\end{document} diff --git a/texmf-dist/source/latex/jj-game/jj_game.dtx b/texmf-dist/source/latex/jj-game/jj_game.dtx new file mode 100644 index 00000000..2d2b2db7 --- /dev/null +++ b/texmf-dist/source/latex/jj-game/jj_game.dtx @@ -0,0 +1,1747 @@ +% \iffalse +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% jj_game.cls class file, %% +%% Copyright (C) 2000-2016 D. P. Story %% +%% dpstory@uakron.edu %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1 of the %% +%% License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01] +%<package>\ProvidesClass{jj_game}[2016/11/24 v3.1 jj_game Class (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex=false]{hyperref} +%\pdfstringdefDisableCommands{\let\\\textbackslash}% +\OnlyDescription % comment out for implementation details +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\InputIfFileExists{aebdocfmt.def}{\PackageInfo{jj_game}{Inputting aebdocfmt.def}} + {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax + \PackageInfo{jj_game}{aebdocfmt.def cannot be found}} +\begin{document} +\def\CMD#1{\textbackslash#1} +\let\pkg\textsf +\let\opt\texttt +%\addtolength{\marginparwidth}{3pt} + \GetFileInfo{jj_game.cls} + \title{\pkg{jj\_game}\texorpdfstring{\\}{:} A {\LaTeX} class to construct Jeopardy-like Games} + \author{D. P. Story\\ + Email: \texttt{dpstory@uakron.edu}} + \date{processed \today} + \maketitle + \tableofcontents + \let\Email\texttt + \DocInput{jj_game.dtx} +\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex}{\paragraph*{Index} The index goes here.\\Execute + \texttt{makeindex -s gind.ist -o jj\_game.ind jj\_game.idx} on the command line and recompile + \texttt{jj\_game.dtx}.} +\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here.\\Execute + \texttt{makeindex -s gglo.ist -o jj\_game.gls jj\_game.glo} on the command line and recompile + \texttt{jj\_game.dtx}.} +\end{document} +%</driver> +% \fi +% +% \MakeShortVerb{|} +% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{jj_game}{Inputting aebdonotindex.def}} +% {\PackageInfo{jj_game}{cannot find aebdonotindex.def}} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% \section{Declare Options} +% \begin{macrocode} +\RequirePackage{xkeyval} +% \end{macrocode} +% Add \pkg{ifpdf} and \pkg{ifxetex} for automatic driver detection. +% \changes{v3.1}{2016/11/24}{Add automatic driver detection for \string\pkg{ifpdf} and \string\pkg{ifxetex}} +% \changes{v3.1}{2016/11/24}{Added support for \opt{xetex} driver. There are numerous changes to get +% the positioning of the form fields correct. Changes are characterized by uses of \string\cs{ifxetex} +% and \string\cs{efKern}.} +% \begin{macrocode} +\RequirePackage{ifpdf}[2006/02/20] +\RequirePackage{ifxetex}[2006/08/21] +\newcounter{jjgdriver} +% \end{macrocode} +% Here is the list of supported drivers:\IndexOpt{dvips}\IndexOpt{pdftex}\IndexOpt{xelex}\IndexOpt{luatex} +% \texttt{pdftex}, \texttt{luatex}, and \texttt{xetex} are automatically detected and need not be specified. +% Other less used drivers are also supported. +% \begin{macrocode} +\DeclareOptionX{pdftex}{\setcounter{jjgdriver}{0} + \def\jjgdriver{\@gobble}} +\DeclareOptionX{luatex}{\setcounter{jjgdriver}{0} + \def\jjgdriver{\@gobble}} +\DeclareOptionX{dvips}{\setcounter{jjgdriver}{1} + \def\jjgdriver{dvips}\PassOptionsToPackage{dvips}{web}} +\DeclareOptionX{dvipsone}{\setcounter{jjgdriver}{1} + \def\jjgdriver{dvipsone}\PassOptionsToPackage{dvipsone}{web}} +\DeclareOptionX{dvipdfm}{\setcounter{jjgdriver}{2} + \def\jjgdriver{dvipdfm}\PassOptionsToPackage{dvipdfm}{web}} +\DeclareOptionX{dvipdfmx}{\setcounter{jjgdriver}{2} + \def\jjgdriver{dvipdfmx}\PassOptionsToPackage{dvipdfmx}{web}} +\DeclareOptionX{xetex}{\setcounter{jjgdriver}{2} + \def\jjgdriver{\@gobble}} +% \end{macrocode} +% \begin{macrocode} +\DeclareOptionX*{\PassOptionsToClass{\CurrentOption}{article}} +% \end{macrocode} +% Used for debugging: +% Where's the bug?\IndexOpt{debug} +% \begin{macrocode} +\newif\ifdebug \debugfalse +\DeclareOptionX{debug}{\debugtrue} +% \end{macrocode} +% This option \IndexOpt{final}\opt{final} removes window ui and other things. +% \begin{macrocode} +\newif\iffinal \finalfalse +\DeclareOptionX{final}{\finaltrue} +% \end{macrocode} +% Play \textbf{Double Jeopardy!}\IndexOpt{double} Double the amounts, double the fun! +% \begin{macrocode} +\newif\ifdouble \doublefalse +\def\scaleFactor{1} +\DeclareOptionX{double}{\doubletrue\def\scaleFactor{2}} +% \end{macrocode} +% We implement a two player game\IndexOpt{twoplayer}, by first declaring \texttt{twoplayer} as an option. +% \changes{v3.0h}{2008/11/16}{Added \texttt{twoplayer} option, as well as additional properties for +% setting up the option.} +% \begin{macrocode} +\newif\ifjjgtwoplayer\jjgtwoplayerfalse +\def\twoplayerGame{false} +\DeclareOptionX{twoplayer}{\jjgtwoplayertrue\def\twoplayerGame{true}} +% \end{macrocode} +% Inputs the \IndexOpt{pro}\texttt{pro} code: uses layers, distiller 7.0 or later is required. +% If the \texttt{pro} option is taken, then allow peeking as layers are used to hide the questions. +% \begin{macrocode} +\DeclareOptionX{pro}{\let\jjgInputProCode\jjg@InputProCode + \ExecuteOptionsX{allowpeeking} + \AtBeginDocument{\@ifundefined{xBld}{\PackageError{jj_game} + {You have specified the `pro' option, but\MessageBreak + the aeb_pro package is not loaded with its\MessageBreak + `uselayers' option}{See jjg_pro_ca.tex as an example of + the correct loading\MessageBreak + of aeb_pro}}{}}} +\def\jjg@InputProCode{\InputIfFileExists{jjgpro.def}% + {\ClassWarning{jj_game}{Inputting code for pro option} + \ClassWarningNoLine{jj_game}{AeB Pro required with uselayers + option}}{\ClassWarning{jjg_game}{Cannot find jjgpro.def. + \MessageBreak Reinstall or refresh your file name database.}}} +\let\jjgInputProCode\relax +\AtEndOfClass{\jjgInputProCode} +% \end{macrocode} +% For credit play\IndexOpt{forcredit}. Enables a Jeopardy game to be handed in for credit. Adds security measures so +% student cannot cheat. Works best when the \texttt{pro} option is used. +% \begin{macrocode} +\DeclareOptionX{forcredit}{% + \let\jjImportForCreditCode\jj@ImportForCreditCode} +% \end{macrocode} +% The normal behavior\IndexOpt{allowpeeking} of the game is that if the contestant looks ahead at a question, +% then the tile on the game board corresponding to the question viewed is hidden. +% The contestant is not allowed to answer that question. Use \opt{allowpeeking} option to remove +% this feature of the game. +% \changes{v3.0c}{2007/10/29}{ +% Added the \texttt{allowpeeking} option} +% \begin{macrocode} +\DeclareOptionX{allowpeeking}{\jjnopeekingfalse} +\newif\ifjjnopeeking \jjnopeekingtrue +% \end{macrocode} +% \begin{macrocode} +\let\jjImportForCreditCode\relax +\def\jj@ImportForCreditCode{\@ifpackageloaded{aeb_pro} + {\InputIfFileExists{jjcredit.def} + {\ClassWarning{jj_game}{Inputting forcredit code} + \ClassWarningNoLine{jj_game}{Don't forget to use + \string\contestantName\MessageBreak + and \string\gameboardPrintButton}} + {\ClassWarning{jj_game}{Cannot find jjcredit.def}}} + {\ClassWarningNoLine{jj_game} + {The forcredit option requires the aeb_pro package}}} +% \end{macrocode} +% Several pre-defined designs are accessible through \IndexOpt{design}\opt{design} option. Design +% choices are \texttt{jeopardy}, \texttt{florida}, \texttt{iceland}, \texttt{hornet}, \texttt{qatar}, \texttt{norway}, +% \texttt{germany}, \texttt{bahamas}, \texttt{spain}. +% \begin{macrocode} +\let\jjg@madedesignselection0 +\define@choicekey+{jj_game.cls}{design}{jeopardy,florida,iceland,% + hornet,qatar,norway,germany,bahamas,spain,custom}{% + \ifx\jjg@madedesignselection0\def\jj@design@choice{#1}% + \AtEndOfClass{\jjInputDesignChoice}% + \global\let\jjg@madedesignselection1 + \def\jjg@useddesign{design}\else + \ClassWarning{jj_game}{Do not use both design + and customdesign\MessageBreak + at the same time.\MessageBreak + Using the \jjg@useddesign\space selection}\fi} +{\ClassWarning{jj_game}{Bad choice for design, permissible values + are jeopardy, florida, iceland, hornet, qatar, norway, % + germany, bahamas, spain. Try again}} +\def\jjInputDesignChoice{% + \InputIfFileExists{design_\jj@design@choice.def}% + {\ClassWarning{jj_game}{Inputting design choice \jj@design@choice}}% + {\ClassWarning{jj_game}{Cannot find the file + design_\jj@design@choice.def}}% +} +% \end{macrocode} +% Allow the user to create his own design\IndexOpt{customdesign}. The file \verb!design_\jj@design@choice.def! then is input. +% \begin{macrocode} +\define@key{jj_game.cls}{customdesign}{% + \ifx\jjg@madedesignselection0\def\jj@design@choice{#1}% + \AtEndOfClass{\jjInputDesignChoice}% + \global\let\jjg@madedesignselection1 + \def\jjg@useddesign{customdesign}\else + \ClassWarning{jj_game}{Do not use both design and customdesign + \MessageBreak at the same time.\MessageBreak + Using the \jjg@useddesign\space selection}\fi} +% \end{macrocode} +% When the \texttt{nodesigngraphics}\IndexOpt{nodesigngraphics} option is taken, +% the effects of the commands\medskip +%\begin{verbatim} +% \defineInstructionPageGraphic +% \defineGameboardPageGraphic +% \defineQuestionPagesGraphic +%\end{verbatim} +%are cancelled out. +% \begin{macrocode} +\DeclareOptionX{nodesigngraphics}{\let\jjgdesigngraphics\endinput} +\let\jjgdesigngraphics\relax +% \end{macrocode} +% Language \opt{lang}\IndexOpt{lang} option, languages supported are \texttt{english} and \texttt{german} options. +% \begin{macrocode} +\define@choicekey+{jj_game.cls}{lang}[\val\nr]{english,german} +{\xdef\jjLangOpt{\nr}}{\ClassWarning{jj_game} + {Bad choice for lang, permissible values are english and german. + Try again.}} +\def\jjLangOpt{0} +% \end{macrocode} +% +% Look for configuration file +% +% \begin{macrocode} +\ifpdf\ExecuteOptionsX{pdftex}\else + \ifxetex\ExecuteOptionsX{xetex}\else +% \end{macrocode} +% For backward compatibility, we \cs{let} \cs{ExecuteOptions} to +% \cs{ExecutedOptionsX}, saving and restoring as we go. +% \begin{macrocode} + \let\ExecuteOptions@SAVE\ExecuteOptions + \let\ExecuteOptions\ExecuteOptionsX + \InputIfFileExists{jj_game.cfg}{} + {\@ifundefined{l@tex@@@@driver}{\ExecuteOptionsX{dvips}} + {\ExecuteOptionsX{dvipsone}}}% + \let\ExecuteOptions\ExecuteOptions@SAVE + \fi\fi +% \end{macrocode} +% \subsection{Process Options} +% \begin{macrocode} +\ProcessOptionsX +% \end{macrocode} +% \section{Load the article class} +% We model the \pkg{jj\_game} class after the \pkg{article} class. +% \begin{macrocode} +\LoadClass{article}[2014/09/29] +% \end{macrocode} +% \section{Required Packages} +% We do not pass the driver options \texttt{pdftex}, \texttt{luatex}, or \texttt{xetex} to \pkg{web}, because that +% package detects these drivers as well. +% \begin{macrocode} +\edef\x{\noexpand + \RequirePackage[\jjgdriver,usetemplates,dvipsnames]{web}}\x +\RequirePackage[execJS]{eforms}[2016/08/29] +\RequirePackage{verbatim} +\RequirePackage{comment} +\RequirePackage{calc} +% \end{macrocode} +% If user has chosen the \texttt{final} option, we use hyperref to set the viewer window; +% otherwise we set \verb!\let\JJinitSetup\relax!. The user who is using +% \texttt{aeb\_pro} with \texttt{jj\_game} can use the extensive controls in that package. +% \begin{macrocode} +\iffinal + \def\JJinitSetup{% + \hypersetup{% + pdfmenubar=false, + pdftoolbar=false, + pdffitwindow=true, + pdfcenterwindow=true, + pdfwindowui=false% + } + } +\else + \let\JJinitSetup\relax +\fi +\AtEndOfClass{\JJinitSetup} +% \end{macrocode} +% Process the language option, the default is english +% \begin{macrocode} +\ifcase\jjLangOpt\relax + \includecomment{JJLangEnglish} + \excludecomment{JJLangGerman} +\or + \includecomment{JJLangGerman} + \excludecomment{JJLangEnglish} + \AtEndOfClass{\germanLocalization} +\fi +\@ifundefined{jjImportForCreditCode} + {\excludecomment{JJForCredit}} + {\includecomment{JJForCredit}} +% \end{macrocode} +% \cs{germanLocalization} consists of some definitions that specialize +% certain strings of \texttt{jj\_game}. +% \begin{macrocode} +\def\germanLocalization{% + \currencyHeading{\bfseries For~\EUR\theCurrencyAmt:}% + \correctText{Richtig!}\incorrectText{Falsch!}% + \def\jb@sepStyle{2}\def\jb@currStyle{0}% + \def\APScore@Currency@def{"\string\\u20ac"}% + \printButtonCaption{Drucken}% + \printButtonLabel{Diese Seite drucken}% + \contestantNameLabel{Student}% + \timestampLabel{Zeitstempel}% + \timeStampFormat{dd/mm/yy, H:MM:ss.}% + \enterNamePlease{Bitte geben Sie Ihren Namen auf + der ersten Seite ein, bevor Sie das Spiel beginnen!} + \def\jb@Score{"Punkte "} + \illegalAccessMsg{Sie haben gespickelt! Bitte w\string\344hlen + Sie erst eine Frage vom Spielbrett, bevor Sie umbl\string\344ttern - + diese Antwort wird nicht gewertet! \string\326ffnen Sie das + PDF erneut und spielen Sie dieses Mal ohne zu spickeln.} + \illegalAnswerTwiceMsg{\string\304ndern Ihrer Antwort + ist nicht erlaubt!} + +} +% \end{macrocode} +% Default color definitions for the Jeopardy game. These will be used +% if no colors are specified. +% \begin{macrocode} +\definecolor{defaultfillCells}{rgb}{0.98,0.92,0.73} +\def\defaultfillCells{defaultfillCells} +\definecolor{defaultfillBanner}{rgb}{0.5,0,0.5} +\def\defaultfillBanner{defaultfillBanner} +\definecolor{defaulttextBanner}{rgb}{1,1,0} % yellow +\def\defaulttextBanner{defaulttextBanner} +\definecolor{defaulttextBoard}{rgb}{1,1,0} % yellow +\def\defaulttextBoard{defaulttextBoard} +\definecolor{defaultfillInstructions}{rgb}{0.98,0.92,0.73} +\def\defaultfillInstructions{defaultfillInstructions} +\definecolor{defaultfillGameBoard}{rgb}{1,0.8,0.6} +\def\defaultfillGameBoard{defaultfillGameBoard} +\definecolor{defaultfillQuestions}{rgb}{1,0.8,0.6} +\def\defaultfillQuestions{defaultfillQuestions} +\def\defaultDollarColorAmt{blue} +\def\defaultLinkColor{webgreen} +\definecolor{jj_banner_bg}{named}{defaultfillBanner} +\definecolor{jj_banner_txt}{named}{defaulttextBanner} +\def\jj@transparent{transparent} +% \end{macrocode} +% \begin{macro}{\bannerTextFont} +% \begin{macro}{\titleBanner} +% Commands for defining the banner text and font. +% \begin{macrocode} +\newcommand{\bannerTextFont}{\sffamily\huge} +\def\bannerTextColor{\ifx\textBanner\jj@transparent + \else\color{\textBanner}\fi} +\def\titleBanner#1{\def\@titleBanner{#1}} +\titleBanner{You are the Winner!} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\insertJJTitleBanner} +% The title banner is displayed on the first page, the text of the first page +% is the content of the \texttt{instructions} environment. If you want more than +% one page of instructions, begin an new page with \cs{newpage}, then insert +% \cs{insertJJTitleBanner} to get the start up banner to appear. +% \begin{macrocode} +\def\insertJJTitleBanner{\newpage\jb@Banner{\@titleBanner}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\includeFootBanner} +% \begin{macro}{\authorURL} +% Use \cs{includeFootBanner} to get a matching banner at the foot of the first page. +% The banner contains the author's name and university. Use \cs{author} and \cs{university} +% from the web package to properly populate this command. Use it in the preamble. +% \begin{macrocode} +\newcommand{\includeFootBanner}{% + \renewcommand{\@oddfoot} + {% + \ifnum\thepage=1\relax + \colorbox{jj_banner_bg}{\makebox[\linewidth-2\fboxsep]{% + \href{\jjgauthorURL}% + {\textcolor{jj_banner_txt}{\webauthor\ \copyright\ \the\year}}% + \hfill\textcolor{jj_banner_txt}{\webuniversity}}}\else\hfil\fi + }% +} +\newcommand{\authorURL}[1]{\def\jjgauthorURL{#1}} +\authorURL{http://www.example.com} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \section{The Main Code} +% Much of the code below was adapted from the web package. +% \begin{macrocode} +\newdimen\jb@paperheight +\newdimen\jb@tmpdimb +\jb@paperheight=\paperheight +\newdimen\@Leftmargin \@Leftmargin=0cm +\newdimen\@Rightmargin \@Rightmargin=0cm +\newdimen\@Topmargin \@Topmargin=0in +\newdimen\@Bottommargin \@Bottommargin=0in +\parindent0pt +\setlength\headheight{0pt} +\setlength\headsep {0pt} +\setlength\footskip {0pt} +\hoffset=0pt +\voffset=0pt +\pagestyle{empty} +\def\InitLayout{% + \setlength{\textwidth}{\paperwidth} + \addtolength{\textwidth}{-\@Leftmargin} + \addtolength{\textwidth}{-\@Rightmargin} + \setlength{\textheight}{\paperheight} + \addtolength{\textheight}{-\@Topmargin} + \addtolength{\textheight}{-\@Bottommargin} + \addtolength{\textheight}{-\headheight} + \addtolength{\textheight}{-\headsep} + \addtolength{\textheight}{-\footskip} + \setlength{\oddsidemargin}{\@Leftmargin} + \addtolength{\oddsidemargin}{-1in} + \setlength{\evensidemargin}{\@Leftmargin} + \addtolength{\evensidemargin}{-1in} + \setlength{\topmargin}{\@Topmargin} + \addtolength{\topmargin}{-1in} + \setlength{\textscreenwidth}{\paperwidth} +} +\def\screensize#1#2{% + \paperheight=#1% + \paperwidth=#2 + \web@set@paper + \InitLayout +} +\def\marginsize#1#2#3#4{% + \@Leftmargin=#1 + \@Rightmargin=#2 + \@Topmargin=#3 + \@Bottommargin=#4 + \InitLayout +} +% \end{macrocode} +% The default margin size +% \begin{macrocode} +\marginsize{.25in}{.25in}{.25in}{.25in} +\newcount\rownum \rownum=1 % These registers keep track of the row and +\newcount\colnum \colnum=0 % column of the quizboard +\newcount\corMsgnum \corMsgnum=0 % These registers keep track of the +\newcount\errMsgnum \errMsgnum=0 % error messages +\newcount\jb@n +\newcount\jb@m +\newtoks\jb@rowtoks +\newcounter{newletter} +\newdimen\cellHeight \cellHeight=1in +\newdimen\cellWidth \cellWidth=.5in +\newdimen\tablewidth +\newdimen\tableheight +\newcount\numCategories \numCategories=5 +\newcount\numQuestions \numQuestions=5 +\newdimen\rulewidth \rulewidth=1bp +\newdimen\extraHeight \extraHeight=.2in +\newdimen\extraWidth \extraWidth=0pt +% \end{macrocode} +% Calculate the size of the screen page. +% \begin{macrocode} +\def\calcPaperSize{% +% \end{macrocode} +% Calculate paperwidth and \cs{tablewidth} +% \begin{macrocode} + \tablewidth=\numCategories\cellWidth + \advance\tablewidth by \rulewidth + \advance\tablewidth by \numCategories\rulewidth + \paperwidth=\tablewidth + \advance\paperwidth by\@Leftmargin % two times margin + \advance\paperwidth by\@Rightmargin % two times margin + \advance\paperwidth by2\extraWidth % need more width +% \end{macrocode} +% Calculate paperheight and \cs{tableheight} +% \begin{macrocode} + \tableheight=\numQuestions\cellHeight + \advance\tableheight by\cellHeight % banner + \advance\tableheight by2\rulewidth % two rules for banner + \advance\tableheight by\numQuestions\rulewidth + \paperheight=\tableheight + \advance\paperheight by\cellHeight % score + \advance\paperheight by\@Topmargin + \advance\paperheight by\@Bottommargin + \advance\paperheight by\topskip + \advance\paperheight by\extraHeight + \screensize{\paperheight}{\paperwidth} +} +\def\verbatimwrite{\bgroup\catcode``=0 \@bsphack + \let\do\@makeother\dospecials + \catcode`\^^M\active \catcode`\^^I=12 + \def\verbatim@processline{% + \immediate\write\verbatim@out + {\the\verbatim@line}}% + \verbatim@start} +\def\endverbatimwrite{\@esphack\egroup} +% \end{macrocode} +% \subsection{Create Design Commands} +% \begin{macrocode} +\def\jb@linkColor{\defaultLinkColor} +% \end{macrocode} +% \begin{macrocode} +\def\jj@setChoice#1#2{% this choice, default + \ifx#1\@empty#2\else#1\fi} +\def\jj@updateChoice#1#2{% this choice, current choice + \ifx#1\@empty\xdef#1{#2}\else\xdef#2{#1}\fi} +% \end{macrocode} +% \begin{macro}{\convertToSetKeys} +% We use the \textsf{xkeyval} package to parse the key, but we have a twist: The key-values are +% given in the form of object properties \texttt{<key>:<value>}. The command +% \cs{@convertColoniiEqual} does the work. The way \cs{convertToSetKeys} is used is +% is shown below: +%\begin{verbatim} +%\define@key{dps}{fname}{\def\dpsfname{#1}} +%\define@key{dps}{mname}{\def\dpsmname{#1}} +%\define@key{dps}{lname}{\def\dpslname{#1}} +%\def\setName#1{% +% \convertToSetKeys{dps}{#1}} +%... +%\setName { +% fname: D., +% mname: P., +% lname: Story +%} +%\end{verbatim} +% where \cs{setName} is some command, \texttt{\#1} is the name of the +% \textsf{xkeyval} family to be used, and \texttt{\#2} are the +% \texttt{<key>:<value>} pairs. +% \begin{macrocode} +\newtoks\jb@tmptoks \jb@tmptoks={} +\def\jjgdummy{dummy} +\def\convertToSetKeys#1#2{% + \def\thisxkvFamily{#1}\def\jjg@scratch{}\jb@tmptoks={}% + \@convertColoniiEqual#2,dummy:dummy,\@nil +} +\def\@convertColoniiEqual#1:#2,#3\@nil{% + \def\jj@rgii{#2}\ifx\jj@rgii\jjgdummy + \edef\jj@next{\noexpand\setkeys{\thisxkvFamily}{\the\jb@tmptoks}}% + \else\jb@tmptoks=\expandafter{\jjg@scratch,#1=#2}% + \edef\jjg@scratch{\the\jb@tmptoks}% + \def\jj@next{\@convertColoniiEqual#3\@nil}\fi\jj@next +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\DeclareColors} +% Macro to set the design parameters for LaTeX colors +% \begin{macrocode} +\define@key{declcolors}{fillCells}[\defaultfillCells]% + {\def\fillCells{#1}} +\define@key{declcolors}{fillBanner}[\defaultfillBanner]% + {\def\fillBanner{#1}} +\define@key{declcolors}{textBanner}[\defaulttextBanner]% + {\def\textBanner{#1}} +\define@key{declcolors}{textBoard}[\defaulttextBoard]% + {\def\textBoard{#1}} +\define@key{declcolors}{fillInstructions}[\defaultfillInstructions]% + {\def\fillInstructions{#1}} +\define@key{declcolors}{fillGameBoard}[\defaultfillGameBoard]% + {\def\fillGameBoard{#1}} +\define@key{declcolors}{fillQuestions}[\defaultfillQuestions]% + {\def\fillQuestions{#1}} +\define@key{declcolors}{dollarColor}[\defaultDollarColorAmt]% + {\def\dollarColor{#1}} +\define@key{declcolors}{linkColor}[\defaultLinkColor]% + {\def\@linkcolor{#1}} +\setkeys{declcolors}{fillCells,fillBanner,textBanner,textBoard,% + fillInstructions,fillGameBoard,fillQuestions,dollarColor,linkColor}% +\def\DeclareColors#1{\convertToSetKeys{declcolors}{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\APDollar} +% Macro to set the design parameters for the Dollar tile, this is the tile seen +% on the game board showing the monetary amounts of each question. The name of +% this tile is \verb!\the\rownum\the\colnum!, corresponding to the row and column +% position of the tile in the game board. +% \begin{macrocode} +\def\APDollar@Font@def{TiRo}\def\APDollar@Size@def{20} +\def\APDollar@TextColor@def{0 0 1}\def\APDollar@BorderColor@def{0 0 0} +\def\APDollar@FillColor@def{1 0.35 1} +\define@key{apdollar}{Font}[\APDollar@Font@def]{\def\APDollar@Font{#1}} +\define@key{apdollar}{Size}[\APDollar@Size@def]{\def\APDollar@Size{#1}} +\define@key{apdollar}{TextColor}[\APDollar@TextColor@def]% + {\def\APDollar@TextColor{#1}} +\define@key{apdollar}{BorderColor}[\APDollar@BorderColor@def]% + {\def\APDollar@BorderColor{#1}% + \ifx\APDollar@BorderColor\jj@transparent\gdef\APD@llarBorder{}\else + \xdef\APD@llarBorder{\APDollar@BorderColor}\fi +} +\define@key{apdollar}{FillColor}[\APDollar@FillColor@def]% + {\def\APDollar@FillColor{#1}% + \ifx\APDollar@FillColor\jj@transparent\gdef\APD@llarFill{}\else + \xdef\APD@llarFill{\APDollar@FillColor}\fi +} +\def\APD@llar{/\APDollar@Font\space\APDollar@Size\space Tf + \APDollar@TextColor\space rg} +\setkeys{apdollar}{Font,Size,TextColor,BorderColor,FillColor} +\def\APDollar#1{\convertToSetKeys{apdollar}{#1}} +\APDollar{} +% \end{macrocode} +% \end{macro} +% A crude euro symbol that can be typeset in \TeX. +% \begin{macrocode} +\newcommand\EUR{% +{\sffamily C% +\makebox[0pt][l]{\kern-.70em\mbox{--}% +}% +\makebox[0pt][l]{\kern-.68em\raisebox{.25ex}{--}}}\,% +} +% \end{macrocode} +% \begin{macro}{\APHidden} +% This collection of key-values set the appearance of the text field whose name +% is \texttt{GrandPoohbah}. It is a hidden text field above the game board +% extending across the list of categories. If the player attains the goal, +% the \texttt{GrandPoohbah} field becomes visible showing the \texttt{Champion} message. +% \begin{macrocode} +\def\APHidden@Font@def{TiRo}\def\APHidden@Size@def{20} +\def\APHidden@TextColor@def{0 0 1}\def\APHidden@BorderColor@def{0 0 0} +\def\APHidden@FillColor@def{0.98 0.92 0.73} +\def\Champion@def{You are a Champion!} +\define@key{aphidden}{Champion}[\Champion@def]{\def\jb@Champion{#1}} +\define@key{aphidden}{Font}[\APHidden@Font@def]{\def\APHidden@Font{#1}} +\define@key{aphidden}{Size}[\APHidden@Size@def]{\def\APHidden@Size{#1}} +\define@key{aphidden}{TextColor}[\APHidden@TextColor@def]% + {\def\APHidden@TextColor{#1}} +\define@key{aphidden}{BorderColor}[\APHidden@BorderColor@def]% + {\def\APHidden@BorderColor{#1}% + \ifx\APHidden@BorderColor\jj@transparent\gdef\APHidd@nBorder{}\else + \xdef\APHidd@nBorder{\APHidden@BorderColor}\fi +} +\define@key{aphidden}{FillColor}[\APHidden@FillColor@def]% + {\def\APHidden@FillColor{#1}% + \ifx\APHidden@FillColor\jj@transparent\gdef\APHidd@nFill{}\else + \xdef\APHidd@nFill{\APHidden@FillColor}\fi +} +\def\APHidd@n{/\APHidden@Font\space\APHidden@Size\space Tf + \APHidden@TextColor\space rg} +\setkeys{aphidden}{Champion,Font,Size,TextColor,BorderColor,FillColor} +\def\APHidden#1{\convertToSetKeys{aphidden}{#1}} +\APHidden{} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\APRight} +% Use this command to set the key-value pairs for the appearance of the push button +% whose name is \verb!\the\rownum\the\colnum R!. When the player answers the question +% correctly, this field, initially hidden, becomes visible with a message of congratulations, +% the default message is \texttt{Right!} +% \begin{macrocode} +\def\APRight@Font@def{TiRo}\def\APRight@Size@def{20} +\def\APRight@TextColor@def{0 0 1}\def\APRRight@Msg@def{Right!} +\def\correctText#1{\gdef\@APRightMsg{#1}}\correctText{Right!} +\define@key{apright}{Font}[\APRight@Font@def]{\def\APRight@Font{#1}} +\define@key{apright}{Size}[\APRight@Size@def]{\def\APRight@Size{#1}} +\define@key{apright}{TextColor}[\APRight@TextColor@def]% + {\def\@APRightTextColor{#1}} +\define@key{apright}{Message}[\APRRight@Msg@def]{\def\@APRightMsg{#1}} +\def\@APRight{/\APRight@Font\space\APRight@Size\space Tf + \@APRightTextColor\space rg}% +\setkeys{apright}{Font,Size,TextColor,Message} +\def\APRight#1{\convertToSetKeys{apright}{#1}} +\APRight{} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\APWrong} +% Use this command to set the key-value pairs for the appearance of the push button +% whose name is \verb!\the\rownum\the\colnum W!. When the player answers the question +% incorrectly, this field, initially hidden, becomes visible with a message, +% the default message is \texttt{Wrong!} +% \begin{macrocode} +\def\APWrong@Font@def{TiRo}\def\APWrong@Size@def{20} +\def\APWrong@TextColor@def{0 0 1}\def\APRWrong@Msg@def{Wrong!} +\def\incorrectText#1{\gdef\@APWrongMsg{#1}}\incorrectText{Wrong!} +\define@key{apwrong}{Font}[\APWrong@Font@def]{\def\APWrong@Font{#1}} +\define@key{apwrong}{Size}[\APWrong@Size@def]{\def\APWrong@Size{#1}} +\define@key{apwrong}{TextColor}[\APWrong@TextColor@def]% + {\def\@APWrongTextColor{#1}} +\define@key{apwrong}{Message}[\APRWrong@Msg@def]{\def\@APWrongMsg{#1}} +\def\@APWrong{/\APWrong@Font\space\APWrong@Size\space Tf + \@APWrongTextColor\space rg} +\setkeys{apwrong}{Font,Size,TextColor,Message} +\def\APWrong#1{\convertToSetKeys{apwrong}{#1}} +\APWrong{} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\GameDesign} +% Use this command to set the key-value pairs for designing the game board. Setting +% these values are required for each game. There are default values, but the key-values +% that are required to be filled is are \texttt{Cat}, and \texttt{NumQuestions}. The number of Cat entries +% determines the number of categories, and \texttt{NumQuestions} determines the number of questions +% in each category. +% \begin{macrocode} +\define@key{gamedesign}{Cat}{\global\advance\numCategories by1 + \jb@Cat#1,} +\define@key{gamedesign}{CellWidth}[1in]{\global\cellWidth=#1\relax} +\define@key{gamedesign}{CellHeight}[.5in]{\global\cellHeight=#1\relax} +\define@key{gamedesign}{NumQuestions}[5]{\global\numQuestions=#1\relax} +\define@key{gamedesign}{Goal}[3500]{\def\jb@Goal{#1}} +\define@key{gamedesign}{GoalPercentage}[0]{\def\jb@GoalPercentage{#1}} +\define@key{gamedesign}{ExtraHeight}[.2in]{\global\extraHeight=#1\relax} +\define@key{gamedesign}{ExtraWidth}[0pt]{\global\extraWidth=#1\relax} +\define@key{gamedesign}{Champion}[\Champion@def]{\def\jb@Champion{#1}} +\setkeys{gamedesign}{CellWidth,CellHeight,NumQuestions,Goal,% + GoalPercentage,ExtraHeight,ExtraWidth,Champion} +% \end{macrocode} +% Here is the code for \cs{GameDesign}, after gathering the key-value pairs for +% the \texttt{gamedesign} family. We set the \texttt{Goal} (if \texttt{GoalPercentage} is specified), +% then, based on the parameters, we calculate the page size for this game board. +% \begin{macrocode} +\def\GameDesign#1{\global\numCategories=0\relax + \convertToSetKeys{gamedesign}{#1}% + \ifdebug + \typeout{^^JClass jj_game Info:} + \typeout{Number of Categories: \the\numCategories} + \typeout{Number of Questions per Category: \the\numQuestions^^J} + \fi +% \end{macrocode} +%\begin{verbatim} +% Let n = numQuestions, m = numCategories +% 100*n*(n+1)/2 = 50*n*(n+1) = total for one category +% 50*m*n*(n+1) = total money; +% 100*m*n*(n+1) = total money for double jeopardy +%\end{verbatim} +% \begin{macrocode} + \jb@n = \numQuestions + \advance\jb@n by 1 + \multiply\jb@n by\numQuestions + \multiply\jb@n by50 % total money/category + \multiply\jb@n by\numCategories % total money + \ifdouble + \multiply\jb@n by2 % total money, double jj + \fi + \ifdebug + \typeout{Total Money: \the\jb@n} + \fi + % See if GoalPercentage differs from the default value + \xdef\jb@tmp{\csname 0\endcsname}% + \xdef\jb@temp{\csname\jb@GoalPercentage\endcsname}% + \ifx\jb@tmp\jb@temp + \else + \ifdebug + \typeout{Goal Percentage Specified: \jb@GoalPercentage} + \fi + \multiply\jb@n by\jb@GoalPercentage + \divide\jb@n by100 + \def\jb@Goal{\the\jb@n} + \fi + \xdef\Goal{\jb@Goal} + \ifdebug + \typeout{Goal: \Goal^^J} + \fi + \calcPaperSize + \jjCancelOutAeBProCatalog + \jjImportForCreditCode +} +\def\jjCancelOutAeBProCatalog{\iffinal\let\aeb@SetCatalog\@empty\fi} +\def\jb@Cat{\@ifnextchar[{\jb@item}{\jb@item[] }}% +\gdef\jb@item[#1]#2,{% + \expandafter\gdef\csname Category\the\numCategories\endcsname + {\forpbx{#1#2}}% + \expandafter\gdef\csname category\the\numCategories\endcsname{#2}% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\APScore} +% The \cs{APScore} command sets the key-value pairs for designing the score board. There +% are three score boards: for a single player, the name of the field is \texttt{Total}; +% for the two player game, the names of the fields are \texttt{Total0} and \texttt{Total1}. +% \begin{macrocode} +\def\jb@Score{""} +\def\jb@align@left{l} +\def\jb@align@center{c} +\def\jb@align@right{r} +\def\APScore@Font@def{TiRo} +\def\APScore@Size@def{20} +\def\APScore@TextColor@def{0 0 1} +\def\APScore@BorderColor@def{0 0 0} +\def\APScore@FillColor@def{0.98 0.92 0.73} +\def\APScore@CellHeight@def{\the\cellHeight} +\def\APScore@CellWidth@def{\the\cellWidth} +\def\APScore@AutoPlacement@def{true} +\def\APScore@Score@def{""} +\def\APScore@Currency@def{""} +\def\APScore@align@def{r} +\def\jb@align{r} +% +% twoplayer properties +% +\def\APScore@tp@ScaledCellWidth@def{.5} +\let\APScore@tp@ScaledCellWidth\@empty +\def\APScore@tp@HighlightBorderColor@def{1 0 0} +% +\define@key{apscore}{Font}[\APScore@Font@def]{\def\APScore@Font{#1}} +\define@key{apscore}{Size}[\APScore@Size@def]{\def\APScore@Size{#1}} +\define@key{apscore}{TextColor}[\APScore@TextColor@def]% + {\def\APScore@TextColor{#1}} +\define@key{apscore}{BorderColor}[\APScore@BorderColor@def]% + {\def\APScore@BorderColor{#1}% + \ifx\APScore@BorderColor\jj@transparent\gdef\@APScoreBorder{}\else + \xdef\@APScoreBorder{\APScore@BorderColor}\fi +} +\define@key{apscore}{FillColor}[\APScore@FillColor@def]% + {\def\APScore@FillColor{#1}% + \ifx\APScore@FillColor\jj@transparent\gdef\@APScoreFill{}\else + \xdef\@APScoreFill{\APScore@FillColor}\fi +} +\define@key{apscore}{CellHeight}[\APScore@CellHeight@def]% + {\def\@APScorecellHeight{#1}} +\define@key{apscore}{CellWidth}[\APScore@CellWidth@def]% + {\def\@APScorecellWidth{#1}} +\define@boolkey{apscore}{AutoPlacement}[true]{} +\define@key{apscore}{Score}[\APScore@Score@def]{\def\jb@Score{#1}} +\define@key{apscore}{Currency}[\APScore@Currency@def]% + {\def\jb@Currency{#1}} +\define@key{apscore}{align}[\APScore@align@def]{\def\jb@align{#1}} +% +% twoplayer properties +% +\define@key{apscore}{tpScaledCellWidth}% + [\APScore@tp@ScaledCellWidth@def]% + {\def\@APtpScaledCellWidth{#1}} +\define@key{apscore}{tpHighlightBorderColor} + [\APScore@tp@HighlightBorderColor@def]% + {\def\@APtpHighlightBorderColor{#1}} +\def\@APScore{/\APScore@Font\space\APScore@Size\space Tf + \APScore@TextColor\space rg}% +% +\setkeys{apscore}{Font,Size,TextColor,BorderColor,FillColor,% + CellHeight,CellWidth,AutoPlacement,Score,Currency,align,% + tpScaledCellWidth,tpHighlightBorderColor} +% +\def\APScore#1{\convertToSetKeys{apscore}{#1}% + \ifKV@apscore@AutoPlacement + \gdef\@PlaceScoreBoard{\@@PlaceScoreBoard} + \gdef\PlaceScoreBoard##1{% + \message{^^J\expandafter\string\csname APScore\endcsname: + `AutoPlacement: true', the use of \string\PlaceScoreBoard\space + is not valid in this case!^^J^^J}}% + \else + \gdef\@PlaceScoreBoard{\@@@PlaceScoreBoard\@gobble}% + \fi + \gdef\jb@Quad{2}% + \ifx\jb@align\jb@align@left\gdef\jb@Quad{0}% + \else\ifx\jb@align\jb@align@center\gdef\jb@Quad{1}% + \else\ifx\jb@align\jb@align@right\gdef\jb@Quad{2}% + \fi\fi\fi +} +\APScore{} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\PlaceScoreBoard} +% A command for the user to place the location of the score board. +% \begin{macrocode} +\def\@@PlaceScoreBoard#1{#1} +\long\def\PlaceScoreBoard#1{\def\@@@PlaceScoreBoard{#1}} +\PlaceScoreBoard{{\centering\vbox{\ScoreBoard}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\setTwoPlayerOptions} +% The following are key-value definitions for the two player game +% \begin{macrocode} +\define@key{twoplayerKeys}{player1}[Player 1]{\def\jjg@playeri{#1}} +\define@key{twoplayerKeys}{player2}[Player 2]{\def\jjg@playerii{#1}} +\define@key{twoplayerKeys}{playerFmt}[\sffamily\small]% + {\def\jjg@playerFmt{#1}} +\define@boolkey{twoplayerKeys}{checkbox}[true]{} +\setkeys{twoplayerKeys}{player1,player2,playerFmt,checkbox} +\newcommand{\setTwoPlayerOptions}[1]{% + \convertToSetKeys{twoplayerKeys}{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\def\Rect#1{\pdf@rect{\textcolor{\@linkcolor}{#1}}} +\def\({\noexpand\(}\def\){\noexpand\)} +\def\Bbox#1#2{% + \vbox to#2{\hbox to#1{\hfill}\vfill}% +} +\def\hmark#1{\hypertarget{#1}{}} +% \end{macrocode} +% \begin{macro}{\bannerTextControl} +% Use \cs{bannerTextControl} to tweak the positioning of the banner text. +% \begin{macrocode} +\newcommand{\bannerTextControl}[1]{#1} +% \end{macrocode} +% \end{macro} +% Construct the running banners +% \begin{macrocode} +\def\jb@Banner#1{\vspace*{-\topskip}\hbox{\rlap{\ifx\fillBanner + \jj@transparent\else\color{\fillBanner}\fi + \setbox0=\hbox{\bannerTextFont\strut}\jb@tmpdimb=\ht0 + \advance\jb@tmpdimb by6pt \jb@tmpdima=\dp0 \advance\jb@tmpdima by4pt + {\ifx\fillBanner\jj@transparent\else + \vrule height\jb@tmpdimb depth\jb@tmpdima width\textwidth\fi}}% + \vbox{\noindent\centering\bannerTextFont\bannerTextColor% + \strut\bannerTextControl{#1}}}\bigskip} +% \end{macrocode} +% +% \subsection{Construct form fields} +% This appearance is the opening face. Show dollar amounts. Clicking +% jumps to the corresponding question. +% \begin{macrocode} +\def\dollarAP{% +{\ifdouble\advance\rownum by\rownum\fi\xdef\@dollarAmt{\the\rownum00}}% +\rlap{\pushButton[% + \H{P}\W{1}\S{S}\DA{\APD@llar}\BC{\APD@llarBorder} + \BG{\APD@llarFill}\CA{\@dollarAmt} + \A{/S/GoTo/D (Q\the\rownum\the\colnum) \jjAdditionalCellJSActions} +]{\the\rownum\the\colnum}{\cellWidth}{\cellHeight}}} +% \end{macrocode} +% This appearance simply says Right! It appears if the user answers the +% question correctly. +% \begin{macrocode} +\def\rightAP{\rlap{\efKern{0pt}{1bp}\pushButton[% + \F{\FHidden}\H{N}\S{S}\BG{}\DA{\@APRight}\CA{\@APRightMsg} +]{\the\rownum\the\colnum R}{\cellWidth}{\cellHeight}}} +% \end{macrocode} +% This appearance simply says Wrong! It appears if the user answers the +% question incorrectly. +% \begin{macrocode} +\def\wrongAP{\rlap{\efKern{0pt}{2bp}\pushButton[% + \F{\FHidden}\H{N}\S{S}\BG{}\DA{\@APWrong}\CA{\@APWrongMsg} +]{\the\rownum\the\colnum W}{\cellWidth}{\cellHeight}}} +% \end{macrocode} +% \begin{macrocode} +\def\jb@nDec{0} +\def\jb@sepStyle{0} +\def\jb@negStyle{0} +\def\jb@currStyle{2} +\def\jb@Currency{""} +\def\jb@bCurrencyPrepend{true} +% \end{macrocode} +% \begin{macro}{\prependCurrency} +% \begin{macro}{\appendCurrency} +% Use these to prepend, the default, or append a currency symbol, if any. These +% will appear in the \cs{ScoreBoard}. +% \begin{macrocode} +\newcommand{\prependCurrency}{\def\jb@bCurrencyPrepend{true}} +\newcommand{\appendCurrency}{\def\jb@bCurrencyPrepend{false}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\ScoreBoard} +% This is the text field for the score board. In two player mode, there are +% two score boards, and in single player mode, there is only one. +% \begin{macrocode} +\def\AAVAction{event.target.textColor = event.value < 0 ? + "RGB \@APWrongTextColor".split(" ") : + "RGB \@APRightTextColor".split(" ");\r + this.dirty=false;} +\def\AAFAction{AFNumber_Format\(\jb@nDec, \jb@sepStyle, \jb@negStyle, + \jb@currStyle, \jb@Currency, \jb@bCurrencyPrepend\); + event.value = \jb@Score\space + event.value;\r + this.dirty=false;} +\let\jjgplayerihook\@empty +\let\jjgplayeriihook\@empty +\def\ScoreBoard{\ifjjgtwoplayer +\setlength{\@tempdima}{\@APScorecellWidth}% +\setlength{\@tempdima}{% + (\@APScorecellWidth)*\ratio{\@APtpScaledCellWidth\space pt}{1pt}}% +\ifdim\@tempdima<\cellWidth +\@tempdima=\cellWidth\fi + \edef\BboxWidth{\the\@tempdima}% +\setlength{\@tempdima}{\@APScorecellHeight/2-4bp}% + \edef\BboxHeight{\the\@tempdima}% +\ifKV@twoplayerKeys@checkbox +\raisebox{\BboxHeight}{\checkBox[\Ff{\FfReadOnly}% + \textColor{\@APtpHighlightBorderColor\space rg}\BC{}% + \symbolchoice{circle}]{ckboxPlayer0}{10bp}{10bp}{On}}\fi\space +\parbox[t]{\BboxWidth\ifxetex+4bp\fi}{\jjgplayerihook +\textField[% + \H{N}\Q{\jb@Quad}\W{3}\S{I}\BC{\@APScoreBorder}\BG{\@APScoreFill}% + \DA{\@APScore}\autoCenter{n}\AA{\AAValidate{\AAVAction}% + \AAFormat{\AAFAction}}]{Total0}{\BboxWidth\ifxetex-4bp\fi}% + {\@APScorecellHeight\ifxetex-4bp\fi}\\[-3pt] +\makebox[\linewidth][c]{\jjg@playerFmt\jjg@playeri}}\efKern{3pt}{0bp}\space +\parbox[t]{\BboxWidth\ifxetex+4bp\fi}{% +\textField[% + \H{N}\Q{\jb@Quad}\W{3}\S{I}\BC{\@APScoreBorder}\BG{\@APScoreFill}% + \DA{\@APScore}\autoCenter{n}\AA{\AAValidate{\AAVAction}% + \AAFormat{\AAFAction}}% +]{Total1}{\BboxWidth\ifxetex-4bp\fi}% + {\@APScorecellHeight\ifxetex-4bp\fi}\jjgplayeriihook\\[-3pt] +\makebox[\linewidth][c]{\jjg@playerFmt\jjg@playerii}} +\ifKV@twoplayerKeys@checkbox +\raisebox{\BboxHeight}{\checkBox[\Ff{\FfReadOnly}% + \textColor{\@APtpHighlightBorderColor\space rg}\BC{}% + \symbolchoice{circle}]{ckboxPlayer1}{10bp}{10bp}{On}}\fi +\else\efKern{0pt}{-3bp}\textField[% + \H{N}\Q{\jb@Quad}\W{3}\S{I}\BC{\@APScoreBorder}% + \BG{\@APScoreFill}\DA{\@APScore}\autoCenter{n}% + \AA{\AAValidate{\AAVAction}\AAFormat{\AAFAction}}% +]{Total}{\@APScorecellWidth\ifxetex-4bp\fi}% + {\@APScorecellHeight\ifxetex-4bp\fi}% +\fi} +% \end{macrocode} +% \end{macro} +% The pdf contents of a number rectangle: Three widgets superimposed +% \begin{macrocode} +\def\cell{\global\advance\colnum1 \ifnum\colnum>\numCategories + \global\colnum=1 \global\advance\rownum1 \fi + \moveleft.5\cellWidth\hbox{\efKern{0pt}{-1bp}\dollarAP + \efKern{0pt}{-1bp}\rightAP\efKern{0pt}{-1bp}\wrongAP}}% +% \end{macrocode} +% This provides the background color behind the banner +% \begin{macrocode} +\def\bgb{\ifxetex\rule{0pt}{\cellHeight+.6bp}\smash{\PoohBahBanner}\else + \PoohBahBanner\fi\smash{\rlap{\ifx\fillBanner\jj@transparent\else + \ifxetex\setlength{\tablewidth}{\tablewidth}% + \setlength{\cellHeight}{\cellHeight\ifxetex+.4pt\fi}\fi + \color{\fillBanner}{\vrule width\tablewidth height\cellHeight}\fi}}} +% \end{macrocode} +% This provides the background color behind the number board. +% \begin{macrocode} +\def\bgc{\smash{\rlap{{\ifx\fillCells\jj@transparent\else + \color{\fillCells}\vrule width\tablewidth height\cellHeight\fi}}}} +% \end{macrocode} +% The hidden banner set by \cs{APHidden} with the final message for the +% contestant attaining the goal. +% \begin{macrocode} +\def\PoohBahBanner{\rlap{\ifxetex\advance\tablewidth-6bp\else + \advance\tablewidth-2bp\hskip1bp\fi +\textField[% + \Q{1}\autoCenter{n}\F{\FHidden}\W{3}\S{I}\BC{\APHidd@nBorder}% + \BG{\APHidd@nFill}\DA{\APHidd@n}% + \DV{\jb@Champion}\V{\jb@Champion}% +]{GrandPoohbah}{\tablewidth}{\cellHeight}}} +% \end{macrocode} +% \begin{macrocode} +\def\forpbx#1{\vbox to\cellHeight{% + \hsize=\cellWidth\centering\vfill\strut\ifx\textBoard\jj@transparent + \else\color{\textBoard}\fi#1\strut\vfill}} +\def\gameCategories{% + \jb@n=0 + \jb@rowtoks={\bgb}% + \loop\ifnum\jb@n<\numCategories\advance\jb@n by1 + \jb@tmptoks=\expandafter{% + \expandafter&\csname Category\the\jb@n\endcsname&}% + \edef\jb@temp{\the\jb@rowtoks\the\jb@tmptoks}% + \jb@rowtoks=\expandafter{\jb@temp}% + \repeat + \edef\jb@temp{\the\jb@rowtoks}% + \jb@rowtoks=\expandafter{\jb@temp\cr\\ }% +\the\jb@rowtoks} + +% Hack a loop structure so I can do a double loop +\long\def\oloop #1\orepeat{% + \def\oiterate{#1\relax % Extra \relax + \expandafter\oiterate\fi}% + \oiterate + \let\outeriterate\relax +} +\let\orepeat=\fi +% \end{macrocode} +% \begin{macrocode} +\def\gamebody{% + \jb@rowtoks={}% + \jb@m=\numQuestions + \edef\jb@temp{}% + \oloop\advance\jb@m-1\ifnum\jb@m>0 + \getrow + \orepeat + \the\jb@rowtoks} +% \end{macrocode} +% \begin{macrocode} +\def\getrow{% + \jb@n=\numCategories + \edef\jb@temp{\the\jb@rowtoks}% + \jb@rowtoks=\expandafter{\jb@temp\bgc}% + \loop\advance\jb@n-1\ifnum\jb@n>0 + \edef\jb@temp{\the\jb@rowtoks}% + \jb@rowtoks=\expandafter{\jb@temp&\cell&}% + \repeat + \edef\jb@temp{\the\jb@rowtoks}% + \jb@rowtoks=\expandafter{\jb@temp\cr\\ }% +} +% \end{macrocode} +% \subsection{Construct Game Board} +% The \cs{GameBoard} is as the name suggests is the game board. We set up a +% tabular environment, then insert the \cs{gameCategories}, followed by +% the \cs{gamebody}. +% \begin{macrocode} +\def\GameBoard{\vspace*{-\topskip}% +\begingroup + % set up \halign environment + \tabskip0pt\offinterlineskip\parskip0pt\parindent0pt + \def\\{\noalign{\hrule height\rulewidth}}% + \hbox to\textwidth\bgroup\hfill + \vbox\bgroup\hsize=\tablewidth\hmark{GameBoard}% + \halign{##\vrule width\rulewidth + &&\hbox to\cellWidth{\hss\vbox to\cellHeight{\vss##\vss}\hss}% + &\vrule width\rulewidth##\cr\noalign{\hrule height\rulewidth}% + % Begin entering data into the different cells + \gameCategories + \gamebody + }% + \egroup\hfill + \egroup +\endgroup\ifxetex\ifjjgtwoplayer\kern-1bp\else + \kern2bp\fi\fi +% \end{macrocode} +% Insert ScoreBoard +% \begin{macrocode} +\@PlaceScoreBoard{{\centering\vbox{\ScoreBoard}}}% +\par\JJ@afterGameBoardInsertion} +\let\JJ@afterGameBoardInsertion\@empty +% \end{macrocode} +% \begin{macro}{\afterGameBoardInsertion} +% Use this command to insert material below the score board (hence below the game board). +% \begin{macrocode} +\newcommand{\afterGameBoardInsertion}[1]{% + \def\JJ@afterGameBoardInsertion{#1}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Begin Asking Questions} +% +% \begin{environment}{instructions} +% The Instructions on first page. +% \begin{macrocode} +\def\instructions +{% + \instructionPageTemplate + \ifx\fillInstructions\jj@transparent\else + \textBgColor{\fillInstructions}\fi + \jb@Banner{\@titleBanner}\par\parskip6pt +} +\def\endinstructions{\newpage} +% \end{macrocode} +% \end{environment} +% \begin{macrocode} +\let\Question\relax +% \end{macrocode} +% \begin{environment}{Questions} +% The \texttt{Questions} environment contains the \texttt{Category} environment +% which, in turn, contains the \texttt{Questions} environments. +% \begin{macrocode} +\def\Questions{\newpage\parskip0pt\relax\global\jb@n=0\relax + \gameboardPageTemplate + \ifx\fillGameBoard\jj@transparent\else + \textBgColor{\fillGameBoard}\fi\GameBoard + \newpage\ifx\fillQuestions\jj@transparent\else + \textBgColor{\fillQuestions}\fi + \rownum=0 \colnum=1 % initialize counters + \questionPagesTemplate +} +\def\endQuestions{% + \ifnum\jb@n=\numCategories\else + \typeout{Number of categories is not correct!} + \fi + \newpage} +% \end{macrocode} +% \end{environment} +% \begin{environment}{Category} +% The \texttt{Category} environment is nested within the \texttt{Questions} environment. +% \begin{macrocode} +\def\Category#1{ + \def\currentCategory{#1}\global\advance\jb@n by1 \global\jb@m=0 + \ifdebug + \typeout{^^JBegin Processing Category \the\jb@n: \currentCategory} + \typeout{If '\currentCategory' is different from} + \typeout{'\csname category\the\jb@n\endcsname', + then your categories are out of order!} + \fi} +\def\endCategory{ + \ifdebug + \ifnum\jb@m=\numQuestions + \else + \typeout{In the '\currentCategory' category, + the number of questions is not correct!} + \fi + \typeout{End Processing Category \the\jb@n: + \the\jb@m\space of \the\numQuestions\space Questions} + \fi +} +% \end{macrocode} +% \end{environment} +% \begin{macrocode} +\let\jjAdditionalJSActions\@empty +\def\jjAdditionalCellJSActions{\Next{\JS{% + var pushCell\the\rownum\the\colnum = true;\r + makeNameReadOnly();}}} +\let\bJJGInsertLayer\@empty +\let\eJJGInsertLayer\@empty +% \end{macrocode} +% \begin{macro}{\theCurrencyAmt} +% \begin{macrocode} +\def\theCurrencyAmt{{\count0=\the\rownum00\relax + \multiply\count0by\scaleFactor\relax\the\count0\relax}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\aboveCurrencySkip} +% \begin{macrocode} +\def\aboveCurrencySkip#1{\def\jj@aboveCurrencySkip{#1}} +\aboveCurrencySkip{0pt} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\currencyHeading} +% \begin{macrocode} +\newcommand{\currencyHeading}[1]{\def\jj@currencyHeading{#1}} +\currencyHeading{\bfseries For~\$\theCurrencyAmt:} +% \end{macrocode} +% \end{macro} +% \begin{environment}{Question} +% The environment for posing a question. It must appear within a \texttt{Category} environment. +% \begin{macrocode} +\def\Question{\newpage\global\advance\jb@m by1 + \global\advance\rownum1 \ifnum\rownum>\numQuestions \global\rownum=1 + \global\advance\colnum1 \fi + \global\advance\corMsgnum1 \ifnum\corMsgnum=8 \global\corMsgnum=1 \fi + \edef\peekingOpenAction{\ifjjnopeeking/H true/S/Hide% + /T (\the\rownum\the\colnum)\else\JS{;}\fi}% + \ifcase\thejjgdriver + \immediate\pdfobj{<< /O << + \peekingOpenAction\space\jjAdditionalJSActions >> >> } + \edef\ThisPage{/AA \the\pdflastobj\space 0 R} + \global\pdfpageattr=\expandafter{\ThisPage}% + \or + \literalps@out{% + [ {ThisPage} << /AA << /O << + \peekingOpenAction\space\jjAdditionalJSActions >> >> >> + /PUT pdfmark}% + \or + \@pdfm@mark{put @thispage << /AA << /O << + \peekingOpenAction\space\jjAdditionalJSActions >> >> >>}% + \fi + \jb@Banner{\csname category\the\colnum\endcsname}% + \begingroup + \vskip\jj@aboveCurrencySkip + \parskip2pt + \setcounter{newletter}{0}% + \hmark{Q\the\rownum\the\colnum}\bJJGInsertLayer% + \@ifnextchar[% + {\let\Ans\Question@tabular\def\endQuestion{\end{tabular}% + \eJJGInsertLayer\endgroup\newpage}\getBracArg}% + {\let\Ans\Question@list\def\jb@numCols{1}\gdef\aeb@numCols{1}% + \noindent\textcolor{\dollarColor}{\jj@currencyHeading}\space + \ignorespaces% + \def\endQuestion{\end{list}\eJJGInsertLayer\endgroup\newpage}}% +} +% \end{macrocode} +% \end{environment} +% \begin{macrocode} +\def\getBracArg[#1]{\def\jb@numCols{#1}\gdef\aeb@numCols{#1}\noindent% + \textcolor{\dollarColor}{\jj@currencyHeading}\space\ignorespaces} +% \end{macrocode} +% \cs{jjgtmplength} is a scratch length register that can be used to calculate lengths. +% \begin{macrocode} +\newlength{\jjgtmplength} +% \end{macrocode} +% \begin{macrocode} +\newlength\jb@width \settowidth{\jb@width}{\normalfont(d)} +\newdimen\jb@tmpdima +\newlength\jb@tmplength +\providecommand\PBS[1]{\let\jb@temp=\\#1\let\\=\jb@temp} +\def\makelink#1{% +\setLink[\A{\JS{qbrespond(#1,\the\rownum,\the\colnum);} + \Next{/S/GoTo/D (GameBoard)}} + ]{\makebox[\jb@width]{\normalfont(\hfil\alph{newletter}\hfil)\hfill}}} +% \end{macrocode} +% \begin{macro}{\setMClabelsep} +% \changes{v3.0}{2006/18/06} +% { +% Added control over the separation between the MC label and subsequent text: +% \cs{setMClabelsep} and \cs{resetMClabelsep}. +% } +% \begin{macro}{\resetMClabelsep} +% \begin{macro}{\eq@hspanner} +% \begin{macro}{\eq@hspanner@default} +% Added control over the separation between the MC label and subsequent text: +% \cs{setMClabelsep} and \cs{resetMClabelsep}. +% \begin{macrocode} +\def\eq@hspanner{\ } +\def\eq@hspanner@default{\ } +\def\eq@lw@l{\eq@l@l\eq@hspanner} +\def\setMClabelsep#1{\def\eq@hspanner{#1}} +\def\resetMClabelsep{\let\eq@hspanner\eq@hspanner@default} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macrocode} +\newskip\aboveanswersSkip +\setlength\aboveanswersSkip{3pt} +\def\Question@list{\vskip\aboveanswersSkip +\begin{list}{}% +{\usecounter{newletter} + \let\Ans=\JJ@Ans@list + \settowidth{\jb@tmplength}{\normalfont(d)}% + \settowidth{\labelwidth}{\normalfont(d)\eq@hspanner}% + \setlength{\parsep}{0pt}\setlength{\itemindent}{0pt}% + \setlength{\listparindent}{\parindent}% + \setlength{\leftmargin}{\labelwidth}% + \setlength{\labelsep}{0pt}% +}\Ans}% +\def\JJ@Ans@list#1{\stepcounter{newletter}\item[\makelink{#1}\hfill]}% + +\def\Question@tabular{% + \vskip\aboveanswersSkip + \setcounter{newletter}{0}% + \let\Ans=\JJ@Ans@tabular + \jb@tmpdima=\linewidth \divide\jb@tmpdima by\jb@numCols + \vskip\partopsep + \noindent\normalbaselines\tabcolsep=0pt + \begin{tabular}{*{\jb@numCols}{p{\jb@tmpdima}}}% +\Ans} +\def\JJ@Ans@tabular#1{\leavevmode\stepcounter{newletter}% + \PBS\raggedright + \settowidth{\jb@tmplength}{\normalfont(d)\eq@hspanner}% + \hangindent=\jb@tmplength\hangafter=1 % + \makelink{#1}\eq@hspanner\ignorespaces +} +% \end{macrocode} +% \begin{environment}{oAnswer} +% If \textsf{exerquiz} is input, then you can pose fill in questions. Enclose +% the standard exerquiz fill in commands \cs{RespBoxMath} and \cs{RespBoxTxt} +% \begin{macrocode} +\newenvironment{oAnswer} +{% + \gdef\oField{oQ\the\rownum\the\colnum}% + \gdef\curr@quiz{oQ\the\rownum\the\colnum}% + \def\currQuiz{oQ\the\rownum\the\colnum}% + \let\@qzsolndest\@empty + \stepcounter{questionno}% + \let\eqQuizType=s\gdef\eqPTs{1}\global\let\eqQT=\eq@na + \let\solution=\solution@sq + \let\endsolution=\endsolution@sq + \global\let\Ans=\Question@list +% \end{macrocode} +% \changes{v3.1}{2016/11/23}{Added \string\cs{sq@IDTxtField} to conform to new exerquiz standards} +% (2016/11/23) Added \cs{sq@IDTxtField} to conform to new \textsf{exerquiz} standards. +% \begin{macrocode} + \gdef\endQuestion{\endgroup\newpage}\sq@IDTxtField +}{} +% \end{macrocode} +% \end{environment} +% We need to redefine the action of \cs{RespBoxMath} and \cs{RespBoxTxt} so they behave like you +% would expect with \texttt{jj\_game}. +% \begin{macrocode} +\def\JJ@@RespBoxMathActions +{% + \AA{\AAKeystroke{if(event.willCommit) {\r\t + var retn = \processJSfunc(\rbArgs,\compareJSfunc);\r + if ( retn != null ) {\r\t + qbrespond(retn,\the\rownum,\the\colnum)\r\t + this.gotoNamedDest("GameBoard");\r + } + }}% + \AAFormat{\eqFormatArg}% + \AAOnFocus{\JS{var retn = null;}}% + } +} +\def\JJ@@RespBoxTxtActions +{% + \AA{\AAKeystroke{if(event.willCommit) {\r\t + retn = ProcRespTxt(\rbTxtAlt);\r + if ( retn != null ) {\r\t + qbrespond(retn,\the\rownum,\the\colnum)\r\t + this.gotoNamedDest("GameBoard");\r + } + }}% + \AAOnFocus{\JS{var retn = null;}} + }% +} +\def\redefineRespBoxActions{% + \let\@@RespBoxMathActions\JJ@@RespBoxMathActions + \let\@@RespBoxTxtActions\JJ@@RespBoxTxtActions} +% \end{macrocode} +% \begin{macro}{\gameboardPrintButton} +% \begin{macro}{\printButtonEOL} +% \begin{macro}{\printButtonCaption} +% \begin{macro}{\printButtonLabel} +% \begin{macro}{\contestantNameLabel} +% \begin{macro}{\timestampLabel} +% We define a button to print the game board page, and a lot of +% helper commands that allow the author to this button field. +% \begin{macrocode} +\newcommand{\printButtonCaption}[1]{\def\jj@printButtonCaption{#1}} +\printButtonCaption{Print} +\newcommand{\printButtonLabel}[1]{\def\jj@printButtonLabel{#1}} +\printButtonLabel{Print this page:} +\newcommand{\contestantNameLabel}[1]{\def\jjg@contestantNameLabel{#1}} +\contestantNameLabel{Student:} +\newcommand{\timestampLabel}[1]{\def\jjg@timestampLabel{#1}} +\timestampLabel{Time stamp:} +\newcommand{\printButtonEOL}[1]{\def\jjg@printButtonEOL{#1}} +\printButtonEOL{\\[1ex]} +\newcommand{\gameboardPrintButton}[1][] +{% + \jj@printButtonLabel\space\pushButton[\CA{\jj@printButtonCaption} + \A{\JS{% + var pp = this.getPrintParams();\r + pp.firstPage=this.pageNum;\r + pp.lastPage=this.pageNum;\r + pp.pageHandling = pp.constants.handling.shrink;\r + var fv = pp.constants.flagValues;\r + pp.flags |= (fv.suppressCenter | fv.suppressRotate);\r + this.print(pp);}}#1]{printit}{}{11bp}\quad + \jjg@contestantNameLabel\space\textField[\BC{}\Ff\FfReadOnly + ]{jjContestantNameprint}{1.5in}{11bp}\jjg@printButtonEOL + \jjg@timestampLabel\space\textField[\BC{}\Ff\FfReadOnly + ]{timestamp}{1.5in}{11bp}% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\contestantName} +% A convenience macro that can be used to enter the contestant's name. +% \begin{macrocode} +\newcommand{\contestantName}[3][\BC{}\AA{\AAKeystroke{% + if ( event.willCommit ) {\r\t + var f = this.getField("jjContestantNameprint");\r\t + if ( f != null ) f.value = event.value;\r + } + }}]{\textField[#1]{jjContestantName}{#2}{#3}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\timeStampFormat} +% The format for the time stamp. The format is that of the formatting string for the +% Acrobat JavaScript method \texttt{util.printd()}. +% \begin{macrocode} +\newcommand{\timeStampFormat}[1]{\def\jjTimeStampFormat{#1}} +\timeStampFormat{mm-dd-yy, H:MM:ss.} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\AtBeginDocument{\redefineRespBoxActions} +% \end{macrocode} +% \begin{macro}{\enterNamePlease} +% When the forcredit option is used, an alert box opens when the contestant +% did not sign in. This is the message presented on that box. +% \begin{macrocode} +\newcommand{\enterNamePlease}[1]{\def\jjEnterNamePlease{#1}} +\enterNamePlease{Please, enter your name on the first + page before you begin the game!} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\defineInstructionPageGraphic} +% \begin{macro}{\defineGameboardPageGraphic} +% \begin{macro}{\defineQuestionPagesGraphic} +% Convenience commands for inserting graphics backgrounds on the instructions page, +% the game board page and on the question pages. The single parameter is the basename +% of a graphic file supported by the driver. +% \begin{macrocode} +\let\jjInstructionPageBG\relax +\let\jjGameBoardPageBG\relax +\let\jjQuestionPagesBG\relax +\newcommand{\defineInstructionPageGraphic}[1]{% + \def\jjInstructionPageBG{#1}} +\newcommand{\defineGameboardPageGraphic}[1]{\def\jjGameBoardPageBG{#1}} +\newcommand{\defineQuestionPagesGraphic}[1]{\def\jjQuestionPagesBG{#1}} +\newcommand{\instructionPageTemplate}{% + \@ifundefined{jjInstructionPageBG}{}{% + \edef\expand@templatename{\noexpand\template{\jjInstructionPageBG}}% + \expand@templatename}} +\newcommand{\gameboardPageTemplate}{% + \@ifundefined{jjGameBoardPageBG}{}{% + \edef\expand@templatename{\noexpand\template{\jjGameBoardPageBG}}% + \expand@templatename}} +\newcommand{\questionPagesTemplate}{% + \@ifundefined{jjQuestionPagesBG}{}{% + \edef\expand@templatename{\noexpand\template{\jjQuestionPagesBG}}% + \expand@templatename}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\illegalAccessMsg} +% \begin{macro}{\illegalAnswerTwiceMsg} +% Messages that appear in alert boxes when contestant acts illegally. +% \begin{macrocode} +\newcommand{\illegalAccessMsg}[1]{\def\jjIllegalAccessMsg{#1}} +\illegalAccessMsg{You are peeking at this question. + Choose a question from the game board first! + You may want to start the game over now!} +\newcommand{\illegalAnswerTwiceMsg}[1]{\def\jjIllegalAnswerTwiceMsg{#1}} +\illegalAnswerTwiceMsg{Changing your answer is not allowed!} +\newcommand{\playeriWinnerMsg}[1]{\def\jjplayeriWinner{#1}} +\playeriWinnerMsg{\jjg@playeri\space is the winner!} +\newcommand{\playeriiWinnerMsg}[1]{\def\jjplayeriiWinner{#1}} +\playeriiWinnerMsg{\jjg@playerii\space is the winner!} +\newcommand{\gameTiedMsg}[1]{\def\jjgameTied{#1}} +\gameTiedMsg{It is all tied up! You are equally matched!} +\newcommand{\bothLosersMsg}[1]{\def\jjbothlosers{#1}} +\bothLosersMsg{You two either are not trying, or + you do not know anything about the subject!} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \section{JavaScript Support} +% \begin{macrocode} +\begin{insDLJS*}[qbrespond]{jjgdljs} +\begin{newsegment}{JJG: JavaScript to Control Jeopardy} +var _processLink=true; +var twoplayerGame=\twoplayerGame; +var whichPlayer=0; +if ( twoplayerGame ) { + var reTrimSpaces=/^\s+|\s+$/g; + var reInsertCommas=/\b\s+\b|\b\s+(?=\.)/g; + var tpHighlightBorderColor="\@APtpHighlightBorderColor"; + var hightLightColor=% + tpHighlightBorderColor.replace(reTrimSpaces,"").% +replace(reInsertCommas,","); + var aHighlightColor = ("RGB,"+hightLightColor).split(","); + this.getField("Total"+whichPlayer).strokeColor=% +aHighlightColor; + var ckBx = this.getField("ckboxPlayer"+whichPlayer); + if ( ckBx != null ) % +this.getField("ckboxPlayer"+whichPlayer).checkThisBox(0,true); + this.dirty=false; +} +function qbrespond(ans,row,col) +{ + if (_processLink) { + \ifjjnopeeking\else this.getField(""+row+col).hidden=true;\fi + if ( eval("typeof pushCell"+row+col) == "undefined") { + app.alert("\jjIllegalAccessMsg"); + return null; + } + if ( twoplayerGame ) + var Total = this.getField("Total"+whichPlayer); + else + var Total = this.getField("Total"); + var p = numQuestions*(col-1)+row-1; + if (QAed.charAt(p)==0) + { + QAed = QAed.substring(0,p)+1+% + QAed.substring(p+1,totalQuestions); + if (ans==1) + { + this.getField(""+row+col+'R').hidden=false; + Total.value += \scaleFactor*row*100; + app.alert(aCM[nCM],3); + if (++nCM > 6) nCM=0; + } + else + { + this.getField(""+row+col+'W').hidden=false; + var f = this.getField(""+row+col) + Total.value -= \scaleFactor*row*100; + app.alert(aEM[nEM],3); + if (++nEM > 6) nEM=0; + } +% \end{macrocode} +% 11/13/08. After we process this question, we hide the layer containing +% the question, and reset \texttt{pushCell+row+col} to \texttt{undefined} so the layer +% will not be made visible again by the open page action. +% \begin{macrocode} + if ( typeof toggleSetThisLayer == "function" ) { + toggleSetThisLayer("q"+row+col,false); + eval("pushCell"+row+col+"=undefined"); + } + if ( twoplayerGame ) { + this.getField("Total"+whichPlayer).strokeColor=["G",0] + var ckBx = this.getField("ckboxPlayer"+whichPlayer); + if (ckBx != null ) % +this.getField("ckboxPlayer"+whichPlayer).checkThisBox(0,false); + whichPlayer = ( whichPlayer+1) \% 2; + this.getField("Total"+whichPlayer).strokeColor=% +aHighlightColor; + ckBx = this.getField("ckboxPlayer"+whichPlayer); + if (ckBx != null ) % +this.getField("ckboxPlayer"+whichPlayer).checkThisBox(0,true); + + } +% \end{macrocode} +% The end of the game. We see if the GraphPoobah has been reached, if a two person +% game we indicate who has won. +% \begin{macrocode} + if ( ++NumQAed>=totalQuestions ) { + if (Total.value>=Goal) + this.getField("GrandPoohbah").hidden=false; + if ( twoplayerGame ) { + var player0 = this.getField("Total0"); + var player1 = this.getField("Total1"); + var player0Score = Number(player0.value); + var player1Score = Number(player1.value); + if ( player0Score > player1Score ) { + if ( player0Score <= 0 ) { + player0.strokeColor = ["RGB", 1, 0, 0]; + player1.strokeColor = ["RGB", 1, 0, 0]; + var timer=app.setTimeOut( + 'app.alert("\jjbothlosers")',250); + } else { + player0.strokeColor = ["RGB", 0, .6, 0]; + player1.strokeColor = ["G",0]; + var timer=app.setTimeOut( + 'app.alert("\jjplayeriWinner")',250); + } + } + else if ( player1Score > player0Score ) { + if ( player1Score <= 0 ) { + player0.strokeColor = ["RGB", 1, 0, 0]; + player1.strokeColor = ["RGB", 1, 0, 0]; + var timer=app.setTimeOut( + 'app.alert("\jjbothlosers")',250); + } else { + player1.strokeColor = ["RGB", 0, .6, 0]; + player0.strokeColor = ["G",0]; + var timer=app.setTimeOut( + 'app.alert("\jjplayeriiWinner")',250); + } + } + else { + if ( player1Score <= 0 ) { + player0.strokeColor = ["RGB", 1, 0, 0]; + player1.strokeColor = ["RGB", 1, 0, 0]; + var timer=app.setTimeOut( + 'app.alert("\jjbothlosers")',250); + } else { + player0.strokeColor = ["RGB", 0, 0, 1]; + player1.strokeColor = ["RGB", 0, 0, 1]; + var timer=app.setTimeOut( + 'app.alert("\jjgameTied")',250); + } + } + } + } + } + else + app.alert("\jjIllegalAnswerTwiceMsg"); + } + this.dirty=false; +} +var tsfield = this.getField("timestamp"); +if ( tsfield != null ) + tsfield.value = util.printd("\jjTimeStampFormat", new Date()); +this.dirty=false; +function makeNameReadOnly() +{ + var f = this.getField("jjContestantName"); + if ( (f != null) && !f.readonly ) f.readonly=true; + this.dirty=false; +} +\end{newsegment} +\begin{newsegment}{JJG: Global Variables} +var numQuestions = \the\numQuestions; +var numCategories = \the\numCategories; +var Goal = \Goal; +var totalQuestions = numQuestions * numCategories; +var QAed = ""; +for (var i=0; i< totalQuestions; i++) QAed +="0"; +var nEM = 0; +var nCM = 0; +var NumQAed = 0; +this.dirty=false; +\end{newsegment} +\begin{JJLangEnglish} +\begin{newsegment}{JJG: Arrays for Jeopardy for English} +var aCM = new Array +( + "That's Right! Way to go, Kiddo!", + "Wonderfully Done! Congrats!", + "Very Good! Keep up the good work!", + "Good, good, good, good!", + "Gee, you're smart! Try a harder one!", + "You're pretty sharp! Continuez, s'il vous pla\356t!", + "You're the tops! But wait...try another." +) +var aEM = new Array +( + "That's wrong! Sorry. Try Again.", + "Error again. Don't guess, I'm watching!", + "Please! Please! Work it out first!", + "An error has insinuated itself into your calculations.\n" + +"Recalibrate your thinking!", + "Bah! Humbug! You're haunted by Errors!", + "Try again. This time with order and method.", + "Wrong again! Use your little gray cells!" +) +this.dirty=false; +\end{newsegment} +\end{JJLangEnglish} +\begin{JJLangGerman} +\begin{newsegment}{JJG: Arrays for Jeopardy for German} +var aCM = new Array +( + "Richtig! So ist's recht!", + "Gut gemacht! Gratuliere!", + "Sehr gut! Weiter so!", + "Gut, gut, gut, gut!", + "Du bist sehr clever! Jetzt versuch mal eine Schwierigere!", + "Jawoll! Continuez, s'il vous pla\356t!", + "Spitze! Auf geht's, zu einer weiteren Aufgabe!" +) +var aEM = new Array +( + "Leider falsch!", + "Schon wieder falsch! Nicht raten!", + "Bitte denk erst nach bevor Du auf die Antwort klickst!", + "Ein Fehler hat sich eingeschlichen. Erst denken, dann ...!", + "Ohje! So ein Quatsch!", + "Versuch's nochmal. Es ist noch nicht aller Tage Abend.", + "Schon wieder falsch! Nutz Deine kleine grauen Zellen!" +) +this.dirty=false; +\end{newsegment} +\end{JJLangGerman} +\begin{JJForCredit} +\begin{newsegment}{JJG: JS to support forcredit} +var noNameError, fname; +function forCreditClosePage() +{ + fname = this.getField("jjContestantName"); + if ( fname != null ) { + var JJjsCode = "if ( fname.value.replace(/\s*/g, '') == '' ) {" + + " if ( typeof closingJJ == 'undefined' ) {" + + " app.alert({cMsg: '\jjEnterNamePlease', % +cTitle: 'AcroTeX eDucation Bundle'});" + + " this.pageNum = 0;" + + " } } else { fname.readonly = true; }"; + noNameError = app.setTimeOut(JJjsCode, 15); + } + this.dirty=false; +} +\end{newsegment} +\end{JJForCredit} +\end{insDLJS*} +% \end{macrocode} +% \begin{macrocode} +\AtEndOfClass{\thisPageAction{\JS{this.dirty=false;}}{}} +%</package> +%<*jjgpro> +\def\noPrintLayer#1{% + \literalps@out{/Print [/Print] [(xb.#1)] AddASEvent}% + \literalps@out{(xb.#1) << +/Print<< /PrintState/OFF >> >> SetOCGUsage}% +} +\def\bJJGInsertLayer{\xBld{q\the\rownum\the\colnum}} +\def\eJJGInsertLayer{\eBld\noPrintLayer{q\the\rownum\the\colnum}} +\def\jjAdditionalJSActions{/Next <<\JS{% + if ( typeof pushCell\the\rownum\the\colnum\space!= "undefined") + toggleSetThisLayer("q\the\rownum\the\colnum",true);}>>} +\begin{execJS}{lockocgs} +var o = this.getOCGs(); +for (var i = 0; i < o.length; i++) + o[i].locked = true; +\end{execJS} +%</jjgpro> +%<*jjsecurity> +\begin{willClose} +var closingJJ = true; +\end{willClose} +\begin{addJSToPageClose} +forCreditClosePage(); +\end{addJSToPageClose} +%</jjsecurity> +%<*package> +%</package> +% \end{macrocode} +% \Finale +\endinput diff --git a/texmf-dist/source/latex/jj-game/jj_game.ins b/texmf-dist/source/latex/jj-game/jj_game.ins new file mode 100644 index 00000000..ea3b11bd --- /dev/null +++ b/texmf-dist/source/latex/jj-game/jj_game.ins @@ -0,0 +1,63 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1999-2000 D. P. Story +%% +%% This file is part of the `JJ_Game Class'. +%% ------------------------------------------- +%% +%% It may be distributed under the conditions of the LaTeX Project Public +%% License, either version 1.2 of this license or (at your option) any +%% later version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\filedate{2000/01/22} +\def\batchfile{jj_game.ins} +\input docstrip + +\ifx\generate\undefined + \Msg{**********************************************} + \Msg{*} + \Msg{* This installation requires docstrip} + \Msg{* version 2.4 or later.} + \Msg{*} + \Msg{* An older version of docstrip has been input} + \Msg{*} + \Msg{**********************************************} + \errhelp{Move or rename old docstrip.tex and get a newer one.} + \errmessage{Old docstrip in input path} + \batchmode + \csname @@end\endcsname\end +\fi + +\keepsilent +\askforoverwritefalse +%\askonceonly +%\usedir{tex/latex/hyperref} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\preamble +\endpreamble + +\generate{% + \file{jj_game.cls}{\from{jj_game.dtx}{package}} + \file{jjgpro.def}{\from{jj_game.dtx}{copyright,jjgpro}} + \file{jjcredit.def}{\from{jj_game.dtx}{copyright,jjsecurity}} + \file{jj_game.drv}{\from{jj_game.dtx}{driver}} +} + +\Msg{***************************************************************} +\Msg{*} +\Msg{* \space To finish the installation you have to copy the files } +\Msg{*} +\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX} +\Msg{*} +\Msg{***************************************************************} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput |