--- loncom/homework/imageresponse.pm 2004/03/08 23:23:04 1.51 +++ loncom/homework/imageresponse.pm 2004/08/12 06:00:39 1.55 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # image click response style # -# $Id: imageresponse.pm,v 1.51 2004/03/08 23:23:04 albertel Exp $ +# $Id: imageresponse.pm,v 1.55 2004/08/12 06:00:39 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -75,7 +75,7 @@ sub end_imageresponse { sub start_foilgroup { %Apache::response::foilgroup=(); $Apache::imageresponse::conceptgroup=0; - &Apache::response::setrandomnumber(); + &Apache::response::pushrandomnumber(); return ''; } @@ -296,6 +296,7 @@ sub end_foilgroup { } elsif ($target eq 'edit') { $result=&Apache::edit::end_table(); } + &Apache::response::poprandomnumber(); return $result; } @@ -341,6 +342,7 @@ sub start_foil { if (defined($Apache::response::foilnames{$name})) { &Apache::lonxml::error(&mt("Foil name [_1] appears more than once. Foil names need to be unique.",$name)); } + $Apache::response::foilnames{$name}++; if ( $Apache::imageresponse::conceptgroup && !&Apache::response::showallfoils()) { push(@{ $Apache::response::conceptgroup{'names'} }, $name); @@ -498,6 +500,7 @@ sub end_image { } elsif ($width ne '') { $width_param = $width*$scaling; } + $width_param=&Apache::randomlabel::adjust_textwidth($width_param); #where can we find the picture? if (-e $newsrc) { if ($path) { @@ -550,6 +553,7 @@ sub end_rectangle { $target eq 'analyze') { my $name = $Apache::imageresponse::curname; my $area = &Apache::lonxml::endredirection; + $area=~s/\s//g; &Apache::lonxml::debug("out is $area for $name"); if ( $Apache::imageresponse::conceptgroup && !&Apache::response::showallfoils()) {