Equation

Description

Accepts an equation (two formulas separated by an = sign) as an answer.

Notes

Examples

\begin{question}{Equation}
\qutext{Find the equation of the line that passes though the points
$(-3,4)$ and $(6,1)$.}
% One side of the answer given must be a single variable:
\answer{y=-x/3+3}
% Note that the response 'y-1=-(x-6)/3' would also be graded as correct.
\end{question}
\begin{question}{Equation}
% This question uses algorithmic variables.
\qutext{Find the equation of the line that is parallel to the line 
$y=\var{m}x+\var{b}$ and that passes through the point
$(\var{c},\var{d})$.}
\answer{y=\var{m}x\var{sgn}\var{e}}
\code{$m1 = range(2,20);
      $m = int(if(rint(2),$m1,-$m1));
      $b = range(1,20);
      $c = range(-10,10);
      $d = range(-10,10);
      $e1 = int($d-$m*$c);
      $sgn = switch(lt($e1,0),"+","-");
      $e = int(abs($e1));}
% The above code chooses random integer coefficients m and b, and a
% random point (c,d). The y-intercept e is calculated, and care is
% taken to display the answer correctly since e may be positive or
% negative.
\end{question}