Diff for /loncom/homework/default_homework.lcpm between versions 1.132 and 1.133

version 1.132, 2008/03/06 14:04:09 version 1.133, 2008/03/06 14:27:43
Line 260  sub caparesponse_check { Line 260  sub caparesponse_check {
   
 sub caparesponse_check_list {  sub caparesponse_check_list {
     my $responses=$LONCAPA::CAPAresponse_args{'response'};      my $responses=$LONCAPA::CAPAresponse_args{'response'};
 #    &LONCAPA_INTERNAL_DEBUG(" answer is ".  
 #    &LONCAPA_INTERNAL_Dumper($LONCAPA::CAPAresponse_answer).":\n");  
 #    &LONCAPA_INTERNAL_DEBUG(" respons is ".  
 #    &LONCAPA_INTERNAL_Dumper($responses).":\n");  
     &LONCAPA_INTERNAL_DEBUG("args ".join(':',%LONCAPA::CAPAresponse_args));      &LONCAPA_INTERNAL_DEBUG("args ".join(':',%LONCAPA::CAPAresponse_args));
     my $type = $LONCAPA::CAPAresponse_args{'type'};      my $type = $LONCAPA::CAPAresponse_args{'type'};
     &LONCAPA_INTERNAL_DEBUG("Got type :$type:\n");      my $answerunit=$LONCAPA::CAPAresponse_args{'unit'};
       &LONCAPA_INTERNAL_DEBUG("Got type :$type: answer unit :$answerunit:\n");
           
     my $num_input_lines =      my $num_input_lines =
  scalar(@{$LONCAPA::CAPAresponse_answer->{'answers'}});   scalar(@{$LONCAPA::CAPAresponse_answer->{'answers'}});
Line 291  sub caparesponse_check_list { Line 288  sub caparesponse_check_list {
     $responses->[$which]=[$responses->[$which]];      $responses->[$which]=[$responses->[$which]];
  }   }
     }      }
 #    &LONCAPA_INTERNAL_DEBUG(" parsed response is ".  
 #    &LONCAPA_INTERNAL_Dumper($responses).":\n");  
     foreach my $which (0..($num_input_lines-1)) {      foreach my $which (0..($num_input_lines-1)) {
  my $answer_size =    my $answer_size = 
     scalar(@{$LONCAPA::CAPAresponse_answer->{'answers'}[$which]});      scalar(@{$LONCAPA::CAPAresponse_answer->{'answers'}[$which]});
Line 319  sub caparesponse_check_list { Line 314  sub caparesponse_check_list {
     }      }
     &LONCAPA_INTERNAL_DEBUG("Final final response :$responses->[0][-1]:$unit:");      &LONCAPA_INTERNAL_DEBUG("Final final response :$responses->[0][-1]:$unit:");
     $unit=~s/\s//;      $unit=~s/\s//;
     if ($unit ne '') {      foreach my $response (@$responses) {
  foreach my $response (@$responses) {         foreach my $element (@$response) {
     foreach my $element (@$response) {            $element =~ s/\s//g;
                 $element =~ s/\s//g;            my $appendunit=$unit;
                 my $appendunit=$unit;            if ($unit=~/\%/) {
                 if ($unit=~/\%/) {               $element=$element/100;
                    $element=$element/100;               $appendunit=~s/\%//;
                    $appendunit=~s/\%//;            }    
                 }                if (($element==0) && ($unit!~/\w/) && ($answerunit=~/\w/)) {
  $element .= " $appendunit";               $appendunit=$answerunit;
                 &LONCAPA_INTERNAL_DEBUG("Made response element :$element:");            }
     }            $element .= " $appendunit";
  }            &LONCAPA_INTERNAL_DEBUG("Made response element :$element:");
          }
     }      }
           
     foreach my $thisanswer (@{ $LONCAPA::CAPAresponse_answer->{'answers'} }) {      foreach my $thisanswer (@{ $LONCAPA::CAPAresponse_answer->{'answers'} }) {

Removed from v.1.132  
changed lines
  Added in v.1.133


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