--- loncom/homework/default_homework.lcpm 2004/05/27 04:25:13 1.84 +++ loncom/homework/default_homework.lcpm 2004/06/09 21:08:21 1.86 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run() # -# $Id: default_homework.lcpm,v 1.84 2004/05/27 04:25:13 albertel Exp $ +# $Id: default_homework.lcpm,v 1.86 2004/06/09 21:08:21 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -106,17 +106,8 @@ sub caparesponse_check { } } - if ($sig eq '') { - $sig_lbound = 0; #SIG_LB_DEFAULT - $sig_ubound =15; #SIG_UB_DEFAULT - } else { - ($sig_lbound,$sig_ubound) = split /,/,$sig; - if (!defined($sig_lbound)) { - $sig_lbound = 0; #SIG_LB_DEFAULT - $sig_ubound =15; #SIG_UB_DEFAULT - } - if (!defined($sig_ubound)) { $sig_ubound=$sig_lbound; } - } + ($sig_ubound,$sig_lbound)=&LONCAPA_INTERNAL_get_sigrange($sig); + my $reterror=""; my $result = &caparesponse_capa_check_answer($response,$answer,$type, $tol_type,$tol, @@ -544,7 +535,7 @@ sub prettyprint { if ($fmt =~ /chem/i) { return(&chemparse($value)); } my ($dollarmode,$commamode,$alwaysperiod,$options); if ($fmt =~ /^([^\d]*)(.*)/) { $options=$1; $fmt=$2; } - if ($options =~ /\$/) { $dollamode=1; } + if ($options =~ /\$/) { $dollarmode=1; } if ($options =~ /,/) { $commamode=1; } if ($options =~ /\./) { $alwaysperiod=1; } if ($fmt) { $value=sprintf('%.'.$fmt,$value); } @@ -577,8 +568,8 @@ sub prettyprint { } } else { $result=$value; - if ($dollarmode) { $result=&dollarformat($result,$target); } - if ($commamode) { $result=&commaformat($result,$target); } + if ($dollarmode) { $result=&dollarformat($result,$target); } + elsif ($commamode) { $result=&commaformat($result,$target); } } return $result; }