[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm

foxr lon-capa-cvs-allow@mail.lon-capa.org
Wed, 24 Oct 2007 10:06:29 -0000


foxr		Wed Oct 24 06:06:29 2007 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  rename response_id -> part_response
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.466 loncom/xml/lonxml.pm:1.467
--- loncom/xml/lonxml.pm:1.466	Mon Oct 22 05:27:50 2007
+++ loncom/xml/lonxml.pm	Wed Oct 24 06:06:22 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.466 2007/10/22 09:27:50 foxr Exp $
+# $Id: lonxml.pm,v 1.467 2007/10/24 10:06:22 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1066,14 +1066,14 @@
 Optional Arguments:
   $increment - amount to increment by (defaults to 1)
                Also 1 if the value is negative or zero.
-  $response_id - The id of the response to record.  This
-               indicates whicn part of which  problem is being
-               counted.
+  $part_response - A concatenation of the part and response id
+                   identifying exactly what is being 'answered'.
+
 
 =cut
 
 sub increment_counter {
-    my ($increment, $response_id) = @_;
+    my ($increment, $part_response) = @_;
     if (!defined($increment) || $increment le 0) {
 	$increment = 1;
     }
@@ -1082,12 +1082,12 @@
     # If the caller supplied the response_id parameter, 
     # Maintain its counter.. creating if necessary.
 
-    if(defined($response_id)) {
-	if (!defined($Apache::lonxml::counters_per_part{$response_id})) {
-	    $Apache::lonxml::counters_per_part{$response_id} = 0;
+    if(defined($part_response)) {
+	if (!defined($Apache::lonxml::counters_per_part{$part_response})) {
+	    $Apache::lonxml::counters_per_part{$part_response} = 0;
 	}
-	$Apache::lonxml::counters_per_part{$response_id} += $increment;
-	my $new_value = $Apache::lonxml::counters_per_part{$response_id};
+	$Apache::lonxml::counters_per_part{$part_response} += $increment;
+	my $new_value = $Apache::lonxml::counters_per_part{$part_response};
     }
 	
     $Apache::lonxml::counter_changed=1;
@@ -1151,17 +1151,17 @@
 =item  bubble_lines_for_part(response_id)
 
 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
 
 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;
     } else {
-	return $Apache::lonxml::counters_per_part{$response_id};
+	return $Apache::lonxml::counters_per_part{$part_response};
     }
 
 }
@@ -1192,9 +1192,9 @@
 =cut
 
 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