Diff for /loncom/homework/hint.pm between versions 1.47 and 1.50

version 1.47, 2004/03/04 21:21:55 version 1.50, 2004/03/13 00:36:11
Line 150  sub end_numericalhint { Line 150  sub end_numericalhint {
  }   }
  $safeeval->share_from('capa',['&caparesponse_capa_check_answer']);   $safeeval->share_from('capa',['&caparesponse_capa_check_answer']);
  my $name= &Apache::lonxml::get_param('name',$parstack,$safeeval);   my $name= &Apache::lonxml::get_param('name',$parstack,$safeeval);
  &Apache::response::setup_params('numericalhint');   &Apache::response::setup_params('numericalhint',$safeeval);
  my $partid=$Apache::inputtags::part;   my $partid=$Apache::inputtags::part;
  my $id=$Apache::inputtags::response['-1'];   my $id=$Apache::inputtags::response['-1'];
  #id submissions occured under   #id submissions occured under
Line 163  sub end_numericalhint { Line 163  sub end_numericalhint {
     $$parstack[$#$parstack];      $$parstack[$#$parstack];
  #need to get all possible parms   #need to get all possible parms
  foreach my $key (keys(%Apache::inputtags::params)) {   foreach my $key (keys(%Apache::inputtags::params)) {
     $expression.= ';my $'. #'      $expression.= ';my $__LC__'. #'
  $key.'="'.$Apache::inputtags::params{$key}.'"';   $key.'="'.$Apache::inputtags::params{$key}.'"';
  }   }
  if ($$tagstack[-1] eq 'formulahint') {   if ($$tagstack[-1] eq 'formulahint') {
     $expression.=';my $type="fml";';      $expression.=';my $__LC__type="fml";';
  } elsif ($$tagstack[-1] eq 'numericalhint') {   } elsif ($$tagstack[-1] eq 'numericalhint') {
     $expression.=';my $type="float";';      $expression.=';my $__LC__type="float";';
  }   }
  $expression.="');";   $expression.="');";
  my @answer=&Apache::lonxml::get_param_var('answer',$parstack,$safeeval);   my @answer=&Apache::lonxml::get_param_var('answer',$parstack,$safeeval);
  &Apache::lonxml::debug('answer is'.join(':',@answer));   &Apache::lonxml::debug('answer is'.join(':',@answer));
  @{$safeeval->varglob('CAPARESPONSE_CHECK_LIST_answer')}=@answer;   @{$safeeval->varglob('CAPARESPONSE_CHECK_LIST_answer')}=@answer;
   
  $result = &Apache::run::run($expression,$safeeval);   ($result,my @msgs) = &Apache::run::run($expression,$safeeval);
    &Apache::lonxml::debug('msgs are'.join(':',@msgs));
  &Apache::lonxml::debug("$expression:result:$result:$Apache::lonxml::curdepth");   &Apache::lonxml::debug("$expression:result:$result:$Apache::lonxml::curdepth");
  my ($awards) = split /:/ , $result;   my ($awards)=split(/:/,$result);
  my ($ad) = &Apache::inputtags::finalizeawards(split /,/ , $awards);   my (@awards) = split(/,/,$awards);
    my ($ad, $msg) = &Apache::inputtags::finalizeawards(\@awards,\@msgs);
  if ($ad eq 'EXACT_ANS' || $ad eq 'APPROX_ANS') { push (@Apache::hint::which,$name); }   if ($ad eq 'EXACT_ANS' || $ad eq 'APPROX_ANS') { push (@Apache::hint::which,$name); }
  $result='';   $result='';
     } elsif ($target eq 'meta') {      } elsif ($target eq 'meta') {

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


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