--- loncom/metadata_database/LONCAPA/lonmetadata.pm 2004/04/12 21:11:45 1.5 +++ loncom/metadata_database/LONCAPA/lonmetadata.pm 2004/04/14 18:29:31 1.6 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonmetadata.pm,v 1.5 2004/04/12 21:11:45 matthew Exp $ +# $Id: lonmetadata.pm,v 1.6 2004/04/14 18:29:31 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -372,7 +372,7 @@ sub lookup_metadata { =item delete_metadata() - +Not implemented yet =cut @@ -383,6 +383,27 @@ sub delete_metadata {} ###################################################################### ###################################################################### +=pod + +=item metdata_col_to_hash + +Input: Array of metadata columns + +Return: Hash with the metadata columns as keys and the array elements +passed in as values + +=cut + +###################################################################### +###################################################################### +sub metadata_col_to_hash { + my @cols=@_; + my %hash=(); + for (my $i=0; $i<=$#Metadata_Table_Description;$i++) { + $hash{$Metadata_Table_Description[$i]->{'name'}}=$cols[$i]; + } + return %hash; +} ###################################################################### ###################################################################### @@ -560,6 +581,7 @@ sub process_dynamic_metadata { return %data; } + ###################################################################### ###################################################################### ## @@ -580,6 +602,8 @@ sub escape { } + + 1; __END__;