--- loncom/homework/functionplotresponse.pm 2010/11/01 00:04:09 1.22 +++ loncom/homework/functionplotresponse.pm 2010/11/06 14:37:24 1.23 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # option list style responses # -# $Id: functionplotresponse.pm,v 1.22 2010/11/01 00:04:09 www Exp $ +# $Id: functionplotresponse.pm,v 1.23 2010/11/06 14:37:24 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -363,7 +363,7 @@ sub end_splinerule { # -# +# # # Unfortunately, GeoGebra seems to want all splines after everything else, so we need to store them # @@ -371,15 +371,19 @@ sub start_spline { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result=''; if ($target eq 'web') { - my $label=&Apache::lonxml::get_param('label',$parstack,$safeeval); + my $label=&Apache::lonxml::get_param('index',$parstack,$safeeval); $Apache::functionplotresponse::counter++; if ($label=~/\W/) { - &Apache::lonxml::warning(&mt('Spline labels should only contain alphanumeric characters.')); + &Apache::lonxml::warning(&mt('Spline indices should only contain alphanumeric characters.')); } $label=~s/\W//gs; - unless ($label) { $label='S'.$Apache::functionplotresponse::counter; } + unless ($label) { + $label='S'.$Apache::functionplotresponse::counter; + } else { + $label='S'.$label; + } if ($Apache::functionplotresponse::splineorder{$label}) { - &Apache::lonxml::error(&mt('Spline labels must be unique.')); + &Apache::lonxml::error(&mt('Spline indices must be unique.')); } my $order=&Apache::lonxml::get_param('order',$parstack,$safeeval); @@ -404,7 +408,7 @@ sub start_spline { $Apache::functionplotresponse::splinescaley{$label}=$sy; } elsif ($target eq 'edit') { $result=&Apache::edit::tag_start($target,$token,'Spline'). - &Apache::edit::text_arg('Label:','label', + &Apache::edit::text_arg('Index:','index', $token,'4').' '. &Apache::edit::select_arg('Order:','order', ['2','3','4','5','6','7','8','9'],$token).' '. @@ -419,7 +423,7 @@ sub start_spline { &Apache::edit::end_row(); } elsif ($target eq 'modified') { my $constructtag=&Apache::edit::get_new_args($token,$parstack, - $safeeval,'label','order','initx','inity', + $safeeval,'index','order','initx','inity', 'scalex','scaley'); if ($constructtag) { $result=&Apache::edit::rebuild_tag($token); } }