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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 14 Jul 2005 02:52:22 -0000


albertel		Wed Jul 13 22:52:22 2005 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - removing the tolerance/sigfig info from a formularesponse 
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.174 loncom/homework/caparesponse/caparesponse.pm:1.175
--- loncom/homework/caparesponse/caparesponse.pm:1.174	Mon Jul 11 14:35:23 2005
+++ loncom/homework/caparesponse/caparesponse.pm	Wed Jul 13 22:52:22 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.174 2005/07/11 18:35:23 albertel Exp $
+# $Id: caparesponse.pm,v 1.175 2005/07/14 02:52:22 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -386,18 +386,22 @@
 						 $parstack,$safeeval);
 	    my ($ad,$msg) =&Apache::inputtags::finalizeawards($awards,$msgs);
 	    if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') {
-		# answer failed check if it is sig figs that is failing
-		my ($awards,$msgs)=&check_submission($response,$partid,$id,
-						     $tag,$parstack,$safeeval,
-						     1);
-		my ($ad,$msg)=&Apache::inputtags::finalizeawards($awards,
-								 $msgs);
-
 		my $error;
-		if ($siglow ne '' && $sighigh ne '') {
-		    $error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range ("[_2]" to "[_3]") or significant figures ("[_4]" to "[_5]") need to be adjusted.',$response,$low,$high,$siglow,$sighigh);
+		if ($tag eq 'formularesponse') {
+		    $error=&mt('Computer\'s answer is incorrect ("[_1]").');
 		} else {
-		    $error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range ("[_2]" to "[_3]") needs to be adjusted.',$response,$low,$high);
+		    # answer failed check if it is sig figs that is failing
+		    my ($awards,$msgs)=&check_submission($response,$partid,$id,
+							 $tag,$parstack,
+							 $safeeval,1);
+		    ($ad,$msg)=&Apache::inputtags::finalizeawards($awards,
+								  $msgs);
+		    
+		    if ($siglow ne '' && $sighigh ne '') {
+			$error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range ("[_2]" to "[_3]") or significant figures ("[_4]" to "[_5]") need to be adjusted.',$response,$low,$high,$siglow,$sighigh);
+		    } else {
+			$error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range ("[_2]" to "[_3]") needs to be adjusted.',$response,$low,$high);
+		    }
 		}
 		if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') {
 		    &Apache::lonxml::error($error);