Diff for /loncom/homework/imageresponse.pm between versions 1.76 and 1.79

version 1.76, 2006/03/09 01:37:39 version 1.79, 2006/11/06 11:56:23
Line 37  use Apache::londefdef(); Line 37  use Apache::londefdef();
 use Apache::Constants qw(:common :http);  use Apache::Constants qw(:common :http);
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonnet;  use Apache::lonnet;
   use lib '/home/httpd/lib/perl/';
   use LONCAPA;
    
   
 BEGIN {  BEGIN {
     &Apache::lonxml::register('Apache::imageresponse',('imageresponse'));      &Apache::lonxml::register('Apache::imageresponse',('imageresponse'));
Line 70  sub end_imageresponse { Line 73  sub end_imageresponse {
     my $result;      my $result;
     if ($target eq 'edit') {      if ($target eq 'edit') {
  $result=&Apache::edit::end_table();   $result=&Apache::edit::end_table();
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex'
        && $Apache::lonhomework::type eq 'exam') {
  $result=&Apache::inputtags::exam_score_line($target);   $result=&Apache::inputtags::exam_score_line($target);
     }      }
   
Line 130  sub prep_image { Line 134  sub prep_image {
     my $respid=$Apache::inputtags::response['-1'];      my $respid=$Apache::inputtags::response['-1'];
     my $id=&Apache::loncommon::get_cgi_id();      my $id=&Apache::loncommon::get_cgi_id();
     my (%x,$i);      my (%x,$i);
     $x{"cgi.$id.BGIMG"}=&Apache::lonnet::escape($image);      $x{"cgi.$id.BGIMG"}=&escape($image);
     my ($x,$y)=split(/:/,$Apache::lonhomework::history{"resource.$part.$respid.submission"});      my ($x,$y)=split(/:/,$Apache::lonhomework::history{"resource.$part.$respid.submission"});
     #draws 2 xs on the image at the clicked location      #draws 2 xs on the image at the clicked location
     #one in white and then one in red on top of the one in white      #one in white and then one in red on top of the one in white
Line 540  sub end_image { Line 544  sub end_image {
     $graphinclude =~ s/^$commentline//;      $graphinclude =~ s/^$commentline//;
  } else {   } else {
     my ($path,$file) = &Apache::londefdef::get_eps_image($src);      my ($path,$file) = &Apache::londefdef::get_eps_image($src);
       $file =~ s/\ /\_/g;
     my ($height_param,$width_param)=      my ($height_param,$width_param)=
  &Apache::londefdef::image_size($src,0.3,$parstack,$safeeval);   &Apache::londefdef::image_size($src,0.3,$parstack,$safeeval);
     $graphinclude = '\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'}';      $graphinclude = '\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'}';

Removed from v.1.76  
changed lines
  Added in v.1.79


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