--- loncom/interface/statistics/lonproblemstatistics.pm 2002/07/30 23:08:56 1.8 +++ loncom/interface/statistics/lonproblemstatistics.pm 2002/08/01 20:49:06 1.9 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonproblemstatistics.pm,v 1.8 2002/07/30 23:08:56 minaeibi Exp $ +# $Id: lonproblemstatistics.pm,v 1.9 2002/08/01 20:49:06 stredwic Exp $ # # Copyright Michigan State University Board of Trustees # @@ -56,9 +56,16 @@ sub BuildProblemStatisticsPage { $Ptr .= ''; $Ptr .= ''."\n"; $Ptr .= ''."\n"; + $Ptr .= ''."\n"; + $Ptr .= ''."\n"; - $Ptr .= &AscendOrderOptions($cache{'Ascend'}); $Ptr .= &ProblemStatisticsButtons($cache{'DisplayFormat'}); $Ptr .= '
Select Map'; - $Ptr .= &Apache::lonhtmlcommon::MapOptions(\%cache, 'ProblemStatistics'); + $Ptr .= &Apache::lonhtmlcommon::MapOptions(\%cache, 'ProblemStatistics', + 'Statistics'); + $Ptr .= '
Sorting Type:'."\n"; + $Ptr .= &Apache::lonhtmlcommon::AscendOrderOptions( + $cache{'ProblemStatisticsAscend'}, + 'ProblemStatistics', + 'Statistics'); $Ptr .= '
'; $Ptr .= &ProblemStatisticsLegend(); @@ -166,13 +173,13 @@ sub ExtractStudentData { foreach my $sequence (split(':', $cache->{'orderedSequences'})) { my $tempProblemOrder=100; - $tempSequenceOrder++; -# if($cache->{'ProblemStatisticsMap'} ne 'All Maps' && -# $cache->{'ProblemStatisticsMap'} ne $cache->{$sequence.':title'}) { + if($cache->{'ProblemStatisticsMaps'} ne 'All Maps' && + $cache->{'ProblemStatisticsMaps'} ne $cache->{$sequence.':title'}) { # $r->print("
sequences=$cache->{'orderedSequences'}"); # $r->print("
".$cache->{$sequence.':title'}); -# next; -# } + next; + } + $tempSequenceOrder++; #$discrim .= '&'; foreach my $problemID (split(':', $cache->{$sequence.':problems'})) { @@ -383,8 +390,12 @@ sub BuildStatisticsTable { my $cIdx=0; foreach my $sequence (split(':', $cache->{'orderedSequences'})) { - - &CreateProblemStatisticsTableHeading(1,$cache->{$sequence.':source'}, + if($cache->{'ProblemStatisticsMaps'} ne 'All Maps' && + $cache->{'ProblemStatisticsMaps'} ne $cache->{$sequence.':title'}) { + next; + } + &CreateProblemStatisticsTableHeading($cache->{'DisplayFormat'}, + $cache->{$sequence.':source'}, $cache->{$sequence.':title'}, $headings,$r); my ($tar,$Tries,$Wrongs,$Code,$Disc)=split(/\&/, @@ -584,7 +595,7 @@ sub TableRow { $Wrng,$DoD,$SD,$Sk,$_D1,$_D2,$DiscNo,$Prob)=split(/\&/,$Str); # $r->print('
'.$Str); my $Ptr; - if ($ENV{'form.showcsv'}) { + if($cache->{'DisplayFormat'} eq 'Display CSV Format') { my ($ResId,$Dummy)=split(/\*/,$Prob); $Ptr="\n".'
'. "\n".'"'.($RealIdx+1).'",'. @@ -650,59 +661,10 @@ sub setbgcolor { return \%color; } - -sub StatusOptions { - my ($cache)=@_; - - my $Status = $cache->{'Status'}; - my $OpSel1 = ''; - my $OpSel2 = ''; - my $OpSel3 = ''; - - if($Status eq 'Any') { $OpSel3 = ' selected'; } - elsif($Status eq 'Expired' ) { $OpSel2 = ' selected'; } - else { $OpSel1 = ' selected'; } - - my $Ptr = ''; - $Ptr .= 'Student Status:'."\n"; - $Ptr .= ''."\n"; - - return $Ptr; -} - -sub AscendOrderOptions { - my ($order)=@_; - - my $OpSel1 = ''; - my $OpSel2 = ''; - - if($order eq 'Ascending') { - $OpSel1 = ' selected'; - } else { - $OpSel2 = ' selected'; - } - - my $Ptr = ''; - $Ptr .= 'Sorting Type:'."\n"; - $Ptr .= ''."\n"; - - return $Ptr; -} - sub ProblemStatisticsButtons { my ($displayFormat)=@_; my $Ptr = ''; - $Ptr .= ''; + $r->print(''); + + return; } sub BuildWrongGraph { my ($r)=@_; my $graphData = &GetGraphData('WrongGraph', $r); - return ''; + $r->print(''); + + return; }