--- loncom/interface/statistics/lonproblemstatistics.pm 2002/11/12 19:52:46 1.36 +++ loncom/interface/statistics/lonproblemstatistics.pm 2003/02/25 20:47:47 1.40 @@ -1,7 +1,6 @@ # The LearningOnline Network with CAPA -# (Publication Handler # -# $Id: lonproblemstatistics.pm,v 1.36 2002/11/12 19:52:46 minaeibi Exp $ +# $Id: lonproblemstatistics.pm,v 1.40 2003/02/25 20:47:47 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -185,9 +184,7 @@ sub BuildProblemStatisticsPage { $Ptr .= ''."\n"; my @sections = split(':',$cache{'sectionList'}); my @sectionsSelected = split(':',$cache{'sectionsSelected'}); - $Ptr .= &Apache::lonhtmlcommon::MultipleSectionSelect(\@sections, - \@sectionsSelected, - 'Statistics'); + $Ptr .= &Apache::lonstatistics::SectionSelect('Section','multiple',5); $Ptr .= ''."\n"; $Ptr .= &ProblemStatisticsButtons($cache{'DisplayFormat'}, $cache{'DisplayLegend'}, @@ -222,9 +219,6 @@ sub BuildGraphicChart { my ($graph,$cacheDB,$courseDescription,$students,$courseID,$r,$c)=@_; my %cache; my $max; - unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { - return 'Unable to tie database.7'; - } my $title = ''; if($graph eq 'DoDiffGraph') { @@ -244,6 +238,10 @@ sub BuildGraphicChart { my @values = (); + unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { + return 'Unable to tie database.7'; + } + foreach(@$orderedProblems) { my ($sequence,$problem,$part)=split(':', $_); if($cache{'StatisticsMaps'} ne 'All Maps' && @@ -299,13 +297,11 @@ sub DrawGraph { #(10 - $Max % 10); } else { $Max = 1; } -# my @GData = ($courseDescription, 'Problem_number', -# $title, $Max, $sendCount, $sendValues); my @GData = ('','Problem_number',$title,$Max,$sendCount,$sendValues); # $r->print(''."\n"); $r->print('
'."\n"); - $r->print(''); # $r->print('
'."\n"); $r->print('
'."\n"); @@ -659,7 +655,7 @@ sub ExtractStudentData { sub SortDivideByTries { my ($toSort, $data, $sortOn)=@_; - my @orderedData = sort { ($data->{$a.':totalTries'}) ? + my @orderedData = sort { ($data->{$a.':totalTries'}) ? ($data->{$a.$sortOn}/$data->{$a.':totalTries'}):0 <=> ($data->{$b.':totalTries'}) ?