--- loncom/interface/lonmeta.pm 2003/10/04 20:49:40 1.38 +++ loncom/interface/lonmeta.pm 2003/10/24 14:58:36 1.39 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.38 2003/10/04 20:49:40 www Exp $ +# $Id: lonmeta.pm,v 1.39 2003/10/24 14:58:36 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -70,10 +70,10 @@ sub dynamicmeta { 'comments' => 'app', 'usage' => 'cnt' ); - foreach (keys %evaldata) { - my ($item,$purl,$cat)=&Apache::lonnet::decode_symb($_); -### print "\n".$_.' - '.$item.'
'; - if (defined($cnt{$cat})) { $cnt{$cat}++; } else { $cnt{$cat}=1; } + while ($_=each(%evaldata)) { + my ($item,$purl,$cat)=split(/___/,$_); + ### Apache->request->print("\n".$_.' - '.$item.'
'); + if (defined($cnt{$cat})) { $cnt{$cat}++; } else { $cnt{$cat}=1; } unless ($listitems{$cat} eq 'app') { if (defined($sum{$cat})) { $sum{$cat}+=$evaldata{$_}; @@ -93,7 +93,7 @@ sub dynamicmeta { } } my %returnhash=(); - foreach (keys %cnt) { + while ($_=each(%cnt)) { if ($listitems{$_} eq 'avg') { $returnhash{$_}=int(($sum{$_}/$cnt{$_})*100.0+0.5)/100.0; } elsif ($listitems{$_} eq 'cnt') { @@ -102,7 +102,7 @@ sub dynamicmeta { $returnhash{$_}=$sum{$_}; } $returnhash{$_.'_list'}=$concat{$_}; -### print "\n
".$_.': '.$returnhash{$_}.'
'.$returnhash{$_.'_list'}; + ### Apache->request->print("\n
".$_.': '.$returnhash{$_}.'
'.$returnhash{$_.'_list'}); } return %returnhash; }