Diff for /loncom/homework/chemresponse.pm between versions 1.45 and 1.46

version 1.45, 2005/01/31 22:00:40 version 1.46, 2005/02/17 21:42:37
Line 32  use Apache::lonxml; Line 32  use Apache::lonxml;
 use Apache::lonnet;  use Apache::lonnet;
   
 BEGIN {  BEGIN {
     &Apache::lonxml::register('Apache::chemresponse',('organicresponse','organicstructure','reactionresponse'));      &Apache::lonxml::register('Apache::chemresponse',('organicresponse','organicstructure','reactionresponse','chem'));
 }  }
   
 sub chem_standard_order {  sub chem_standard_order {
Line 431  sub end_reactionresponse { Line 431  sub end_reactionresponse {
     return $result;      return $result;
 }  }
   
   sub start_chem {
       my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;
       my $result = '';
       if ($target eq 'tex' || $target eq 'web') {
    &Apache::lonxml::startredirection();
       }    
       return $result;
   }
   
   sub end_chem {
       my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;
       my $result = '';
       if ($target eq 'tex' || $target eq 'web') {
    @Apache::scripttag::parser_env = @_;
    if (!$Apache::lonxml::default_homework_loaded) {
       &Apache::lonxml::default_homework_load($safeeval);
    }
    my $innards=&Apache::lonxml::endredirection();
    $result=&Apache::run::run("return &chemparse(q\0$innards\0);",$safeeval);
       }
       return $result;
   }
   
 1;  1;
 __END__  __END__

Removed from v.1.45  
changed lines
  Added in v.1.46


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