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

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 25 Apr 2002 21:36:37 -0000


sakharuk		Thu Apr 25 17:36:37 2002 EDT

  Modified files:              
    /loncom/homework	randomlabel.pm 
  Log:
  removed an empty space after figures + small changes + changes in the path to eps files
  
  
Index: loncom/homework/randomlabel.pm
diff -u loncom/homework/randomlabel.pm:1.23 loncom/homework/randomlabel.pm:1.24
--- loncom/homework/randomlabel.pm:1.23	Mon Apr  8 17:28:53 2002
+++ loncom/homework/randomlabel.pm	Thu Apr 25 17:36:36 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # random labelling tool
 #
-# $Id: randomlabel.pm,v 1.23 2002/04/08 21:28:53 matthew Exp $
+# $Id: randomlabel.pm,v 1.24 2002/04/25 21:36:36 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -57,6 +57,7 @@
 #             (21,54)  : $GroupTwo[2] = "TEXT-2"
 #  ===========================================
 package Apache::randomlabel;
+use Apache::lonnet;
 use strict;
 use Apache::edit;
 
@@ -106,9 +107,11 @@
     $result.="<param name=\"bgimg\" value=\"$bgimg\">";
   } elsif ($target eq 'tex') {
     $bgimg=~s/(.gif|.jpg)$/.eps/;
-    $bgimg=~s/http:\/\/[^\/]*/\/home\/httpd\/html/;
+    $bgimg= &Apache::lonnet::filelocation($bgimg);
+    $bgimg=~s/http:\/[^\/]*/\/home\/httpd\/html/;
+    $bgimg=~s/\/$//;
     $result.='\vspace*{2mm}  \noindent \epsfxsize='.$texwidth.' mm \epsffile{'.
-    $bgimg.'}\setlength{\unitlength}{1mm}  \begin{picture}('.$texwidth.','.$texwidth*$h/$w.')'
+    $bgimg.'}\setlength{\unitlength}{1mm}  \begin{picture}(0,0)('.$texwidth.','.$texwidth*$h/$w.')'
   } elsif ($target eq 'edit') {
     $result.=&Apache::edit::tag_start($target,$token);
     $result.=&Apache::edit::text_arg('Image:','bgimg',$token,75).' ';
@@ -142,7 +145,7 @@
     if( $count != 0) { $result.= "<param name=\"icount\" value=\"$count\">"; }
     $result .= "</applet><BR />";
   } elsif ($target eq 'tex') {
-    $result='\end{picture}';
+    $result='\end{picture}\\\\';
   } elsif ($target eq 'edit') {
     $result.=&Apache::edit::end_table;
   }