Diff for /loncom/homework/chemresponse.pm between versions 1.69 and 1.72

version 1.69, 2006/07/27 20:34:40 version 1.72, 2007/04/18 00:19:37
Line 245  sub start_organicresponse { Line 245  sub start_organicresponse {
  $result .='</nobr><br /><nobr>';   $result .='</nobr><br /><nobr>';
  $result .=&Apache::edit::text_arg('Correct Answer:','answer',   $result .=&Apache::edit::text_arg('Correct Answer:','answer',
   $token,40);    $token,40);
    $result .='</nobr><br /><nobr>';
  $result .=&Apache::edit::text_arg('JME string of the answer (automatically updated when using the Draw Molecule button):',   $result .=&Apache::edit::text_arg('JME string of the answer (automatically updated when using the Draw Molecule button):',
   'jmeanswer',$token);    'jmeanswer',$token);
  my $jmeanswer=&Apache::lonxml::get_param('jmeanswer',$parstack,   my $jmeanswer=&Apache::lonxml::get_param('jmeanswer',$parstack,
Line 466  sub start_reactionresponse { Line 467  sub start_reactionresponse {
  &Apache::lonxml::default_homework_load($safeeval);   &Apache::lonxml::default_homework_load($safeeval);
     }      }
     @Apache::scripttag::parser_env = @_;      @Apache::scripttag::parser_env = @_;
     $Apache::inputtags::answertxt{$id}=&Apache::run::run("return &chemparse(q\0$ans\0);",$safeeval);      $Apache::inputtags::answertxt{$id}=[&Apache::run::run("return &chemparse(q\0$ans\0);",$safeeval)];
  }   }
     } elsif ($target eq "edit") {      } elsif ($target eq "edit") {
  $result .=&Apache::edit::tag_start($target,$token);   $result .=&Apache::edit::tag_start($target,$token);
Line 541  sub end_reactionresponse { Line 542  sub end_reactionresponse {
  }   }
  $result.=&Apache::response::answer_footer('reactionresponse');   $result.=&Apache::response::answer_footer('reactionresponse');
     }      }
       if ($target eq 'web') {
    &Apache::response::setup_prior_tries_hash(\&format_prior_response_reaction);
       }
   
     if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||       if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || 
  $target eq 'tex' || $target eq 'analyze') {   $target eq 'tex' || $target eq 'analyze') {
Line 550  sub end_reactionresponse { Line 554  sub end_reactionresponse {
     return $result;      return $result;
 }  }
   
   sub format_prior_response_reaction {
       my ($mode,$answer) =@_;
       return '<span class="LC_prior_reaction">'.
       &HTML::Entities::encode($answer,'"<>&').'</span>';
   }
   
 sub start_chem {  sub start_chem {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;
     my $result = '';      my $result = '';

Removed from v.1.69  
changed lines
  Added in v.1.72


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