Diff for /loncom/xml/lonxml.pm between versions 1.466 and 1.467

version 1.466, 2007/10/22 09:27:50 version 1.467, 2007/10/24 10:06:22
Line 1066  Increments the internal counter environm Line 1066  Increments the internal counter environm
 Optional Arguments:  Optional Arguments:
   $increment - amount to increment by (defaults to 1)    $increment - amount to increment by (defaults to 1)
                Also 1 if the value is negative or zero.                 Also 1 if the value is negative or zero.
   $response_id - The id of the response to record.  This    $part_response - A concatenation of the part and response id
                indicates whicn part of which  problem is being                     identifying exactly what is being 'answered'.
                counted.  
   
 =cut  =cut
   
 sub increment_counter {  sub increment_counter {
     my ($increment, $response_id) = @_;      my ($increment, $part_response) = @_;
     if (!defined($increment) || $increment le 0) {      if (!defined($increment) || $increment le 0) {
  $increment = 1;   $increment = 1;
     }      }
Line 1082  sub increment_counter { Line 1082  sub increment_counter {
     # If the caller supplied the response_id parameter,       # If the caller supplied the response_id parameter, 
     # Maintain its counter.. creating if necessary.      # Maintain its counter.. creating if necessary.
   
     if(defined($response_id)) {      if(defined($part_response)) {
  if (!defined($Apache::lonxml::counters_per_part{$response_id})) {   if (!defined($Apache::lonxml::counters_per_part{$part_response})) {
     $Apache::lonxml::counters_per_part{$response_id} = 0;      $Apache::lonxml::counters_per_part{$part_response} = 0;
  }   }
  $Apache::lonxml::counters_per_part{$response_id} += $increment;   $Apache::lonxml::counters_per_part{$part_response} += $increment;
  my $new_value = $Apache::lonxml::counters_per_part{$response_id};   my $new_value = $Apache::lonxml::counters_per_part{$part_response};
     }      }
   
     $Apache::lonxml::counter_changed=1;      $Apache::lonxml::counter_changed=1;
Line 1151  sub store_counter { Line 1151  sub store_counter {
 =item  bubble_lines_for_part(response_id)  =item  bubble_lines_for_part(response_id)
   
 Returns the number of lines required to get a response for  Returns the number of lines required to get a response for
 $response_id (this is just $Apache::lonxml::counters_per_part{$response_id}  $part_response (this is just $Apache::lonxml::counters_per_part{$part_response}
   
 =cut  =cut
   
 sub bubble_lines_for_part {  sub bubble_lines_for_part {
     my ($response_id) = @_;      my ($part_response) = @_;
   
     if (!defined($Apache::lonxml::counters_per_part{$response_id})) {      if (!defined($Apache::lonxml::counters_per_part{$part_response})) {
  return 0;   return 0;
     } else {      } else {
  return $Apache::lonxml::counters_per_part{$response_id};   return $Apache::lonxml::counters_per_part{$part_response};
     }      }
   
 }  }
Line 1192  analysis to set its hash value explicitl Line 1192  analysis to set its hash value explicitl
 =cut  =cut
   
 sub set_bubble_lines {  sub set_bubble_lines {
     my ($response_id, $value) = @_;      my ($part_response, $value) = @_;
   
     $Apache::lonxml::counters_per_part{$response_id} = $value;      $Apache::lonxml::counters_per_part{$part_response} = $value;
 }  }
   
 =pod  =pod

Removed from v.1.466  
changed lines
  Added in v.1.467


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