--- loncom/interface/lonwhatsnew.pm 2005/06/01 19:24:50 1.15 +++ loncom/interface/lonwhatsnew.pm 2005/06/03 19:33:37 1.16 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.15 2005/06/01 19:24:50 raeburn Exp $ +# $Id: lonwhatsnew.pm,v 1.16 2005/06/03 19:33:37 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -165,6 +165,7 @@ sub display_actions_box() { my @tograde = (); my @bombs = (); my @warnings = (); + my %res_title = (); my $domain=&Apache::loncommon::determinedomain(); my $function; @@ -201,7 +202,7 @@ sub display_actions_box() { } &get_curr_thresholds(\%threshold,$cdom,$crs); - &getitems(\%unread,\%ungraded,\%bombed,\%triggered,\@newdiscussions,\@tograde,\@bombs,\@warnings,$rowColor1,$rowColor2,\%threshold,$cdom,$crs); + &getitems(\%unread,\%ungraded,\%bombed,\%triggered,\@newdiscussions,\@tograde,\@bombs,\@warnings,$rowColor1,$rowColor2,\%threshold,$cdom,$crs,%res_title); my ($msgcount,$critmsgcount) = &getmail(\@newmsgs,\@critmsgs); $r->print('
'); -# @bombs = sort { &cmp_title($a,$b) } @bombs; + @bombs = sort { &cmp_title($a,$b,\%res_title) } @bombs; foreach my $bomb (@bombs) { if ($bombnum %2 == 1) { $rowColor = $rowColor1; @@ -284,11 +285,11 @@ END
'); @@ -255,7 +256,7 @@ END my $bombnum = 0; if (@bombs > 0) { $r->print('
ResourceNumber of errors
- +
END my $warningnum = 0; if (@warnings > 0) { -# @warnings = sort { &cmp_title($a,$b) } @warnings; + @warnings = sort { &cmp_title($a,$b,\%res_title) } @warnings; $r->print(''. ' '."\n"); $r->print(''); @@ -331,7 +332,7 @@ END if (@newdiscussions > 0) { $r->print(''); -# @newdiscussions = sort { &cmp_title($a,$b) } @newdiscussions; + @newdiscussions = sort { &cmp_title($a,$b,\%res_title) } @newdiscussions; my $rowNum = 0; foreach my $ressymb (@newdiscussions) { my $forum_title = $unread{$ressymb}{'title'}; @@ -496,7 +497,7 @@ sub display_config_box() { } sub getitems { - my ($unread,$ungraded,$bombed,$triggered,$newdiscussions,$tograde,$bombs,$warnings,$rowColor1,$rowColor2,$threshold,$cdom,$crs) = @_; + my ($unread,$ungraded,$bombed,$triggered,$newdiscussions,$tograde,$bombs,$warnings,$rowColor1,$rowColor2,$threshold,$cdom,$crs,$res_title) = @_; my $navmap = Apache::lonnavmaps::navmap->new(); my @allres=$navmap->retrieveResources(); my %discussiontime = &Apache::lonnet::dump('discussiontimes',$cdom,$crs); @@ -508,7 +509,6 @@ sub getitems { my %resourcetracker = &Apache::lonnet::dump('nohist_resourcetracker', $cdom,$crs); - my %res_title; my $warningnum = 0; foreach my $key (keys(%lastread)) { my $newkey = $key; @@ -524,7 +524,7 @@ sub getitems { %{$$triggered{$symb}} = (); $$triggered{$symb}{numparts} = 0; my $title = $resource->compTitle(); - $res_title{$symb} = $title; + $$res_title{$symb} = $title; my $ressymb = $resource->wrap_symb(); # Check for unread discussion postings if (defined($discussiontime{$ressymb})) { @@ -617,6 +617,7 @@ sub getitems { } if ($users > 0) { $av_attempts = $attempts/$users; + $av_attempts = sprintf("%.2f",$av_attempts); } if ((($degdiff ne '' && $degdiff >= $$threshold{'degdiff'}) || ($av_attempts ne '' && $av_attempts >= $$threshold{'av_attempts'})) && ($users >= $$threshold{'numstudents'})) { $stats{$part}{degdiff} = $degdiff; @@ -824,7 +825,8 @@ sub getmail { } sub cmp_title { - my ($atitle,$btitle) = (lc($_[0]->compTitle),lc($_[1]->compTitle)); + my ($a,$b,$res_title) = @_; + my ($atitle,$btitle) = (lc($$res_title{$a}),lc($$res_title{$b})); $atitle=~s/^\s*//; $btitle=~s/^\s*//; return $atitle cmp $btitle;
ResourcePartNum. studentsAv. AttemptsDeg. DiffLast ResetReset Count?
LocationTypeNumber of new posts