--- loncom/homework/drawimage.pm 2004/03/23 20:38:09 1.6 +++ loncom/homework/drawimage.pm 2004/09/09 07:24:56 1.7 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # programatic image drawing # -# $Id: drawimage.pm,v 1.6 2004/03/23 20:38:09 albertel Exp $ +# $Id: drawimage.pm,v 1.7 2004/09/09 07:24:56 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,43 +32,48 @@ use Apache::loncommon; my %args; my $cgi_id; +my @cgi_ids; BEGIN { &Apache::lonxml::register('Apache::drawimage',('drawimage')); } sub start_drawimage { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; - &Apache::lonxml::register('Apache::drawimage',('text','line','rectangle','arc','fill')); + &Apache::lonxml::register('Apache::drawimage',('text','line','rectangle','arc','fill','polygon','image')); if ($target eq 'web' || $target eq 'tex') { - $cgi_id=&Apache::loncommon::get_cgi_id(); - %args=(); + my $new_id=&Apache::loncommon::get_cgi_id(); + if ($cgi_id) { push(@cgi_ids,$cgi_id); } else { undef(%args); } + $cgi_id=$new_id; } + return ''; } sub end_drawimage { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result; if ($target eq 'web' || $target eq 'tex') { - if ($target eq 'web') { - my $width = - &Apache::lonxml::get_param('width',$parstack,$safeeval); - my $height = - &Apache::lonxml::get_param('height',$parstack,$safeeval); - my $bgcolor = - &Apache::lonxml::get_param('bgcolor',$parstack,$safeeval); - if (!$width) { $width=300; } - if (!$height) { $height=300; } - $result.="