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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 23 May 2005 21:18:27 -0000


albertel		Mon May 23 17:18:27 2005 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - finally got a chacne to test my code that tries out the instrcutors answer and throws a nut if it isn't correct
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.167 loncom/homework/caparesponse/caparesponse.pm:1.168
--- loncom/homework/caparesponse/caparesponse.pm:1.167	Sat Apr 16 11:36:25 2005
+++ loncom/homework/caparesponse/caparesponse.pm	Mon May 23 17:18:25 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.167 2005/04/16 15:36:25 albertel Exp $
+# $Id: caparesponse.pm,v 1.168 2005/05/23 21:18:25 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -174,10 +174,10 @@
     my $partid = $Apache::inputtags::part;
     my $id = $Apache::inputtags::response[-1];
     my $tag;
+    $safeeval->share_from('capa',['&caparesponse_capa_check_answer']);
     if (scalar(@$tagstack)) { $tag=$$tagstack[-1]; }
     if ( $target eq 'grade' && &Apache::response::submitted() ) {
 	&Apache::response::setup_params($tag,$safeeval);
-	$safeeval->share_from('capa',['&caparesponse_capa_check_answer']);
 	if ($Apache::lonhomework::type eq 'exam' && 
 	    $tag eq 'formularesponse') {
 	    $increment=&Apache::response::scored_response($partid,$id);
@@ -376,7 +376,7 @@
 						 $parstack,$safeeval);
 	    my ($ad,$msg) =&Apache::inputtags::finalizeawards($awards,$msgs);
 	    if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') {
-		&Apache::lonxml::error(&mt('Computer\'s answer is incorrect. It is likely that the tolerance range or significant figures needs to be adjusted'));
+		&Apache::lonxml::error(&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range ("[_2]" to "[_3]") or significant figures ("[_4]" to "[_5]") needs to be adjusted',$response,$low,$high,$siglow,$sighigh));
 	    }
 	}
 	if (defined($unit) and ($unit ne '') and