version 1.14, 2001/12/04 15:17:56
|
version 1.17, 2002/02/04 17:30:53
|
Line 31
|
Line 31
|
package Apache::imageresponse; |
package Apache::imageresponse; |
use strict; |
use strict; |
|
|
sub BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::imageresponse',('imageresponse')); |
&Apache::lonxml::register('Apache::imageresponse',('imageresponse')); |
} |
} |
|
|
Line 51 sub start_imageresponse {
|
Line 51 sub start_imageresponse {
|
sub end_imageresponse { |
sub end_imageresponse { |
&Apache::response::end_response; |
&Apache::response::end_response; |
pop @Apache::lonxml::namespace; |
pop @Apache::lonxml::namespace; |
|
&Apache::lonxml::deregister('Apache::imageresponse',('foilgroup','foil','text','image','rectangle','conceptgroup')); |
return ''; |
return ''; |
} |
} |
|
|
Line 271 sub grade_rectangle {
|
Line 272 sub grade_rectangle {
|
&Apache::lonxml::debug("Point $x1,$y1,$x2,$y2"); |
&Apache::lonxml::debug("Point $x1,$y1,$x2,$y2"); |
if ($x1 > $x2) { my $temp=$x1;$x1=$x2;$x2=$temp; } |
if ($x1 > $x2) { my $temp=$x1;$x1=$x2;$x2=$temp; } |
if ($y1 > $y2) { my $temp=$y1;$y1=$y2;$y2=$temp; } |
if ($y1 > $y2) { my $temp=$y1;$y1=$y2;$y2=$temp; } |
if ($x => $x1) { if ($x <= $x2) { if ($y => $y1) { if ($y <= $y2) { return 'APPROX_ANS'; } } } } |
if (($x >= $x1) && ($x <= $x2) && ($y >= $y1) && ($y <= $y2)) { |
|
return 'APPROX_ANS'; |
|
} |
return 'INCORRECT'; |
return 'INCORRECT'; |
} |
} |
|
|