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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 19 May 2003 21:15:21 -0000


albertel		Mon May 19 17:15:21 2003 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - stop showing pororly formatted answers BUG#1366
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.101 loncom/homework/caparesponse/caparesponse.pm:1.102
--- loncom/homework/caparesponse/caparesponse.pm:1.101	Wed May 14 09:33:00 2003
+++ loncom/homework/caparesponse/caparesponse.pm	Mon May 19 17:15:21 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.101 2003/05/14 13:33:00 albertel Exp $
+# $Id: caparesponse.pm,v 1.102 2003/05/19 21:15:21 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -309,7 +309,7 @@
 	    if ($Apache::inputtags::params{'sig'}) {
 		($sighigh,$siglow)=&get_sigrange($Apache::inputtags::params{'sig'});
 	    }
-	    if ($fmt) {
+	    if ($fmt && $$tagstack[-1] eq 'numericalresponse') {
 		$ans = sprintf('%.'.$fmt,$ans);
 		if ($high) {
 		    $high=sprintf('%.'.$fmt,$high);
@@ -317,8 +317,8 @@
 		}
 	    }
 	    if ($target eq 'answer') {
-		if ($high) { $ans.=' ['.$low.','.$high.']'; }
-		if ($sighigh) {
+		if ($high && $$tagstack[-1] eq 'numericalresponse') { $ans.=' ['.$low.','.$high.']'; }
+		if ($sighigh && $$tagstack[-1] eq 'numericalresponse') {
 		    if ($ENV{'form.answer_output_mode'} eq 'tex') {
 			$ans.= " Sig \\textit{$siglow - $sighigh}";
 		    } else {
@@ -334,7 +334,8 @@
 		}
 	    }
 	}
-	if ($unit) {
+	if (defined($unit) and ($unit ne '') and
+	    $$tagstack[-1] eq 'numericalresponse') {
 	    if ($target eq 'answer') {
 		if ($ENV{'form.answer_output_mode'} eq 'tex') {
 		    $result.=&Apache::response::answer_part($$tagstack[-1],