--- loncom/homework/imageresponse.pm 2002/07/29 20:43:47 1.20 +++ loncom/homework/imageresponse.pm 2003/01/16 02:55:05 1.23 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # image click response style # -# $Id: imageresponse.pm,v 1.20 2002/07/29 20:43:47 albertel Exp $ +# $Id: imageresponse.pm,v 1.23 2003/01/16 02:55:05 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -30,6 +30,7 @@ package Apache::imageresponse; use strict; +use Image::Magick; BEGIN { &Apache::lonxml::register('Apache::imageresponse',('imageresponse')); @@ -84,7 +85,7 @@ sub whichfoils { if (&Apache::response::showallfoils()) { $aopt=0; } else { - $aopt=int(rand($#names+1)); + $aopt=int(&Math::Random::random_uniform() * ($#names+1)); } &Apache::lonxml::debug("From $#names elms, picking $aopt"); $aopt=splice(@names,$aopt,1); @@ -183,7 +184,7 @@ sub end_conceptgroup { if ($target eq 'web' || $target eq 'grade') { if (defined(@{ $Apache::response::conceptgroup{'names'} })) { my @names = @{ $Apache::response::conceptgroup{'names'} }; - my $pick=int(rand($#names+1)); + my $pick=int(&Math::Random::random_uniform() * ($#names+1)); my $name=$names[$pick]; if (defined(@{ $Apache::response::conceptgroup{"$name.area"} })) { push @{ $Apache::response::foilgroup{'names'} }, $name; @@ -323,14 +324,14 @@ sub end_image { #where can we find the picture? if (-e $newsrc) { if ($path) { - $currentstring .= '\vskip 0 mm \noindent\graphicspath{{'.$path.'}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} '; + $currentstring .= '\vskip 0 mm \noindent\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; } } else { my $temp_file; my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat"; $temp_file = Apache::File->new('>>'.$filename); print $temp_file "$src\n"; - $currentstring .= '\vskip 0 mm \graphicspath{{/home/httpd/prtspool/}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} '; + $currentstring .= '\vskip 0 mm \graphicspath{{/home/httpd/prtspool/}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; } } return $currentstring;