Diff for /loncom/interface/lonmeta.pm between versions 1.38 and 1.39

version 1.38, 2003/10/04 20:49:40 version 1.39, 2003/10/24 14:58:36
Line 70  sub dynamicmeta { Line 70  sub dynamicmeta {
                    'comments'     => 'app',                     'comments'     => 'app',
                    'usage'        => 'cnt'                     'usage'        => 'cnt'
                    );                     );
     foreach (keys %evaldata) {      while ($_=each(%evaldata)) {
  my ($item,$purl,$cat)=&Apache::lonnet::decode_symb($_);   my ($item,$purl,$cat)=split(/___/,$_);
 ### print "\n".$_.' - '.$item.'<br />';   ### Apache->request->print("\n".$_.' - '.$item.'<br />');
         if (defined($cnt{$cat})) { $cnt{$cat}++; } else { $cnt{$cat}=1; }   if (defined($cnt{$cat})) { $cnt{$cat}++; } else { $cnt{$cat}=1; }
         unless ($listitems{$cat} eq 'app') {          unless ($listitems{$cat} eq 'app') {
             if (defined($sum{$cat})) {              if (defined($sum{$cat})) {
                $sum{$cat}+=$evaldata{$_};                 $sum{$cat}+=$evaldata{$_};
Line 93  sub dynamicmeta { Line 93  sub dynamicmeta {
  }   }
     }      }
     my %returnhash=();      my %returnhash=();
     foreach (keys %cnt) {      while ($_=each(%cnt)) {
        if ($listitems{$_} eq 'avg') {         if ($listitems{$_} eq 'avg') {
    $returnhash{$_}=int(($sum{$_}/$cnt{$_})*100.0+0.5)/100.0;     $returnhash{$_}=int(($sum{$_}/$cnt{$_})*100.0+0.5)/100.0;
        } elsif ($listitems{$_} eq 'cnt') {         } elsif ($listitems{$_} eq 'cnt') {
Line 102  sub dynamicmeta { Line 102  sub dynamicmeta {
            $returnhash{$_}=$sum{$_};             $returnhash{$_}=$sum{$_};
        }         }
        $returnhash{$_.'_list'}=$concat{$_};         $returnhash{$_.'_list'}=$concat{$_};
 ### print "\n<hr />".$_.': '.$returnhash{$_}.'<br />'.$returnhash{$_.'_list'};         ### Apache->request->print("\n<hr />".$_.': '.$returnhash{$_}.'<br />'.$returnhash{$_.'_list'});
     }      }
     return %returnhash;      return %returnhash;
 }  }

Removed from v.1.38  
changed lines
  Added in v.1.39


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>