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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 22 Sep 2003 18:47:59 -0000


albertel		Mon Sep 22 14:47:59 2003 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - remove texaward
  - once last e to E change
  
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.111 loncom/homework/caparesponse/caparesponse.pm:1.112
--- loncom/homework/caparesponse/caparesponse.pm:1.111	Mon Sep 22 14:38:59 2003
+++ loncom/homework/caparesponse/caparesponse.pm	Mon Sep 22 14:47:59 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.111 2003/09/22 18:38:59 sakharuk Exp $
+# $Id: caparesponse.pm,v 1.112 2003/09/22 18:47:59 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -171,18 +171,13 @@
 	my $status = $Apache::inputtags::status['-1'];
 	if (   ($award =~ /^correct/
                 && lc($Apache::lonhomework::problemstatus) ne 'no')
-             || $status eq "SHOW_ANSWER"
-             || $ENV{'form.texaward'} eq 'SHOW_ANSWER') {
+	       || $status eq "SHOW_ANSWER") {
 	    my (@formats)=&Apache::lonxml::get_param_var('format',$parstack,
 							 $safeeval);
 	    my $unit=&Apache::lonxml::get_param_var('unit',$parstack,
 						    $safeeval);
 	    if ($target eq 'web') {
 		$result="<br />The correct answer is ";
-	    } elsif ($target eq 'tex') {
-		if ($ENV{'form.texaward'} eq 'SHOW_ANSWER') {
-		    $result='\vskip 0 mm The correct answer is \\texttt{ ';
-		}
 	    }
 	    for (my $i=0; $i <= $#answers; $i++) {
 		my $answer=$answers[$i];
@@ -201,9 +196,6 @@
 		    &Apache::lonxml::debug("no format answer :$answer:");
 		    $formatted="$answer,";
 		}
-		if ($ENV{'form.texaward'} eq 'SHOW_ANSWER') {
-		    $result.=$formatted;
-		}
 		if ($target eq 'tex') {
 		    $formatted='';
 		    #$formatted=&Apache::lonxml::latex_special_symbols($formatted);
@@ -213,11 +205,6 @@
 	    chop $result;
 	    if ($target eq 'web') {
 		$result.=" $unit.<br />";
-	    } elsif ($target eq 'tex') {		
-		if ($ENV{'form.texaward'} eq 'SHOW_ANSWER') {
-		    $result.=&Apache::lonxml::latex_special_symbols($unit);
-		    $result.="}. \\vskip 0 mm ";
-		}
 	    }
 	}
 	if ($Apache::lonhomework::type eq 'exam') {
@@ -315,6 +302,7 @@
 		($sighigh,$siglow)=&get_sigrange($Apache::inputtags::params{'sig'});
 	    }
 	    if ($fmt && $$tagstack[-1] eq 'numericalresponse') {
+		$fmt=~s/e/E/g;
 		$ans = sprintf('%.'.$fmt,$ans);
 		if ($high) {
 		    $high=sprintf('%.'.$fmt,$high);