--- loncom/interface/groupsort.pm 2005/06/10 02:19:51 1.34 +++ loncom/interface/groupsort.pm 2005/06/10 15:17:35 1.35 @@ -2,7 +2,7 @@ # The LON-CAPA group sort handler # Allows for sorting prior to import into RAT. # -# $Id: groupsort.pm,v 1.34 2005/06/10 02:19:51 www Exp $ +# $Id: groupsort.pm,v 1.35 2005/06/10 15:17:35 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -200,7 +200,7 @@ sub cleanup { # -------------------------------------------------------------- Read from file sub readfromfile { - my ($r,$shash,$thash)=@_; + my ($r,$shash,$thash,$nhash)=@_; my $cont=&Apache::lonnet::getfile (&Apache::lonnet::filelocation('',$env{'form.readfile'})); if ($cont==-1) { @@ -209,6 +209,7 @@ sub readfromfile { } else { my $parser = HTML::TokeParser->new(\$cont); my $token; + my $n=1; while ($token = $parser->get_token) { if ($token->[0] eq 'S') { if ($token->[1] eq 'resource') { @@ -217,15 +218,18 @@ sub readfromfile { } else { if ($token->[2]->{'type'} eq 'zombie') { next; } } - my $name=$token->[2]->{'title'}; + my $url=$token->[2]->{'src'}; + my $name=$token->[2]->{'title'}; $name=~s/ \[\((\d+)\,(\w+)\,(\w+)\)\]$//; if ($1) { - $name.='
'.&mt('Removed by '). + $$nhash{$url}='
'.&mt('Removed by '). &Apache::loncommon::plainname($2,$3).', '. &Apache::lonlocal::locallocaltime($1); } - $r->print('
'.$name); + $$thash{$url}=$name; + $$shash{$url}=$n; + $n++; } } } @@ -326,9 +330,10 @@ END my %shash; # sort order (key is resource location, value is sort order) my %thash; # title (key is resource location, value is title) + my %nhash; # notes (key is resource location); if ($env{'form.readfile'}) { - &readfromfile($r,\%shash,\%thash); + &readfromfile($r,\%shash,\%thash,\%nhash); } else { &readfromdb($r,\%shash,\%thash); }