--- loncom/publisher/lonpublisher.pm 2003/11/01 17:38:58 1.142 +++ loncom/publisher/lonpublisher.pm 2003/11/05 20:27:20 1.144 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.142 2003/11/01 17:38:58 www Exp $ +# $Id: lonpublisher.pm,v 1.144 2003/11/05 20:27:20 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -180,6 +180,10 @@ nothing ######################################### ######################################### +# +# Modifies global %metadatafields %metadatakeys +# + sub metaeval { my ($metastring,$prefix)=@_; @@ -812,19 +816,22 @@ sub store_metadata { # ============================================== Parse file itself for metadata - +# +# parses a file with target meta, sets global %metadatafields %metadatakeys sub parseformeta { my ($source,$style)=@_; + my $allmeta=''; if (($style eq 'ssi') || ($style eq 'prv')) { my $dir=$source; $dir=~s-/[^/]*$--; my $file=$source; $file=(split('/',$file))[-1]; $source=&Apache::lonnet::hreflocation($dir,$file); - my $allmeta=&Apache::lonnet::ssi_body($source,('grade_target' => 'meta')); + $allmeta=&Apache::lonnet::ssi_body($source,('grade_target' => 'meta')); &metaeval($allmeta); } + return $allmeta; } ######################################### @@ -939,7 +946,8 @@ sub publish { # -------------------------------------------- Initial step done, now metadata. # --------------------------------------- Storage for metadata keys and fields. - +# these are globals +# %metadatafields=(); %metadatakeys=(); @@ -965,8 +973,9 @@ sub publish { $metadatafields{'authorspace'}=$cuname.'@'.$cudom; # ----------------------------------------------------------- Parse file itself - - &parseformeta($source,$style); +# read %metadatafields from file itself + + $allmeta=&parseformeta($source,$style); # ------------------------------------------------ Check out directory hierachy my $thisdisfn=$source; @@ -1003,12 +1012,12 @@ sub publish { delete $metadatafields{$_}; } } - - } # ------------------------------------------ See if anything new in file itself - &parseformeta($source,$style); + $allmeta=&parseformeta($source,$style); + } + # ---------------- Find and document discrepancies in the parameters and stores my $chparms=''; @@ -1039,7 +1048,9 @@ sub publish { } if ($chparms) { $scrout.='

'.&mt('Obsolete parameters or stored values').': '. - $chparms.'

'; + $chparms.'

'.&mt('Warning!'). + '

'. + &mt('If this resource is in active use, student performance data from the previous version may become inaccessible.').'


'; } # ------------------------------------------------------- Now have all metadata