--- loncom/homework/randomlabel.pm 2002/04/08 21:28:53 1.23
+++ loncom/homework/randomlabel.pm 2002/04/25 21:36:36 1.24
@@ -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 @@ sub start_randomlabel {
$result.="";
} 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 @@ sub end_randomlabel {
if( $count != 0) { $result.= ""; }
$result .= "
";
} elsif ($target eq 'tex') {
- $result='\end{picture}';
+ $result='\end{picture}\\\\';
} elsif ($target eq 'edit') {
$result.=&Apache::edit::end_table;
}