[system] / trunk / pg / macros / answerHints.pl Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww Revision 5554 Revision 5555
64If more than one message matches the student's answer, the first 64If more than one message matches the student's answer, the first
65one in the list is used. 65one in the list is used.
66 66
67Example: 67Example:
68 68
70 Vector(0,0,0) => "The zero vector is not a valid solution", 70 Vector(0,0,0) => "The zero vector is not a valid solution",
71 "-<1,2,3>" => "Try the opposite direction", 71 "-<1,2,3>" => "Try the opposite direction",
72 "<1,2,3>" => "Well done!", 72 "<1,2,3>" => "Well done!",
73 ["<1,1,1>","<2,2,2>","<3,3,3>"] => "Don't just guess!", 73 ["<1,1,1>","<2,2,2>","<3,3,3>"] => "Don't just guess!",
74 sub { 74 sub {
75 my (\$correct,\$student,\$ans) = @_; 75 my (\$correct,\$student,\$ans) = @_;
76 return \$correct . \$student == 0; 76 return \$correct . \$student == 0;
78 Vector(1,2,3) => [ 78 Vector(1,2,3) => [
79 "You have the right direction, but not length", 79 "You have the right direction, but not length",
80 cmp_options => [parallel=>1], 80 cmp_options => [parallel=>1],
81 ], 81 ],
82 0 => ["Careful, your answer should be a vector!", checkTypes => 0, replaceMessage => 1], 82 0 => ["Careful, your answer should be a vector!", checkTypes => 0, replaceMessage => 1],
83 sub { 83 sub {
84 my (\$correct,\$student,\$ans) = @_; 84 my (\$correct,\$student,\$ans) = @_;
85 return norm(\$correct-\$student) < .1; 85 return norm(\$correct-\$student) < .1;
86 } => ["Close! Keep trying.", score => .25], 86 } => ["Close! Keep trying.", score => .25],
87 ))); 87 )));
88 88
89=cut 89=cut
90 90