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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 23 Mar 2004 20:38:09 -0000


albertel		Tue Mar 23 15:38:09 2004 EDT

  Modified files:              
    /loncom/homework	drawimage.pm 
  Log:
  - use redirection in <text> so contents get parsed.
  
  
Index: loncom/homework/drawimage.pm
diff -u loncom/homework/drawimage.pm:1.5 loncom/homework/drawimage.pm:1.6
--- loncom/homework/drawimage.pm:1.5	Tue Mar 16 18:08:23 2004
+++ loncom/homework/drawimage.pm	Tue Mar 23 15:38:09 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # programatic image drawing
 #
-# $Id: drawimage.pm,v 1.5 2004/03/16 23:08:23 albertel Exp $
+# $Id: drawimage.pm,v 1.6 2004/03/23 20:38:09 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -76,23 +76,26 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;
     if ($target eq 'web' || $target eq 'tex') {
+	&Apache::lonxml::startredirection();
+    }
+    return $result;
+}
+
+sub end_text {
+    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
+    my $result;
+    if ($target eq 'web' || $target eq 'tex') {
         my $x     = &Apache::lonxml::get_param('x',$parstack,$safeeval);
         my $y     = &Apache::lonxml::get_param('y',$parstack,$safeeval);
         my $font  = &Apache::lonxml::get_param('font',$parstack,$safeeval);
         my $color = &Apache::lonxml::get_param('color',$parstack,$safeeval);
         my $direction = &Apache::lonxml::get_param('direction',$parstack,$safeeval);
-	my $text  = &Apache::lonxml::get_all_text("/text",$parser);
+	my $text  = &Apache::lonxml::endredirection();
         $text = &Apache::lonnet::escape($text);
         $args{"cgi.$cgi_id.OBJTYPE"}.='LABEL:';
 	my $i=$args{"cgi.$cgi_id.OBJCOUNT"}++;
 	$args{"cgi.$cgi_id.OBJ$i"}=join(':',($x,$y,$text,$font,$color,$direction));
     }
-    return $result;
-}
-
-sub end_text {
-    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-    my $result;
     return $result;
 }