Diff for /loncom/homework/caparesponse/caparesponse.pm between versions 1.251 and 1.257

version 1.251, 2012/02/10 00:25:53 version 1.257, 2016/02/18 18:40:05
Line 1 Line 1
 # The LearningOnline Network with CAPA  # The LearningOnline Network with CAPA
 # caparesponse definition  # caparesponse definition
 #  #
 #  caparesponse.pm,v 1.249.8.2 2012/02/04 20:40:15 foxr   # $Id$
 #  #
 # Copyright Michigan State University Board of Trustees  # Copyright Michigan State University Board of Trustees
 #  #
Line 456  sub check_submission { Line 456  sub check_submission {
  my ($result,@msgs) =    my ($result,@msgs) = 
     &Apache::run::run("&caparesponse_check_list()",$safeeval);      &Apache::run::run("&caparesponse_check_list()",$safeeval);
  &Apache::lonxml::debug("checking $name $result with $response took ".&Time::HiRes::tv_interval($t0));   &Apache::lonxml::debug("checking $name $result with $response took ".&Time::HiRes::tv_interval($t0));
           
  &Apache::lonxml::debug('msgs are '.join(':',@msgs));   &Apache::lonxml::debug('msgs are '.join(':',@msgs));
  my ($awards)=split(/:/,$result);   my ($awards)=split(/:/,$result);
  my @awards= split(/,/,$awards);   my @awards= split(/,/,$awards);
Line 643  sub end_numericalresponse { Line 642  sub end_numericalresponse {
  }   }
     }      }
  }   }
         if (($target eq 'web') && ($tag eq 'formularesponse')  
             && ($Apache::lonhomework::type ne 'exam') && ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER')  
     && (&Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.turnoffeditor') ne 'yes')) {  
             $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);
     } elsif ($target eq 'edit') {      } elsif ($target eq 'edit') {
  $result.='</td></tr>'.&Apache::edit::end_table;   $result.='</td></tr>'.&Apache::edit::end_table;
Line 796  sub end_numericalresponse { Line 790  sub end_numericalresponse {
     $tag,$parstack,      $tag,$parstack,
     $safeeval,1);      $safeeval,1);
     $error=&mt("Computer's answer is incorrect ([_1]).",'"'.join(', ',@$response).'"').' ';      $error=&mt("Computer's answer is incorrect ([_1]).",'"'.join(', ',@$response).'"').' ';
     if ($sigline ne '') {                      if ($ad eq 'UNIT_INVALID_STUDENT') {
                           $error.=&mt('Unable to interpret units. Computer reads units as "[_1]".',$msg).' '.
                                   &mt('The unit attribute in the numericalresponse item needs to be a supported physical unit.');
       } elsif ($sigline ne '') {
  $error.=&mt('It is likely that the tolerance range [_1] or significant figures [_2] need to be adjusted.',$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('It is likely that the tolerance range [_1] needs to be adjusted.',$tolline);   $error.=&mt('It is likely that the tolerance range [_1] needs to be adjusted.',$tolline);
Line 970  sub make_numerical_bubbles { Line 967  sub make_numerical_bubbles {
     my $number_of_bubbles =       my $number_of_bubbles = 
  &Apache::response::get_response_param($part.'_'.$id,'numbubbles',8);   &Apache::response::get_response_param($part.'_'.$id,'numbubbles',8);
   
       #
       # Fixes for BZ 6519 - number of bubbles <= 0 or non-integer.
       # 
       $number_of_bubbles = int($number_of_bubbles + 0.5);
       if ($number_of_bubbles <= 0) {
    $number_of_bubbles = 8;
       }
       
   
     my ($format)=&Apache::lonxml::get_param_var('format',$parstack,$safeeval);      my ($format)=&Apache::lonxml::get_param_var('format',$parstack,$safeeval);
     my $name = (exists($answer{$tag_internal_answer_name})       my $name = (exists($answer{$tag_internal_answer_name}) 
  ? $tag_internal_answer_name   ? $tag_internal_answer_name

Removed from v.1.251  
changed lines
  Added in v.1.257


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