Diff for /loncom/homework/caparesponse/caparesponse.pm between versions 1.234 and 1.237

version 1.234, 2008/09/20 00:25:39 version 1.237, 2010/02/28 23:45:43
Line 533  sub end_numericalresponse { Line 533  sub end_numericalresponse {
    $Apache::inputtags::params{'sig'});     $Apache::inputtags::params{'sig'});
  }   }
  &Apache::lonxml::debug("\n<br>result:$result:$Apache::lonxml::curdepth<br>\n");   &Apache::lonxml::debug("\n<br>result:$result:$Apache::lonxml::curdepth<br>\n");
  if ($Apache::lonhomework::type eq 'survey' &&                  if (($ad eq 'INCORRECT' || $ad eq 'APPROX_ANS' ||
     ($ad eq 'INCORRECT' || $ad eq 'APPROX_ANS' ||                       $ad eq 'EXACT_ANS')) {
      $ad eq 'EXACT_ANS')) {      if ($Apache::lonhomework::type eq 'survey') {
     $ad='SUBMITTED';          $ad='SUBMITTED';
  }      } elsif ($Apache::lonhomework::type eq 'surveycred') {
                           $ad='SUBMITTED_CREDIT';
                       } elsif ($Apache::lonhomework::type eq 'anonsurvey') {
                           $ad='ANONYMOUS';
                       } elsif ($Apache::lonhomework::type eq 'anonsurveycred') {
                           $ad='ANONYMOUS_CREDIT';                     
                       }
                   }
  &Apache::response::handle_previous(\%previous,$ad);   &Apache::response::handle_previous(\%previous,$ad);
  $Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}=$ad;   $Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}=$ad;
  $Apache::lonhomework::results{"resource.$partid.$id.awardmsg"}=$msg;   $Apache::lonhomework::results{"resource.$partid.$id.awardmsg"}=$msg;
Line 608  sub end_numericalresponse { Line 615  sub end_numericalresponse {
  }   }
         if (($target eq 'web') && ($tag eq 'formularesponse')          if (($target eq 'web') && ($tag eq 'formularesponse')
             && ($Apache::lonhomework::type ne 'exam') && ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER')              && ($Apache::lonhomework::type ne 'exam') && ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER')
     && (&Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.turnoneditor') ne 'no')){         && (&Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.turnoffeditor') ne 'yes')) {
            $result.=&Apache::response::edit_mathresponse_button($id,"HWVAL_$id");              $result.=&Apache::response::edit_mathresponse_button($id,"HWVAL_$id");
         }          }
                           
  &Apache::response::setup_prior_tries_hash(\&format_prior_response_numerical);   &Apache::response::setup_prior_tries_hash(\&format_prior_response_numerical);
Line 752  sub end_numericalresponse { Line 759  sub end_numericalresponse {
     if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') {      if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') {
  my $error;   my $error;
  if ($tag eq 'formularesponse') {   if ($tag eq 'formularesponse') {
     $error=&mt('Computer\'s answer is incorrect ("[_1]").',join(', ',@$response));      $error=&mt("Computer's answer is incorrect ([_1]).",'"'.join(', ',@$response).'"');
  } else {   } else {
     # answer failed check if it is sig figs that is failing      # answer failed check if it is sig figs that is failing
     my ($ad,$msg)=&check_submission($response,$partid,$id,      my ($ad,$msg)=&check_submission($response,$partid,$id,
     $tag,$parstack,      $tag,$parstack,
     $safeeval,1);      $safeeval,1);
       $error=&mt("Computer's answer is incorrect ([_1]).",'"'.join(', ',@$response).'"').' ';
     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.',join(', ',@$response),$tolline,$sigline);   $error.=&mt('It is likely that the tolerance range [_1] or significant figures [_2] need to be adjusted.',$tolline,$sigline);
     } else {      } else {
  $error=&mt('Computer\'s answer is incorrect ("[_1]"). It is likely that the tolerance range [_2] needs to be adjusted.',join(', ',@$response),$tolline);   $error.=&mt('It is likely that the tolerance range [_1] needs to be adjusted.',$tolline);
     }      }
  }   }
  if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') {   if ($ad ne 'EXACT_ANS' && $ad ne 'APPROX_ANS') {
Line 1185  sub end_stringresponse { Line 1193  sub end_stringresponse {
    \@final_msgs,     \@final_msgs,
    \@names,1);     \@names,1);
  }   }
  if ($Apache::lonhomework::type eq 'survey' &&                  if (($ad eq 'INCORRECT' || $ad eq 'APPROX_ANS' ||
     ($ad eq 'INCORRECT' || $ad eq 'APPROX_ANS' ||                       $ad eq 'EXACT_ANS')) {
      $ad eq 'EXACT_ANS')) {      if ($Apache::lonhomework::type eq 'survey') {
     $ad='SUBMITTED';          $ad='SUBMITTED';
  }      } elsif ($Apache::lonhomework::type eq 'surveycred') {
                           $ad='SUBMITTED_CREDIT';
                       } elsif ($Apache::lonhomework::type eq 'anonsurvey') {
                           $ad='ANONYMOUS';
                       } elsif ($Apache::lonhomework::type eq 'anonsurveycred') {
                           $ad='ANONYMOUS_CREDIT';
                       }
                   }
  &Apache::response::handle_previous(\%previous,$ad);   &Apache::response::handle_previous(\%previous,$ad);
  $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=$ad;   $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=$ad;
  $Apache::lonhomework::results{"resource.$part.$id.awardmsg"}=$msg;   $Apache::lonhomework::results{"resource.$part.$id.awardmsg"}=$msg;

Removed from v.1.234  
changed lines
  Added in v.1.237


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