--- loncom/interface/Attic/lonchart.pm 2002/02/28 23:14:57 1.33
+++ loncom/interface/Attic/lonchart.pm 2002/02/28 23:35:31 1.35
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# (Publication Handler
#
-# $Id: lonchart.pm,v 1.33 2002/02/28 23:14:57 minaeibi Exp $
+# $Id: lonchart.pm,v 1.35 2002/02/28 23:35:31 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -257,7 +257,9 @@ sub usection {
my ($udom,$unam,$courseid)=@_;
$courseid=~s/\_/\//g;
$courseid=~s/^(\w)/\/$1/;
- map {
+ foreach (split(/\&/,&Apache::lonnet::reply('dump:'.
+ $udom.':'.$unam.':roles',
+ &Apache::lonnet::homeserver($unam,$udom)))){
my ($key,$value)=split(/\=/,$_);
$key=&Apache::lonnet::unescape($key);
if ($key=~/^$courseid(?:\/)*(\w+)*\_st$/) {
@@ -269,8 +271,9 @@ sub usection {
# $r->print($unam.'...'.$section.'
');
return $section;
}
- } split(/\&/,&Apache::lonnet::reply('dump:'.$udom.':'.$unam.':roles',
- &Apache::lonnet::homeserver($unam,$udom)));
+ }
+ #} split(/\&/,&Apache::lonnet::reply('dump:'.$udom.':'.$unam.':roles',
+ # &Apache::lonnet::homeserver($unam,$udom)));
return '';
}
@@ -384,7 +387,7 @@ sub CreateForm {
}
sub CacheChart {
- my @list = ();
+ my %list = ();
my $count=0;
my $Pos = $ENV{'form.sort'};
@@ -395,11 +398,11 @@ sub CacheChart {
foreach my $key( keys %CachData) {
my @Temp=split(/\:/,$key);
my $Use = $Temp[$Pos];
- $list[$count]=$Use.$key.'*'.$CachData{$key};
+ $list{$Use.$key}=$key;
$count++;
}
- @list = sort (@list);
+ my @order = sort(keys(%list));
$r->print('
'); for ( my $n; $n < $count; $n++) { - my ($dummy, $Line) = split(/\*/,$list[$n]); - $r->print($Line.''); }
'); + $r->print($CachData{$list{$order[$n]}}.'
'); } $r->print('