--- loncom/xml/lonplot.pm 2001/12/18 15:33:47 1.2 +++ loncom/xml/lonplot.pm 2001/12/18 16:06:01 1.3 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Dynamic plot # -# $Id: lonplot.pm,v 1.2 2001/12/18 15:33:47 matthew Exp $ +# $Id: lonplot.pm,v 1.3 2001/12/18 16:06:01 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,7 +25,8 @@ # # http://www.lon-capa.org/ # -# 2/21 Guy +# 12/15/01 Matthew +# 12/18 Matthew package Apache::lonplot; use strict; use Apache::response; @@ -148,7 +149,7 @@ sub end_plot { sub start_key { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result=''; - &get_attributes(\%key,\%key_defaults,$parstack,$safeeval,'key'); + &get_attributes(\%key,\%key_defaults,$parstack,$safeeval,$tagstack); return $result; } @@ -200,10 +201,10 @@ sub end_ylabel { sub start_label { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result=''; - my $label = &newhashref(); - &get_attributes($label,\%label_defaults,$parstack,$safeeval,'label'); + my %label; + &get_attributes($label,\%label_defaults,$parstack,$safeeval,$tagstack); $label->{'text'} = &Apache::lonxml::get_all_text("/label",$$parser[-1]); - push(@labels,$label); + push(@labels,\%label); return $result; } @@ -217,8 +218,8 @@ sub end_label { sub start_curve { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result=''; - my $curve = &newhashref(); - &get_attributes($curve,\%curve_defaults,$parstack,$safeeval,'curve'); + my %curve; + &get_attributes($curve,\%curve_defaults,$parstack,$safeeval,$tagstack); push (@curves,$curve); &Apache::lonxml::register('Apache::plot',('function','data')); @@ -268,7 +269,7 @@ sub end_data { sub start_axis { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result=''; - &get_attributes(\%axis,\%label_defaults,$parstack,$safeeval,'axis'); + &get_attributes(\%axis,\%label_defaults,$parstack,$safeeval,$tagstack); return $result; } @@ -279,11 +280,6 @@ sub end_axis { } ##------------------------------------------------------------------- misc -sub newhashref{ - my %hash; - return \%hash; -} - sub get_attributes{ %values = %{shift}; %defaults = %{shift};