Maple Grading Issues: Scalar multiples of Vectors |
Many answers in Linear Algebra should accept any non-zero multiple of the answer vector as correct. For example if the student is asked to find a normal vector then any multiple should also be correct (assuming ). To do this you need to use the norms of your answer vector and the vector entered by the student. If you divide the components of a vector by its norm the result is a unit vector in the same direction. The idea then is to turn both your answer and the student response into such a unit vector, and compare the unit vectors. Suppose the answer is the vector . Then your Maple grading code is as follows: w:=$RESPONSE;vn:=LinearAlgebra[VectorNorm]($v, Euclidean); wn:=LinearAlgebra[VectorNorm](w, Euclidean); evalb(LinearAlgebra[Equal](w/wn, v/vn)) Incidentally, if you know the components of your vector you can have it display nicely in the "Answer" field as follows: printf(MathML[ExportPresentation](Vector[column]([v1,v2,v3]))) |
Maple Grading Issues Index | Last updated: 03/23/2023 SS/DAG |