[LON-CAPA-cvs] cvs: loncom /interface lonmeta.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 24 Oct 2003 14:58:36 -0000
albertel Fri Oct 24 10:58:36 2003 EDT
Modified files:
/loncom/interface lonmeta.pm
Log:
- metadata works again, (that split(/___/,$_) isn't on a symb so no decode_symb) Fixes BUG#1638
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.38 loncom/interface/lonmeta.pm:1.39
--- loncom/interface/lonmeta.pm:1.38 Sat Oct 4 16:49:40 2003
+++ loncom/interface/lonmeta.pm Fri Oct 24 10:58:36 2003
@@ -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 @@
'comments' => 'app',
'usage' => 'cnt'
);
- foreach (keys %evaldata) {
- my ($item,$purl,$cat)=&Apache::lonnet::decode_symb($_);
-### print "\n".$_.' - '.$item.'<br />';
- if (defined($cnt{$cat})) { $cnt{$cat}++; } else { $cnt{$cat}=1; }
+ while ($_=each(%evaldata)) {
+ my ($item,$purl,$cat)=split(/___/,$_);
+ ### Apache->request->print("\n".$_.' - '.$item.'<br />');
+ 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 @@
}
}
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 @@
$returnhash{$_}=$sum{$_};
}
$returnhash{$_.'_list'}=$concat{$_};
-### print "\n<hr />".$_.': '.$returnhash{$_}.'<br />'.$returnhash{$_.'_list'};
+ ### Apache->request->print("\n<hr />".$_.': '.$returnhash{$_}.'<br />'.$returnhash{$_.'_list'});
}
return %returnhash;
}