Diff for /loncom/homework/caparesponse/caparesponse.pm between versions 1.177 and 1.180

version 1.177, 2005/08/02 19:01:18 version 1.180, 2005/09/08 17:49:22
Line 422  sub end_numericalresponse { Line 422  sub end_numericalresponse {
  if ($sigline ne '') {   if ($sigline ne '') {
     $error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range [_2] or significant figures [_3] need to be adjusted.',$response,$tolline,$sigline);      $error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range [_2] or significant figures [_3] need to be adjusted.',$response,$tolline,$sigline);
  } else {   } else {
     $error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range [_1] needs to be adjusted.',$response,$tolline);      $error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range [_2] needs to be adjusted.',$response,$tolline);
  }   }
     }      }
     if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') {      if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') {
Line 700  sub end_stringresponse { Line 700  sub end_stringresponse {
 # $answer=$token->[2]->{'answer'};  # $answer=$token->[2]->{'answer'};
 #    }  #    }
     ${$safeeval->varglob('LONCAPA::response')}=$response;      ${$safeeval->varglob('LONCAPA::response')}=$response;
     $result = &Apache::run::run('return $LONCAPA::response=~m'.$answer,$safeeval);      $result = &Apache::run::run('if ($LONCAPA::response=~m'.$answer.') { return 1; } else { return 0; }',$safeeval);
     &Apache::lonxml::debug("current $response");      &Apache::lonxml::debug("current $response");
     &Apache::lonxml::debug("current $answer");      &Apache::lonxml::debug("current $answer");
     $ad = ($result) ? 'APPROX_ANS' : 'INCORRECT';      $ad = ($result) ? 'APPROX_ANS' : 'INCORRECT';
Line 761  sub end_stringresponse { Line 761  sub end_stringresponse {
 # foreach my $ans (@answers) {  # foreach my $ans (@answers) {
     if ($target eq 'answer') {      if ($target eq 'answer') {
  $result.=&Apache::response::answer_part('stringresponse',$answer);   $result.=&Apache::response::answer_part('stringresponse',$answer);
    if ($type eq 're') {
       $result.=&Apache::response::answer_part('stringresponse',
       $answerdisplay);
    }
     } elsif ($target eq 'analyze') {      } elsif ($target eq 'analyze') {
  push (@{ $Apache::lonhomework::analyze{"$part.$id.answer"} },   push (@{ $Apache::lonhomework::analyze{"$part.$id.answer"} },
       $answer);        $answer);

Removed from v.1.177  
changed lines
  Added in v.1.180


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