--- loncom/homework/drawimage.pm 2004/03/16 22:27:37 1.4 +++ loncom/homework/drawimage.pm 2004/03/16 23:08:23 1.5 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # programatic image drawing # -# $Id: drawimage.pm,v 1.4 2004/03/16 22:27:37 matthew Exp $ +# $Id: drawimage.pm,v 1.5 2004/03/16 23:08:23 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,7 +38,7 @@ BEGIN { sub start_drawimage { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; - &Apache::lonxml::register('Apache::drawimage',('textlabel','line','rectangle','arc','fill')); + &Apache::lonxml::register('Apache::drawimage',('text','line','rectangle','arc','fill')); if ($target eq 'web' || $target eq 'tex') { $cgi_id=&Apache::loncommon::get_cgi_id(); %args=(); @@ -72,7 +72,7 @@ sub end_drawimage { return $result; } -sub start_textlabel { +sub start_text { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result; if ($target eq 'web' || $target eq 'tex') { @@ -80,16 +80,17 @@ sub start_textlabel { my $y = &Apache::lonxml::get_param('y',$parstack,$safeeval); my $font = &Apache::lonxml::get_param('font',$parstack,$safeeval); my $color = &Apache::lonxml::get_param('color',$parstack,$safeeval); - my $text = &Apache::lonxml::get_all_text("/textlabel",$parser); + my $direction = &Apache::lonxml::get_param('direction',$parstack,$safeeval); + my $text = &Apache::lonxml::get_all_text("/text",$parser); $text = &Apache::lonnet::escape($text); $args{"cgi.$cgi_id.OBJTYPE"}.='LABEL:'; my $i=$args{"cgi.$cgi_id.OBJCOUNT"}++; - $args{"cgi.$cgi_id.OBJ$i"}=join(':',($x,$y,$text,$font,$color)); + $args{"cgi.$cgi_id.OBJ$i"}=join(':',($x,$y,$text,$font,$color,$direction)); } return $result; } -sub end_textlabel { +sub end_text { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result; return $result;