--- loncom/lonnet/perl/lonnet.pm 2018/03/28 10:22:10 1.1172.2.93.4.8 +++ loncom/lonnet/perl/lonnet.pm 2018/04/06 18:20:30 1.1172.2.93.4.9 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1172.2.93.4.8 2018/03/28 10:22:10 raeburn Exp $ +# $Id: lonnet.pm,v 1.1172.2.93.4.9 2018/04/06 18:20:30 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -11190,6 +11190,7 @@ sub metadata { # Check metadata for imported file to # see if it contained response items # + my %currmetaentry = %metaentry; my $libresponseorder = &metadata($location,'responseorder'); my $origfile; if ($libresponseorder ne '') { @@ -11209,6 +11210,10 @@ sub metadata { } } } +# Do not overwrite contents of %metaentry hash for resource itself with +# hash populated for imported library file + %metaentry = %currmetaentry; + undef(%currmetaentry); if ($importmode eq 'problem') { # Import as problem/response $unikey=&add_prefix_and_part($prefix,$token->[2]->{'part'}); @@ -11218,7 +11223,7 @@ sub metadata { # We need to get the original file and the imported file to get the part order correct # Good news: we do not need to worry about nested libraries, since parts cannot be nested # Load and inspect original file if we didn't do that already - if ($#origfileimportpartids<0) { + if ($#origfiletagids<0) { undef(%importedrespids); undef(%importedpartids); if ($origfile eq '') {