[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm

albertel lon-capa-cvs@mail.lon-capa.org
Sat, 29 Apr 2006 17:57:30 -0000


albertel		Sat Apr 29 13:57:30 2006 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  - adding a response ID equal to the partid for .tasks
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.378 loncom/interface/lonnavmaps.pm:1.379
--- loncom/interface/lonnavmaps.pm:1.378	Thu Apr 20 00:30:11 2006
+++ loncom/interface/lonnavmaps.pm	Sat Apr 29 13:57:29 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.378 2006/04/20 04:30:11 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.379 2006/04/29 17:57:29 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4385,9 +4385,9 @@
         # So we have to use our knowlege of part names to figure out 
         # where the part names begin and end, and even then, it is possible
         # to construct ambiguous situations.
-        foreach (split /,/, $metadata) {
-            if ($_ =~ /^([a-zA-Z]+)response_(.*)/
-		|| $_ =~ /^(Task)_(.*)/) {
+        foreach my $data (split /,/, $metadata) {
+            if ($data =~ /^([a-zA-Z]+)response_(.*)/
+		|| $data =~ /^(Task)_(.*)/) {
                 my $responseType = $1;
                 my $partStuff = $2;
                 my $partIdSoFar = '';
@@ -4399,8 +4399,15 @@
                     if ($parts{$partIdSoFar}) {
                         my @otherChunks = @partChunks[$i+1..$#partChunks];
                         my $responseId = join('_', @otherChunks);
-                        push @{$responseIdHash{$partIdSoFar}}, $responseId;
-                        push @{$responseTypeHash{$partIdSoFar}}, $responseType;
+			if ($self->is_task()) {
+			    push(@{$responseIdHash{$partIdSoFar}},
+				 $partIdSoFar);
+			} else {
+			    push(@{$responseIdHash{$partIdSoFar}},
+				 $responseId);
+			}
+                        push(@{$responseTypeHash{$partIdSoFar}},
+			     $responseType);
                     }
                 }
             }