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

bowersj2 lon-capa-cvs@mail.lon-capa.org
Wed, 14 May 2003 18:33:28 -0000


bowersj2		Wed May 14 14:33:28 2003 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  Response ids may not be unique, so always return them as an array, even
  if they are empty.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.187 loncom/interface/lonnavmaps.pm:1.188
--- loncom/interface/lonnavmaps.pm:1.187	Wed May 14 14:01:16 2003
+++ loncom/interface/lonnavmaps.pm	Wed May 14 14:33:28 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.187 2003/05/14 18:01:16 bowersj2 Exp $
+# $Id: lonnavmaps.pm,v 1.188 2003/05/14 18:33:28 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2594,6 +2594,12 @@
 Apache::lonnavmaps::navmap, and use the "start" method to obtain the
 starting resource.
 
+Resource objects respect the parameter_hiddenparts, which suppresses 
+various parts according to the wishes of the map author. As of this
+writing, there is no way to override this parameter, and suppressed
+parts will never be returned, nor will their response types or ids be
+stored.
+
 =head2 Public Members
 
 resource objects have a hash called DATA ($resourceRef->{DATA}) that
@@ -3166,7 +3172,6 @@
     # Retrieve part count, if this is a problem
     if ($self->is_problem()) {
         my $metadata = &Apache::lonnet::metadata($self->src(), 'packages');
-        print $metadata;
         if (!$metadata) {
             $self->{RESOURCE_ERROR} = 1;
             $self->{PARTS} = [];
@@ -3216,7 +3221,10 @@
                     if ($parts{$partIdSoFar}) {
                         my @otherChunks = @partChunks[$i+1..$#partChunks];
                         my $responseId = join('_', @otherChunks);
-                        $responseIdHash{$partIdSoFar} = $responseId;
+                        if (!defined($responseIdHash{$partIdSoFar})) {
+                            $responseIdHash{$partIdSoFar} = [];
+                        }
+                        push @{$responseIdHash{$partIdSoFar}}, $responseId;
                         $responseTypeHash{$partIdSoFar} = $responseType;
                         last;
                     }