Diff for /loncom/homework/randomlabel.pm between versions 1.89 and 1.91.2.1

version 1.89, 2007/06/20 17:33:33 version 1.91.2.1, 2008/12/21 15:10:12
Line 61  use Apache::File(); Line 61  use Apache::File();
 use Apache::Constants qw(:common :http);  use Apache::Constants qw(:common :http);
 use Image::Magick;  use Image::Magick;
 use Apache::lonplot;  use Apache::lonplot;
 use lib '/home/httpd/lib/perl/';  
 use LONCAPA;  use LONCAPA;
     
   
Line 131  sub start_randomlabel { Line 130  sub start_randomlabel {
     $label_xscale = 1.0; # Assume image size not overridden.      $label_xscale = 1.0; # Assume image size not overridden.
     $label_yscale = 1.0;      $label_yscale = 1.0;
     my $bgimg= &Apache::lonxml::get_param('bgimg',$parstack,$safeeval);      my $bgimg= &Apache::lonxml::get_param('bgimg',$parstack,$safeeval);
     if ( defined($bgimg) && $bgimg !~ /^http:/ ) {      if ( defined($bgimg) && $bgimg !~ /^https?\:/ ) {
  $bgimg=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$bgimg);   $bgimg=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$bgimg);
  if (&Apache::lonnet::repcopy($bgimg) ne 'ok') {   if (&Apache::lonnet::repcopy($bgimg) ne 'ok') {
     $bgimg='/home/httpd/html/adm/lonKaputt/lonlogo_broken.gif';      $bgimg='/home/httpd/html/adm/lonKaputt/lonlogo_broken.gif';
Line 179  sub end_randomlabel { Line 178  sub end_randomlabel {
  $count = $Apache::randomlabel::obj_cnt;   $count = $Apache::randomlabel::obj_cnt;
  if( $count != 0) { $args{"cgi.$cgi_id.OBJCOUNT"}=$count; }   if( $count != 0) { $args{"cgi.$cgi_id.OBJCOUNT"}=$count; }
  $result.='<img src="/adm/randomlabel.png?token='.$cgi_id.'" /><br />'."\n";   $result.='<img src="/adm/randomlabel.png?token='.$cgi_id.'" /><br />'."\n";
  &Apache::lonnet::appenv(%args);   &Apache::lonnet::appenv(\%args);
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $result='\end{picture}\\\\';   $result='\end{picture}\\\\';
  $result.= ' \vskip -'.$height_param.' mm }  \\\\ ';   $result.= ' \vskip -'.$height_param.' mm }  \\\\ ';
Line 553  sub end_location { Line 552  sub end_location {
 }  }
   
 # <label>$var_abc</label>  # <label>$var_abc</label>
   sub insert_label {
       my ($after) = @_;
       my $depth = scalar(@Apache::lonxml::depthcounter);
       $depth-- if ($after);
       my $inset = "\t"x$depth;
       return "\n$inset<label></label>";
   }
   
 sub start_label {  sub start_label {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result='';      my $result='';

Removed from v.1.89  
changed lines
  Added in v.1.91.2.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>