\ProvidesPackage{resultan}%
[1996/11/10  Lines for student responses and answers]

% file: resultan.sty
% The command result will always use the full line width, and will be
% indented correctly, even when in a list.
% Written by Nick Urbanik.

\RequirePackage{ifthen}

\newcounter{numLinesResult}%

\newcommand{\resultLineSpace}{7mm}
% There must be a way to make these declarations local:
\newlength{\indentLen}%
\newlength{\bigLabelWidth}%
\newlength{\outerParIndent}

\newcommand{\result}[4][Write results:]{{%
   \settowidth{\bigLabelWidth}{#1}
   \setlength{\parskip}{0pt}%
   \outerParIndent=\parindent%
   %\setlength{\parindent}{0pt}%
   \par%
   %\vspace{4ex}%
   \bigbreak% See page 131 of Wynter Snow (Love her name!)
   \setlength{\indentLen}{\linewidth}%
   \addtolength{\indentLen}{-\textwidth}%
   \addtolength{\indentLen}{-\parindent}%
   \hspace*{\indentLen}%
   \noindent\parbox[t]{\textwidth}{%
      \setlength{\parindent}{\outerParIndent}%
      \par%
      \ifthenelse{\lengthtest{\bigLabelWidth > 0pt}}%
         {\noindent\textbf{\Large #1}\hspace{2em}}%
      %else
         {}%
      \noindent#3%
      \par%
      \vspace{.5ex}%
      \par%
      \setcounter{numLinesResult}{#2}%
      \ifthenelse{\boolean{Solutions}}%
      {\par\vspace*{2ex}\par\noindent\textbf{Solution: \ }#4}%
      %else
      {%
         \whiledo{\value{numLinesResult} > 0}%
         {%
             \vspace*{\resultLineSpace}%
             \par%
             \noindent\hrule%
             %\noindent\rule{\textwidth}{.4pt}%
             \addtocounter{numLinesResult}{-1}%
         }%
      }%
   }%
   \bigbreak% See page 131 of Wynter Snow (Love her name!)
   %\vspace{4ex}%
}}

\newcommand{\LinesForWriting}[2]{{%
   \setlength{\parskip}{0pt}%
   %\setlength{\parindent}{0pt}%
   \par%
   \smallbreak% See page 131 of Wynter Snow (Love her name!)
   \vspace{1.5ex}%
   \par%
   \setcounter{numLinesResult}{#1}%
   \ifthenelse{\boolean{Solutions}}%
   {\par\vspace*{2ex}\par\noindent\textbf{Solution: \ }#2}%
   %else
   {%
      \whiledo{\value{numLinesResult} > 0}%
      {%
          \vspace*{\resultLineSpace}%
          \par%
          \noindent\hrule%
          %\noindent\rule{\textwidth}{.4pt}%
          \addtocounter{numLinesResult}{-1}%
      }%
   }%
   %\vspace{4ex}%
   \bigbreak% See page 131 of Wynter Snow (Love her name!)
}}
