Diff for /loncom/homework/imageresponse.pm between versions 1.50 and 1.51

version 1.50, 2004/02/24 18:57:43 version 1.51, 2004/03/08 23:23:04
Line 31 Line 31
   
 package Apache::imageresponse;  package Apache::imageresponse;
 use strict;  use strict;
 use Image::Magick;  use Image::Magick();
 use Apache::randomlylabel;  use Apache::randomlylabel();
 use Apache::londefdef;  use Apache::londefdef();
 use Apache::Constants qw(:common :http);  use Apache::Constants qw(:common :http);
   use Apache::lonlocal;
   
 BEGIN {  BEGIN {
     &Apache::lonxml::register('Apache::imageresponse',('imageresponse'));      &Apache::lonxml::register('Apache::imageresponse',('imageresponse'));
Line 49  sub start_imageresponse { Line 50  sub start_imageresponse {
        'polygon','conceptgroup'));         'polygon','conceptgroup'));
     push (@Apache::lonxml::namespace,'imageresponse');      push (@Apache::lonxml::namespace,'imageresponse');
     my $id = &Apache::response::start_response($parstack,$safeeval);      my $id = &Apache::response::start_response($parstack,$safeeval);
       undef(%Apache::response::foilnames);
     if ($target eq 'meta') {      if ($target eq 'meta') {
  $result=&Apache::response::meta_package_write('imageresponse');   $result=&Apache::response::meta_package_write('imageresponse');
     } elsif ($target eq 'analyze') {      } elsif ($target eq 'analyze') {
Line 65  sub end_imageresponse { Line 67  sub end_imageresponse {
     &Apache::lonxml::deregister('Apache::imageresponse',('foilgroup','foil','text','image','rectangle','conceptgroup'));      &Apache::lonxml::deregister('Apache::imageresponse',('foilgroup','foil','text','image','rectangle','conceptgroup'));
     my $result;      my $result;
     if ($target eq 'edit') { $result=&Apache::edit::end_table(); }      if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
       undef(%Apache::response::foilnames);
     return $result;      return $result;
 }  }
   
Line 335  sub start_foil { Line 338  sub start_foil {
  $target eq 'analyze') {   $target eq 'analyze') {
  my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);   my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
  if ($name eq '') { $name=$Apache::lonxml::curdepth; }   if ($name eq '') { $name=$Apache::lonxml::curdepth; }
    if (defined($Apache::response::foilnames{$name})) {
       &Apache::lonxml::error(&mt("Foil name <b><tt>[_1]</tt></b> appears more than once. Foil names need to be unique.",$name));
    }
  if ( $Apache::imageresponse::conceptgroup   if ( $Apache::imageresponse::conceptgroup
      && !&Apache::response::showallfoils()) {       && !&Apache::response::showallfoils()) {
     push(@{ $Apache::response::conceptgroup{'names'} }, $name);      push(@{ $Apache::response::conceptgroup{'names'} }, $name);

Removed from v.1.50  
changed lines
  Added in v.1.51


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