--- loncom/homework/caparesponse/caparesponse.pm 2005/02/23 23:41:23 1.165 +++ loncom/homework/caparesponse/caparesponse.pm 2005/04/07 06:56:22 1.166 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.165 2005/02/23 23:41:23 albertel Exp $ +# $Id: caparesponse.pm,v 1.166 2005/04/07 06:56:22 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -30,6 +30,7 @@ package Apache::caparesponse; use strict; use capa; use Apache::lonlocal; +use Apache::lonnet; BEGIN { &Apache::lonxml::register('Apache::caparesponse',('caparesponse','numericalresponse','stringresponse','formularesponse')); @@ -348,7 +349,7 @@ sub end_numericalresponse { if ($target eq 'answer') { if ($high && $tag eq 'numericalresponse') { $ans.=' ['.$low.','.$high.']'; } if (defined($sighigh) && $tag eq 'numericalresponse') { - if ($ENV{'form.answer_output_mode'} eq 'tex') { + if ($env{'form.answer_output_mode'} eq 'tex') { $ans.= " Sig $siglow - $sighigh"; } else { $ans.= " Sig $siglow - $sighigh"; @@ -369,7 +370,7 @@ sub end_numericalresponse { if (defined($unit) and ($unit ne '') and $tag eq 'numericalresponse') { if ($target eq 'answer') { - if ($ENV{'form.answer_output_mode'} eq 'tex') { + if ($env{'form.answer_output_mode'} eq 'tex') { $result.=&Apache::response::answer_part($tag, " Unit: $unit "); } else { @@ -415,11 +416,11 @@ sub get_table_sizes { } $cell_width+=8; my $textwidth; - if ($ENV{'form.textwidth'} ne '') { - $ENV{'form.textwidth'}=~/(\d*)\.?(\d*)/; + if ($env{'form.textwidth'} ne '') { + $env{'form.textwidth'}=~/(\d*)\.?(\d*)/; $textwidth=$1.'.'.$2; } else { - $ENV{'textwidth'}=~/(\d+)\.?(\d*)/; + $env{'form.textwidth'}=~/(\d+)\.?(\d*)/; $textwidth=$1.'.'.$2; } my $bubbles_per_line=int($textwidth/$cell_width); @@ -526,8 +527,8 @@ sub get_tolrange { sub get_sigrange { my ($sig)=@_; &Apache::lonxml::debug("Got a sig of :$sig:"); - my $courseid=$ENV{'request.course.id'}; - if (lc($ENV{"course.$courseid.disablesigfigs"}) eq 'yes') { + my $courseid=$env{'request.course.id'}; + if (lc($env{"course.$courseid.disablesigfigs"}) eq 'yes') { return (15,0); } my $sig_lbound; @@ -547,7 +548,7 @@ sub get_sigrange { ($sig_lbound > 15) || ($sig =~/(\+|-)/ ) ) { my $errormsg=&mt("Invalid Significant figures detected")." ($sig)"; - if ($ENV{'request.state'} eq 'construct') { + if ($env{'request.state'} eq 'construct') { $errormsg.= &Apache::loncommon::help_open_topic('Significant_Figures'); } @@ -711,7 +712,7 @@ sub end_stringresponse { $string='Regular Expression'; } if ($target eq 'answer') { - if ($ENV{'form.answer_output_mode'} eq 'tex') { + if ($env{'form.answer_output_mode'} eq 'tex') { $result.=&Apache::response::answer_part('stringresponse', "$string"); } else {