Annotation of loncom/homework/randomlabel.pm, revision 1.63
1.1 tsai 1: # The LearningOnline Network with CAPA
2: # random labelling tool
1.8 albertel 3: #
1.63 ! albertel 4: # $Id: randomlabel.pm,v 1.62 2004/11/13 19:39:45 albertel Exp $
1.8 albertel 5: #
6: # Copyright Michigan State University Board of Trustees
7: #
8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
9: #
10: # LON-CAPA is free software; you can redistribute it and/or modify
11: # it under the terms of the GNU General Public License as published by
12: # the Free Software Foundation; either version 2 of the License, or
13: # (at your option) any later version.
14: #
15: # LON-CAPA is distributed in the hope that it will be useful,
16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: # GNU General Public License for more details.
19: #
20: # You should have received a copy of the GNU General Public License
21: # along with LON-CAPA; if not, write to the Free Software
22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23: #
24: # /home/httpd/html/adm/gpl.txt
25: #
26: # http://www.lon-capa.org/
27: #
1.3 tsai 28: # 7/20/2001 Isaac Tsai, initial syntax
29: # 8/10/2001 Isaac Tsai,
30: # 8/30/2001 Isaac Tsai,
1.1 tsai 31: # SYNTAX:
1.4 albertel 32: # <randomlabel bgimg="URL" width="12" height="45" texwidth="50">
33: # <labelgroup name="GroupOne" type="image">
34: # <location x="123" y="456" />
35: # <location x="321" y="654" />
36: # <location x="213" y="546" />
37: # <label description="TEXT-1">IMG-URL</label>
38: # <label description="TEXT-2">IMG-URL</label>
39: # <label description="TEXT-3">IMG-URL</label>
1.1 tsai 40: # </labelgroup>
1.4 albertel 41: # <labelgroup name="GroupTwo" type="text">
42: # <location x="12" y="45" />
43: # <location x="32" y="65" />
44: # <location x="21" y="54" />
1.3 tsai 45: # <label>TEXT-1</label>
46: # <label>TEXT-2</label>
47: # <label>TEXT-3</label>
1.1 tsai 48: # </labelgroup>
49: # </randomlabel>
50: # ===========================================
1.3 tsai 51: # side effect:
52: # location (123,456): $GroupOne[0] = 2 # images give out indexes
53: # (321,654): $GroupOne[1] = 1
54: # (213,546): $GroupOne[2] = 0
55: # location (12,45) : $GroupTwo[0] = "TEXT-3"
56: # (32,65) : $GroupTwo[1] = "TEXT-1"
57: # (21,54) : $GroupTwo[2] = "TEXT-2"
1.1 tsai 58: # ===========================================
59: package Apache::randomlabel;
1.24 sakharuk 60: use Apache::lonnet;
1.1 tsai 61: use strict;
1.13 sakharuk 62: use Apache::edit;
1.36 sakharuk 63: use Apache::File();
1.38 sakharuk 64: use Apache::Constants qw(:common :http);
1.1 tsai 65:
1.53 albertel 66: my %args;
67: my $cgi_id;
68:
1.13 sakharuk 69: BEGIN {
1.57 albertel 70: &Apache::lonxml::register('Apache::randomlabel',('randomlabel','labelgroup','location','label','bgimg'));
1.1 tsai 71: }
72:
1.23 matthew 73: sub check_int {
74: # utility function to do error checking on a integer.
75: my ($num,$default) = @_;
76: $default = 100 if (! defined($default));
77: $num =~ s/\s+//g; # We dont need no stinkin white space!
78: # If it is a real, just grab the integer part.
79: ($num,undef) = split (/\./,$num) if ($num =~ /\./);
80: # set to default if what we have left doesn't match anything...
81: $num = $default unless ($num =~/^\d+$/);
82: return $num;
83: }
84:
1.1 tsai 85: sub start_randomlabel {
1.47 albertel 86: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
87: my $result='';
88: push (@Apache::lonxml::namespace,'randomlabel');
89: my $bgimg= &Apache::lonxml::get_param('bgimg',$parstack,$safeeval);
1.60 albertel 90: if ( defined($bgimg) && $bgimg !~ /^http:/ ) {
1.47 albertel 91: $bgimg=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$bgimg);
92: if (&Apache::lonnet::repcopy($bgimg) ne OK) {
93: $bgimg='/home/httpd/html/adm/lonKaputt/lonlogo_broken.gif';
94: }
1.42 www 95: }
1.59 albertel 96: $Apache::randomlabel::obj_cnt=0;
1.47 albertel 97: if ($target eq 'web') {
1.53 albertel 98: $cgi_id=&Apache::loncommon::get_cgi_id();
99: %args=();
100: $args{"cgi.$cgi_id.BGIMG"}=&Apache::lonnet::escape($bgimg);
1.47 albertel 101: } elsif ($target eq 'tex') {
1.57 albertel 102: my $w= &check_int(&Apache::lonxml::get_param('width',$parstack,$safeeval));
103: my $h= &check_int(&Apache::lonxml::get_param('height',$parstack,$safeeval));
104: my $texwidth=&adjust_textwidth(&Apache::lonxml::get_param('texwidth',$parstack,$safeeval,undef,1));
105: if (!$texwidth) { $texwidth=90; }
106: $result.=&make_eps_image($bgimg,$texwidth,$h,$w);
1.47 albertel 107: } elsif ($target eq 'edit') {
108: $result.=&Apache::edit::tag_start($target,$token);
109: $Apache::edit::bgimgsrc=
110: &Apache::lonxml::get_param('bgimg',$parstack,$safeeval);
111: $Apache::edit::bgimgsrccurdepth=$Apache::lonxml::curdepth;
112: $result.=&Apache::edit::text_arg('Image:','bgimg',$token,75).' ';
113: $result.=&Apache::edit::browse('bgimg').' ';
114: $result.=&Apache::edit::search('bgimg').'<br />'.
115: &Apache::edit::text_arg('Width(pixel):' ,'width' ,$token,6).
116: &Apache::edit::text_arg('Height(pixel):','height' ,$token,6).
117: &Apache::edit::text_arg('TeXWidth(mm):' ,'texwidth',$token,6).
118: &Apache::edit::end_row().&Apache::edit::start_spanning_row();
119: } elsif ($target eq 'modified') {
120: my $constructtag=&Apache::edit::get_new_args($token,$parstack,
121: $safeeval,'bgimg','width',
122: 'height','texwidth');
123: if ($constructtag) {
124: $result = &Apache::edit::rebuild_tag($token);
125: $result.=&Apache::edit::handle_insert();
126: }
1.31 sakharuk 127: }
1.47 albertel 128: return $result;
1.1 tsai 129: }
130:
131: sub end_randomlabel {
1.47 albertel 132: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
133: my $result='';
134: my $count;
135: pop @Apache::lonxml::namespace;
136: if ($target eq 'web') {
1.59 albertel 137: $count = $Apache::randomlabel::obj_cnt;
138: if( $count != 0) { $args{"cgi.$cgi_id.OBJCOUNT"}=$count; }
1.53 albertel 139: $result.='<img src="/adm/randomlabel.png?token='.$cgi_id.'" /><br />'."\n";
140: &Apache::lonnet::appenv(%args);
1.47 albertel 141: } elsif ($target eq 'tex') {
142: $result='\end{picture}\\\\';
143: my $height=&Apache::lonxml::get_param('height',$parstack,$safeeval);
144: my $width=&Apache::lonxml::get_param('width',$parstack,$safeeval);
1.50 sakharuk 145: my $texwidth=&adjust_textwidth(&Apache::lonxml::get_param('texwidth',$parstack,$safeeval,undef,1));
1.49 albertel 146: if (!$texwidth) { $texwidth=90; }
1.62 albertel 147: # what if width is undefined?
1.47 albertel 148: my $howtoskipback = $texwidth*$height/$width;
149: $result.= ' \vskip -'.$howtoskipback.' mm } \\\\ ';
150: } elsif ($target eq 'edit') {
151: $result.=&Apache::edit::end_table;
152: }
153: return $result;
1.1 tsai 154: }
155:
1.57 albertel 156: sub start_bgimg {
157: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
158: my $result='';
159: if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
160: &Apache::lonxml::startredirection;
161: }
162: return $result;
163: }
164:
165: sub end_bgimg {
166: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
167: my $result='';
168: if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
169: my $bgimg=&Apache::lonxml::endredirection;
170: if ($target eq 'web') {
171: $bgimg=&Apache::imageresponse::clean_up_image($bgimg);
172: $args{"cgi.$cgi_id.BGIMG"}=&Apache::lonnet::escape($bgimg);
173: } elsif ($target eq 'tex') {
174: my $w=&check_int(&Apache::lonxml::get_param('width',$parstack,$safeeval,-2));
175: my $h=&check_int(&Apache::lonxml::get_param('height',$parstack,$safeeval,-2));
176: my $texwidth=&adjust_textwidth(&Apache::lonxml::get_param('texwidth',$parstack,$safeeval,undef,-2));
177: if (!$texwidth) { $texwidth=90; }
178: $result.=&make_eps_image($bgimg,$texwidth,$h,$w);
179: }
180: }
181: return $result;
182: }
183:
184: sub make_eps_image {
185: my ($bgimg,$texwidth,$h,$w)=@_;
186: my $newbgimg = $bgimg;
187: $bgimg=~s/\.(gif|jpg|png|jpeg)$/\.eps/i;
188: $bgimg= &Apache::lonnet::filelocation($bgimg);
189: $bgimg=~s|http:/[^/]*|/home/httpd/html|;
190: $bgimg=~s|/$||;
191: #if no eps file try to replicate it
192: if (not-e $bgimg) {
193: if (&Apache::lonnet::repcopy($bgimg) ne OK ) {
194: #if replication failed try to find ps file
195: $bgimg=~s/\.eps$/\.ps/;
196: #if no ps file try to replicate it
197: if (not -e $bgimg &&
198: &Apache::lonnet::repcopy($bgimg) ne OK) {
199: #if replication failed try to produce eps file dynamically
200: $bgimg=~s/\.ps$/\.eps/;
201: my $temp_file;
202: my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat";
203: $temp_file = Apache::File->new('>>'.$filename);
204: $newbgimg =~ s|(.*)/res/|/home/httpd/html/res/|;
205: print $temp_file "$newbgimg\n";
206: $bgimg=~s|/home/httpd/html/res|/home/httpd/prtspool|;
207: $bgimg=~s|/home/([^/]*)/public_html/|/home/httpd/prtspool/$1/|;
208: }
209: }
210: }
211: $bgimg=~s|/$||;
212: my $dirtywidth=$texwidth+5;
213: my $result.='\vspace*{2mm}\noindent \parbox{'.$dirtywidth.
214: ' mm}{ \noindent \epsfxsize='.$texwidth.' mm \epsffile{'.$bgimg.
215: '}\setlength{\unitlength}{1mm} \begin{picture}('.
216: $texwidth.','.$texwidth*$h/$w.')(0,-'.$texwidth*$h/$w.')';
217: return $result;
218: }
219:
1.50 sakharuk 220: sub adjust_textwidth {
221: my $texwidth=shift;
222: my $pagewidth=$ENV{'form.textwidth'};
223: $pagewidth=~s/\s*mm\s*$//;
224: if ($texwidth>$pagewidth) {$texwidth=$pagewidth;}
225: return $texwidth;
226: }
227:
1.1 tsai 228: sub start_labelgroup {
1.47 albertel 229: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
230: my $result='';
231: my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
232: my $type = &Apache::lonxml::get_param('type',$parstack,$safeeval);
233: $type =~tr/A-Z/a-z/;
1.48 albertel 234: if ($target ne 'modified' && ($name =~ /\W/ || $name =~ /^[0-9]/)) {
235: &Apache::lonxml::error("Only _ a-z A-Z and 0-9 are allowed in the name to a labelgroup, and the first character can not be a number.<br />");
236: }
1.47 albertel 237: if ($target eq 'web' || $target eq 'tex' ||
238: $target eq 'grade' || $target eq 'answer' || $target eq 'analyze') {
239: $Apache::randomlabel::groupname=$name;
240: $Apache::randomlabel::type=$type;
241: @Apache::randomlabel::xcoord = ();
242: @Apache::randomlabel::ycoord = ();
243: @Apache::randomlabel::value = ();
244: @Apache::randomlabel::label_arr = ();
245: @Apache::randomlabel::decription = ();
246: } elsif ($target eq 'edit') {
247: $result.=&Apache::edit::tag_start($target,$token);
248: $result.=&Apache::edit::text_arg('Name:','name',$token).
1.63 ! albertel 249: &Apache::edit::select_arg('Type:','type',['text','image'],$token);
! 250: if (!defined($token->[2]{'TeXsize'})) {
! 251: $token->[2]{'TeXsize'}='\normalsize';
! 252: }
! 253: $result.=&Apache::edit::select_arg('TeX font size:','TeXsize',
! 254: ['\tiny','\scriptsize',
! 255: '\footnotesize','\small',
! 256: '\normalsize','\large','\Large',
! 257: '\LARGE','\huge','\Huge'],
! 258: $token);
! 259: $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
1.47 albertel 260: } elsif ($target eq 'modified') {
261: my $constructtag=&Apache::edit::get_new_args($token,$parstack,
1.63 ! albertel 262: $safeeval,'name','type',
! 263: 'TeXsize');
1.47 albertel 264: if ($constructtag) {
265: $result = &Apache::edit::rebuild_tag($token);
266: $result.=&Apache::edit::handle_insert();
267: }
1.4 albertel 268: }
1.47 albertel 269: return $result;
1.1 tsai 270: }
271:
1.5 albertel 272: sub add_vars {
1.47 albertel 273: my ($name,$order,$label,$labelorder,$value,$image,$safeeval) = @_;
1.61 albertel 274: if (!defined($name) || $name eq '') { return; }
1.47 albertel 275: my $code = '${'.$name."}{'".($order+1)."'}='".$label."';";
276: my $out=Apache::run::run($code,$safeeval);
277: if ($value) {
278: $code = '${'.$name."}{'value_".($order+1)."'}='".$value."';";
279: $out=Apache::run::run($code,$safeeval);
280: $code = '${'.$name."}{'labelvalue_".($labelorder+1)."'}='".$value."';";
281: $out=Apache::run::run($code,$safeeval);
282: }
283: if ($image) {
284: my $code = '${'.$name."}{'image_".($order+1)."'}='".$image."';";
285: my $out=Apache::run::run($code,$safeeval);
286: }
287: $code = '${'.$name."}{'numlocations'}='".($order+1)."';";
1.5 albertel 288: $out=Apache::run::run($code,$safeeval);
1.4 albertel 289: }
1.5 albertel 290:
1.1 tsai 291: # begin to assign labels to locations
292: sub end_labelgroup {
1.47 albertel 293: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
294: my $gname = $Apache::randomlabel::groupname;
295: my $type = $Apache::randomlabel::type;
296: my $result='';
297: if ($target eq 'web' || $target eq 'answer' || $target eq 'grade' ||
298: $target eq 'analyze') {
299: my @idx_arr = (0 .. $#Apache::randomlabel::label_arr);
300: &Apache::structuretags::shuffle(\@idx_arr);
301: for(0 .. $#Apache::randomlabel::label_arr) {
302: my $str;
303: my $label = "$Apache::randomlabel::label_arr[ $idx_arr[$_] ]";
304: my $x = $Apache::randomlabel::xcoord[$_];
305: my $y = $Apache::randomlabel::ycoord[$_];
306: my $value = $Apache::randomlabel::value[$_];
1.59 albertel 307: my $i=$Apache::randomlabel::obj_cnt++;
1.47 albertel 308: if( $type eq 'text') {
309: &add_vars($gname,$_,$label,$idx_arr[$_],$value,'',$safeeval);
1.59 albertel 310: $str = join(':',$x,$y,&Apache::lonnet::escape($label));
311: $args{"cgi.$cgi_id.OBJTYPE"}.='LABEL:';
1.47 albertel 312: } elsif ( $type eq 'image') {
313: &add_vars($gname,$_,
314: $Apache::randomlabel::description[$idx_arr[$_]],
315: $idx_arr[$_],$value,$label,$safeeval);
1.59 albertel 316: $str = join(':',$x,$y,&Apache::lonnet::escape($label));
317: $args{"cgi.$cgi_id.OBJTYPE"}.='IMAGE:';
1.47 albertel 318: } else {
319: &Apache::lonxml::error('Unknown type of label :'.$type.':');
320: }
1.59 albertel 321: if ($target eq 'web') { $args{"cgi.$cgi_id.OBJ$i"} =$str; }
1.47 albertel 322: }
323: } elsif ($target eq 'tex') {
324: my $WX1=0; # Web x-coord. of upper left corner (ULC)
325: my $WY1=0; # Web y-coord. of (ULC)
326: my $wwidth=&Apache::lonxml::get_param('width',$parstack,$safeeval,-2);
327: my $wheight=&Apache::lonxml::get_param('height',$parstack,$safeeval,-2);
1.50 sakharuk 328: my $texwidth=&adjust_textwidth(&Apache::lonxml::get_param('texwidth',$parstack,$safeeval,-2,1));
1.63 ! albertel 329: my $TeXsize=&Apache::lonxml::get_param('TeXsize',$parstack,$safeeval);
! 330: if (!defined($TeXsize)) { $TeXsize='\\normalsize'; }
1.49 albertel 331: if (!$texwidth) { $texwidth=90; }
1.62 albertel 332: my $texheight=$texwidth*($wheight/$wwidth);
333:
1.47 albertel 334: my @idx_arr = (0 .. $#Apache::randomlabel::label_arr);
335: &Apache::structuretags::shuffle(\@idx_arr);
336:
337: &Apache::lonxml::debug("Array is:".$#Apache::randomlabel::label_arr.":");
338: for(my $i=0;$i <= $#Apache::randomlabel::label_arr; $i++) {
339: my $label = "$Apache::randomlabel::label_arr[ $idx_arr[$i] ]";
340: my $x = $Apache::randomlabel::xcoord[$i];
1.62 albertel 341: # FIXME the 3.5 here is the 'height' of the letter in TeX
342: my $y = $Apache::randomlabel::ycoord[$i]-3.5;
1.47 albertel 343: my $value = $Apache::randomlabel::value[$i];
344: #x latex coordinate
345: my $tcX=($x)*($texwidth/$wwidth);
346: #y latex coordinate
347: # my $ratio=($wwidth > 0 ? $wheight/$wwidth : 1 );
1.62 albertel 348: my $tcY=$texheight-$y*($texheight/$wheight);
1.47 albertel 349: $tcX=sprintf('%.2f',$tcX);
350: $tcY=sprintf('%.2f',$tcY);
1.63 ! albertel 351: $result.='\put('.$tcX.','.$tcY.'){'.$TeXsize.' \bf '.$label.'}'."\n";
1.47 albertel 352: if( $type eq 'text') {
353: &add_vars($gname,$i,$label,$idx_arr[$i],$value,'',$safeeval);
354: } elsif ( $type eq 'image') {
355: &add_vars($gname,$i,
356: $Apache::randomlabel::description[$idx_arr[$i]],
357: $idx_arr[$i],$value,$label,$safeeval);
358: } else {
359: &Apache::lonxml::error('Unknown type of label :'.$type.':');
360: }
361: }
362: } elsif ($target eq 'edit') {
363: $result.=&Apache::edit::end_table;
1.3 tsai 364: }
1.47 albertel 365: return $result;
1.1 tsai 366: }
367:
1.5 albertel 368: # <location x="123" y="456" value="some value"/>
1.1 tsai 369: sub start_location {
1.47 albertel 370: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
371: my $x= &check_int(&Apache::lonxml::get_param('x',$parstack,$safeeval),50);
372: my $y= &check_int(&Apache::lonxml::get_param('y',$parstack,$safeeval),50);
373: my $value= &Apache::lonxml::get_param('value',$parstack,$safeeval);
374: my $result='';
375: push(@Apache::randomlabel::xcoord,$x);
376: push(@Apache::randomlabel::ycoord,$y);
377: push(@Apache::randomlabel::value,$value);
378: if ($target eq 'edit') {
379: $result.=&Apache::edit::tag_start($target,$token);
380: $result.=&Apache::edit::text_arg('X:','x',$token,4).
381: &Apache::edit::text_arg('Y:','y',$token,4).
382: &Apache::edit::entercoords('x','y','attribute','width','height').' '.
383: &Apache::edit::text_arg('Value:','value',$token).
384: &Apache::edit::end_row();
385: $result.=&Apache::edit::end_table;
386: } elsif ($target eq 'modified') {
387: my $constructtag=&Apache::edit::get_new_args($token,$parstack,
388: $safeeval,'x','y','value');
389: if ($constructtag) {
390: $result = &Apache::edit::rebuild_tag($token);
391: $result.=&Apache::edit::handle_insert();
392: }
1.4 albertel 393: }
1.47 albertel 394: return $result;
1.1 tsai 395: }
396:
397: sub end_location {
1.47 albertel 398: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
399: my @result;
400: if ($target eq 'edit') { @result=('','no') }
401: return @result;
1.1 tsai 402: }
403:
1.2 tsai 404: # <label>$var_abc</label>
1.1 tsai 405: sub start_label {
1.47 albertel 406: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
407: my $result='';
408: my $type = &Apache::lonxml::get_param('type',$parstack,$safeeval,-2);
409: if ($target eq 'web' || $target eq 'tex' ||
410: $target eq 'grade' || $target eq 'answer' || $target eq 'analyze') {
1.57 albertel 411: &Apache::lonxml::startredirection;
1.47 albertel 412: } elsif ($target eq 'edit') {
413: $result.=&Apache::edit::tag_start($target,$token,"$type Label");
414: my $text=&Apache::lonxml::get_all_text("/label",$parser);
415: if ($type eq 'image') {
416: $result.=&Apache::edit::end_row().
417: &Apache::edit::start_spanning_row();
418: $result.=&Apache::edit::text_arg('Description:','description',
419: $token);
420: }
421: if ($type eq 'text') { $result.="Label Text:"; }
422: if ($type eq 'image') { $result.="Path to image: "; }
423: $result.=&Apache::edit::editline('',$text,'',50).
424: &Apache::edit::end_table();
425: } elsif ($target eq 'modified') {
426: $result = '<label>';
427: if ($type eq 'image') {
428: my $constructtag=&Apache::edit::get_new_args($token,$parstack,
429: $safeeval,
430: 'description');
431: if ($constructtag) {
432: $result = &Apache::edit::rebuild_tag($token);
433: } else {
434: $result = $token->[4];
435: }
436: }
1.52 albertel 437: $result.=&Apache::edit::modifiedfield("/label",$parser);
1.26 albertel 438: }
1.47 albertel 439: return $result;
1.1 tsai 440: }
441:
442: sub end_label {
1.47 albertel 443: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
444: my @result;
1.57 albertel 445: if ($target eq 'edit') {
446: @result=('','no') ;
447: } elsif ($target eq 'web' || $target eq 'tex' || $target eq 'grade' ||
448: $target eq 'answer' || $target eq 'analyze') {
449: my $type = &Apache::lonxml::get_param('type',$parstack,$safeeval,-2);
450: my $ltext=&Apache::lonxml::endredirection;
451: if ($type eq 'image') {
452: &Apache::lonxml::debug("Turning $ltext, $Apache::lonxml::pwd[-1]");
453: $ltext=&Apache::imageresponse::clean_up_image($ltext);
454: # $ltext=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],
455: # $ltext);
456: &Apache::lonxml::debug("into $ltext");
457: my $description = &Apache::lonxml::get_param('description',
458: $parstack,$safeeval);
459: push(@Apache::randomlabel::description,$description);
1.61 albertel 460: } else {
461: $ltext=~s/[\r\n]*//gs
1.57 albertel 462: }
463: push(@Apache::randomlabel::label_arr,$ltext);
464: }
1.47 albertel 465: return @result;
1.1 tsai 466: }
467:
468: 1;
469: __END__
470:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>