| 1 |
% \subsubsection{Free response} |
| 2 |
% \DescribeEnv{freeResponse}{A freeform input box.} |
| 3 |
% \begin{macrocode} |
| 4 |
%<*classXimera> |
| 5 |
\newboolean{given} %% required for freeResponse |
| 6 |
\setboolean{given}{true} %% could be replaced by a key=value pair later if needed |
| 7 |
|
| 8 |
\ifhandout |
| 9 |
\newenvironment{freeResponse}[1][false]% |
| 10 |
{% |
| 11 |
\def\givenatend{\boolean{#1}} |
| 12 |
\ifthenelse{\boolean{#1}} |
| 13 |
{% Begin then result |
| 14 |
\begin{trivlist} |
| 15 |
\item |
| 16 |
}% End then result |
| 17 |
{% Begin else result |
| 18 |
\setbox0\vbox\bgroup |
| 19 |
}% End else result |
| 20 |
% {}% Don't think this is doing anything? -- Jason |
| 21 |
} |
| 22 |
{% |
| 23 |
\ifthenelse{\givenatend} |
| 24 |
{% Begin then result |
| 25 |
\end{trivlist} |
| 26 |
}% End then result |
| 27 |
{% Begin else result |
| 28 |
\egroup |
| 29 |
}% End else result |
| 30 |
% {}% Don't think this is doing anything? -- Jason |
| 31 |
} |
| 32 |
\else |
| 33 |
\newenvironment{freeResponse}[1][false]% |
| 34 |
{% Environment Beginning Code |
| 35 |
\ifthenelse{\boolean{#1}}%% Could probably change this with just putting the (given) in the boolean?-- Jason |
| 36 |
{% Begin then result |
| 37 |
\begin{trivlist} |
| 38 |
\item[\hskip \labelsep\bfseries Free Response (Given):\hspace{2ex}] |
| 39 |
}% End then result |
| 40 |
{% Begin else result |
| 41 |
\begin{trivlist} |
| 42 |
\item[\hskip \labelsep\bfseries Free Response:\hspace{2ex}] |
| 43 |
}% End else result |
| 44 |
} |
| 45 |
{% Environment Ending Code |
| 46 |
\end{trivlist} |
| 47 |
} |
| 48 |
\fi |
| 49 |
|
| 50 |
%</classXimera> |
| 51 |
% \end{macrocode} |
| 52 |
|
| 53 |
% \begin{macrocode} |
| 54 |
%<*htXimera> |
| 55 |
|
| 56 |
\renewenvironment{freeResponse}{\refstepcounter{problem}}{}% |
| 57 |
\ConfigureEnv{freeResponse}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div class="free-response" id="problem\arabic{identification}">}}{\HCode{</div>}\IgnoreIndent}{}{}% |
| 58 |
|
| 59 |
%</htXimera> |
| 60 |
% \end{macrocode} |