--- loncom/interface/lonnavmaps.pm 2003/05/14 18:33:28 1.188 +++ loncom/interface/lonnavmaps.pm 2003/05/14 18:34:44 1.189 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.188 2003/05/14 18:33:28 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.189 2003/05/14 18:34:44 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3201,6 +3201,12 @@ sub extractParts { my %responseIdHash; my %responseTypeHash; + + # Init the responseIdHash + foreach (@{$self->{PARTS}}) { + $responseIdHash{$_} = []; + } + # Now, the unfortunate thing about this is that parts, part name, and # response if are delimited by underscores, but both the part # name and response id can themselves have underscores in them. @@ -3221,9 +3227,6 @@ sub extractParts { if ($parts{$partIdSoFar}) { my @otherChunks = @partChunks[$i+1..$#partChunks]; my $responseId = join('_', @otherChunks); - if (!defined($responseIdHash{$partIdSoFar})) { - $responseIdHash{$partIdSoFar} = []; - } push @{$responseIdHash{$partIdSoFar}}, $responseId; $responseTypeHash{$partIdSoFar} = $responseType; last;