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

sakharuk lon-capa-cvs@mail.lon-capa.org
Mon, 26 Aug 2002 19:44:33 -0000


sakharuk		Mon Aug 26 15:44:33 2002 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  Prints what computer got in the same way as for the web output.
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.52 loncom/homework/caparesponse/caparesponse.pm:1.53
--- loncom/homework/caparesponse/caparesponse.pm:1.52	Thu Apr 11 15:48:16 2002
+++ loncom/homework/caparesponse/caparesponse.pm	Mon Aug 26 15:44:33 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.52 2002/04/11 19:48:16 albertel Exp $
+# $Id: caparesponse.pm,v 1.53 2002/08/26 19:44:33 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -156,7 +156,7 @@
 	$result='';
       }
     }
-  } elsif ($target eq 'web') {
+  } elsif ($target eq 'web' || $target eq 'tex') {
     my $award = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"};
     my $status = $Apache::inputtags::status['-1'];
     if ($award =~ /^correct/ || $status eq "SHOW_ANSWER" ) {
@@ -166,8 +166,11 @@
 						   $safeeval);
       my $unit=&Apache::lonxml::get_param_var('unit',$parstack,$safeeval);
 
-      $result="<br />The computer got ";
-
+      if ($target eq 'web') {
+	  $result="<br />The computer got ";
+      } elsif ($target eq 'tex') {
+	  $result='\vskip 0 mm The computer got ';
+      }
       for (my $i=0; $i <= $#answers; $i++) {
 	my $answer=$answers[$i];
 	my $format;
@@ -185,7 +188,11 @@
 	}
       }
       chop $result;
-      $result.=" $unit.<br></br>";
+     if ($target eq 'web') {
+	 $result.=" $unit.<br></br>";
+      } elsif ($target eq 'tex') {
+	  $result.=" $unit.\\vskip 0 mm ";
+      }
     }
   } elsif ($target eq 'edit') {
     $result.='</td></tr>'.&Apache::edit::end_table;