VectorListCheckers.pl
Provides subroutines for answer checking lists MathObjects vectors with real entries.
First, load the VectorListCheckers.pl
macro file.
loadMacros("PGstandard.pl","MathObjects.pl","VectorListCheckers.pl");
For a MathObject list of MathObject vectors, the way to use the answer checkers is the same as using a custom answer checker inside of cmp(checker=<gt
~~&name_of_answer_checker_subroutine)> such as
ANS( List(ColumnVector(1,0,0),ColumnVector(0,1,0))-<gt
cmp( checker=<gt>~~&basis_checker_list_of_vectors ) );>ANS( Vector("<1,0,0
+ s * <0,1,0> + t * <0,0,1>")-<gt>cmp( checker=<gt>~~&affine_subspace_checker_vectors ) );>The "list of vectors" at the end of the checker name refers to the fact that the student answer is a list of vectors.
Here is an example of how to use these answer checkers.
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "VectorListCheckers.pl", "PGcourse.pl", ); $showPartialCorrectAnswers = 1; TEXT(beginproblem());
Context('Vector');
$B = Matrix([[1,0,0],[0,1,0],[0,0,0]]);
$answer = List(ColumnVector(1,0,0),ColumnVector(0,1,0));
Context()->texStrings; BEGIN_TEXT A basis for the column space of \( B = $B \) is $BR $BR \{ $answer->ans_rule(60) \} $BR $BR Enter your answer as a comma separated list of vectors, such as \( \verb+<1,2,3>,<4,5,6>+ \). END_TEXT Context()->normalStrings;
ANS( $answer->cmp(list_checker=>~~&basis_checker_list_of_vectors) );
ENDDOCUMENT();
The answer evaluation section of the PG file is totally standard.
ANS( $multians->cmp );
The parametric_plane_checker_columns
should be used for solutions to non-homogeneous systems of linear equations for which the solution is essentially a point plus the span of several linearly independent vectors. When using the parametric plane checker, the first vector input always serves as a point on the hyperplane (i.e., the first vector input is always a particular solution), while the remaining vectors are a basis for the hyperplane (i.e., they span the homogeneous solution set).
Paul Pearson, Hope College, Department of Mathematics