--- loncom/interface/statistics/lonproblemstatistics.pm 2002/07/30 22:09:01 1.7
+++ 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.7 2002/07/30 22:09:01 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 .= 'Select Map | '."\n";
$Ptr .= '';
- $Ptr .= &Apache::lonhtmlcommon::MapOptions(\%cache, 'ProblemStatistics');
+ $Ptr .= &Apache::lonhtmlcommon::MapOptions(\%cache, 'ProblemStatistics',
+ 'Statistics');
+ $Ptr .= ' |
'."\n";
+ $Ptr .= 'Sorting Type: | '."\n";
+ $Ptr .= ''."\n";
+ $Ptr .= &Apache::lonhtmlcommon::AscendOrderOptions(
+ $cache{'ProblemStatisticsAscend'},
+ 'ProblemStatistics',
+ 'Statistics');
$Ptr .= ' |
'."\n";
- $Ptr .= &AscendOrderOptions($cache{'Ascend'});
$Ptr .= &ProblemStatisticsButtons($cache{'DisplayFormat'});
$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(/\&/,
@@ -427,7 +438,11 @@ sub BuildStatisticsTable {
$Temp = ''.$cache->{$ResId.':title'}.$Dummy.'';
- my $res = &Apache::lonnet::declutter($cache->{'src_'.$ResId});
+ #$r->print('
rid='.$ResId);
+ #$r->print('
src='.$cache->{$ResId.':source'});
+ #$r->print('
tit='.$cache->{$ResId.':title'});
+
+ my $res = &Apache::lonnet::declutter($cache->{$ResId.':source'});
my $urlres=$res;
$ResId=~/(\d+)\.(\d+)/;
@@ -579,46 +594,46 @@ sub TableRow {
my($PrOrd,$Temp,$StdNo,$TotalTries,$MxTries,$Avg,$YES,$Override,
$Wrng,$DoD,$SD,$Sk,$_D1,$_D2,$DiscNo,$Prob)=split(/\&/,$Str);
# $r->print('
'.$Str);
- if ($ENV{'form.showcsv'}) {
+ my $Ptr;
+ if($cache->{'DisplayFormat'} eq 'Display CSV Format') {
my ($ResId,$Dummy)=split(/\*/,$Prob);
- my $Ptr = "\n".'
'.
- "\n".'"'.($RealIdx+1).'",'.
- "\n".'"'.$cache->{'title_'.$ResId}.$Dummy.'",'.
- "\n".'"'.$cache->{'src_'.$ResId}.'",'.
- "\n".'"'.$StdNo.'",'.
- "\n".'"'.$TotalTries.'",'.
- "\n".'"'.$MxTries.'",'.
- "\n".'"'.$Avg.'",'.
- "\n".'"'.$YES.'",'.
- "\n".'"'.$Override.'",'.
- "\n".'"'.$Wrng.'",'.
- "\n".'"'.$DoD.'",'.
- "\n".'"'.$SD.'",'.
- "\n".'"'.$Sk.'",'.
- "\n".'"'.$_D1.'",'.
- "\n".'"'.$_D2.'"'.
- "\n".'"'.$DiscNo.'"';
+ $Ptr="\n".'
'.
+ "\n".'"'.($RealIdx+1).'",'.
+ "\n".'"'.$cache->{'title_'.$ResId}.$Dummy.'",'.
+ "\n".'"'.$cache->{'src_'.$ResId}.'",'.
+ "\n".'"'.$StdNo.'",'.
+ "\n".'"'.$TotalTries.'",'.
+ "\n".'"'.$MxTries.'",'.
+ "\n".'"'.$Avg.'",'.
+ "\n".'"'.$YES.'",'.
+ "\n".'"'.$Override.'",'.
+ "\n".'"'.$Wrng.'",'.
+ "\n".'"'.$DoD.'",'.
+ "\n".'"'.$SD.'",'.
+ "\n".'"'.$Sk.'",'.
+ "\n".'"'.$_D1.'",'.
+ "\n".'"'.$_D2.'"'.
+ "\n".'"'.$DiscNo.'"';
$r->print("\n".$Ptr);
- }
- else{
- my $Ptr = "\n".''.
- "\n".''.($RealIdx+1).' | '.
- # "\n".''.$PrOrd.$Temp.' | '.
- "\n".''.$Temp.' | '.
- "\n".' '.$StdNo.' | '.
- "\n".''.$TotalTries.' | '.
- "\n".''.$MxTries.' | '.
- "\n".''.$Avg.' | '.
- "\n".' '.$YES.' | '.
- "\n".' '.$Override.' | '.
- "\n".' '.$Wrng.' | '.
- "\n".' '.$DoD.' | '.
- "\n".' '.$SD.' | '.
- "\n".' '.$Sk.' | '.
- "\n".' '.$_D1.' | '.
- "\n".' '.$_D2.' | '.
- "\n".' '.$DiscNo.' | ';
+ } else {
+ $Ptr="\n".'
'.
+ "\n".''.($RealIdx+1).' | '.
+ # "\n".''.$PrOrd.$Temp.' | '.
+ "\n".''.$Temp.' | '.
+ "\n".' '.$StdNo.' | '.
+ "\n".''.$TotalTries.' | '.
+ "\n".''.$MxTries.' | '.
+ "\n".''.$Avg.' | '.
+ "\n".' '.$YES.' | '.
+ "\n".' '.$Override.' | '.
+ "\n".' '.$Wrng.' | '.
+ "\n".' '.$DoD.' | '.
+ "\n".' '.$SD.' | '.
+ "\n".' '.$Sk.' | '.
+ "\n".' '.$_D1.' | '.
+ "\n".' '.$_D2.' | '.
+ "\n".' '.$DiscNo.' | ';
$r->print("\n".$Ptr.'
' );
}
# $GraphDat->{$RealIdx}=$DoD.':'.$Wrng;
@@ -646,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;
}
|