[LON-CAPA-cvs] cvs: loncom /homework/caparesponse caparesponse.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 21 Nov 2003 19:15:12 -0000


albertel		Fri Nov 21 14:15:12 2003 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - in bubble input mode, sig figs don't make much sense, explicitly ignore them (BUG#2399)
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.122 loncom/homework/caparesponse/caparesponse.pm:1.123
--- loncom/homework/caparesponse/caparesponse.pm:1.122	Thu Nov 20 17:06:39 2003
+++ loncom/homework/caparesponse/caparesponse.pm	Fri Nov 21 14:15:12 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.122 2003/11/20 22:06:39 albertel Exp $
+# $Id: caparesponse.pm,v 1.123 2003/11/21 19:15:12 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -128,15 +128,24 @@
 		my $expression="&caparesponse_check_list('".$response."','".
 		    $$parstack[-1];
 		my $hideunit=&Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.turnoffunit');
+
+		foreach my $key (keys(%Apache::inputtags::params)) {
+		    $expression.= ';my $'. #'
+			$key.'="'.$Apache::inputtags::params{$key}.'"';
+		}
+
 		#no way to enter units, with radio buttons
 		if ($Apache::lonhomework::type eq 'exam' ||
 		    lc($hideunit) eq "yes") {
 		    $expression.=';my $unit=undef;';
 		}
-		foreach my $key (keys(%Apache::inputtags::params)) {
-		    $expression.= ';my $'. #'
-			$key.'="'.$Apache::inputtags::params{$key}.'"';
+		#sig fig don't make much sense either
+		if (($Apache::lonhomework::type eq 'exam' ||
+		     $ENV{'form.submitted'} eq 'scantron') &&
+		    $$tagstack[-1] eq 'numericalresponse') {
+		    $expression.=';my $sig=undef;';
 		}
+
 		if ($$tagstack[-1] eq 'formularesponse') {
 		    $expression.=';my $type="fml";';
 		} elsif ($$tagstack[-1] eq 'numericalresponse') {