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

sakharuk lon-capa-cvs@mail.lon-capa.org
Mon, 19 May 2003 17:10:12 -0000


sakharuk		Mon May 19 13:10:12 2003 EDT

  Modified files:              
    /loncom/homework	randomlabel.pm 
  Log:
  Bug connected with LaTeX error for printing randomlabel template (with happy face) is fixed. I've just removed a few lines which I've forgetten to remove far long ago when I wrote chunck of code for dynamical creation of eps counterpart of jpg/gif/png original picture. Sorry for this and it's really strange that nobody has noticed this bug earlier.
  
  
Index: loncom/homework/randomlabel.pm
diff -u loncom/homework/randomlabel.pm:1.44 loncom/homework/randomlabel.pm:1.45
--- loncom/homework/randomlabel.pm:1.44	Tue May  6 07:54:08 2003
+++ loncom/homework/randomlabel.pm	Mon May 19 13:10:12 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # random labelling tool
 #
-# $Id: randomlabel.pm,v 1.44 2003/05/06 11:54:08 www Exp $
+# $Id: randomlabel.pm,v 1.45 2003/05/19 17:10:12 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -99,19 +99,18 @@
       &Apache::lonxml::startredirection();
       $result.="BGIMG=".&Apache::lonnet::escape($bgimg);
   } elsif ($target eq 'tex') {
-    my $newbgimg = $bgimg;
-    $bgimg=~s/\.(gif|jpg|png|jpeg)$/\.eps/i;
-    $bgimg= &Apache::lonnet::filelocation($bgimg);
-    if (not $ENV{'request.role'}=~/^au\./) {
-	$bgimg=~s/http:\/[^\/]*/\/home\/httpd\/html/;
-	$bgimg=~s/\/$//;
-        #if no eps file try to replicate it
-	if (not-e $bgimg) {
-	    if (&Apache::lonnet::repcopy($bgimg) ne OK ) {
-		#if replication failed try to find ps file
-		$bgimg=~s/\.eps$/\.ps/;
-		#if no ps file try to replicate it
-		if (not-e $bgimg &&
+      my $newbgimg = $bgimg;
+      $bgimg=~s/\.(gif|jpg|png|jpeg)$/\.eps/i;
+      $bgimg= &Apache::lonnet::filelocation($bgimg);
+      $bgimg=~s/http:\/[^\/]*/\/home\/httpd\/html/;
+      $bgimg=~s/\/$//;
+      #if no eps file try to replicate it
+      if (not-e $bgimg) {
+	  if (&Apache::lonnet::repcopy($bgimg) ne OK ) {
+	      #if replication failed try to find ps file
+	      $bgimg=~s/\.eps$/\.ps/;
+	      #if no ps file try to replicate it
+		if (not -e $bgimg &&
 		    &Apache::lonnet::repcopy($bgimg) ne OK) {
                     #if replication failed try to produce eps file dynamically
 		    $bgimg=~s/\.ps$/\.eps/;
@@ -123,11 +122,8 @@
 		    $bgimg =~ m/\/([^\/]+)$/;
 		    $bgimg = '/home/httpd/prtspool/'.$1;
 		}
-	    }
-	}
-    } else {
-	$bgimg=~s/http:\/[^\/]*\/~([^\/]+)/\/home\/$1\/public_html/;
-    }
+	  }
+      }
     $bgimg=~s/\/$//;
     my $dirtywidth=$texwidth+5;
     if ($texwidth==90) {