--- loncom/interface/statistics/lonstudentassessment.pm 2002/12/24 21:00:21 1.23
+++ loncom/interface/statistics/lonstudentassessment.pm 2003/01/09 15:59:17 1.25
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# (Publication Handler
#
-# $Id: lonstudentassessment.pm,v 1.23 2002/12/24 21:00:21 minaeibi Exp $
+# $Id: lonstudentassessment.pm,v 1.25 2003/01/09 15:59:17 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -101,6 +101,7 @@ sub BuildStudentAssessmentPage {
if($c->aborted()) { return $Str; }
my $selected=0;
+ my $Count = 0;
$r->print('
'."\n");
foreach (@$students) {
if($c->aborted()) { return $Str; }
@@ -132,8 +133,16 @@ sub BuildStudentAssessmentPage {
push(@before, $_);
}
}
- my $displayString = 'DISPLAYDATA'.$spacing;
- $r->print(&Apache::lonhtmlcommon::FormatStudentInformation(
+ $Count++;
+ my $out = '';
+# $out .= sprintf("%3d", $Count);
+ if($Count % 2) {
+ $out .= '';
+ } else {
+ $out .= '';
+ }
+ my $displayString = $out.'DISPLAYDATA'.$spacing;
+ $r->print(&Apache::lonhtmlcommon::FormatStudentInformation(
\%cache, $_,
\@before,
$displayString,
@@ -238,6 +247,7 @@ sub CreateTableHeadings {
my($cache,$spacing,$infoKeys,$infoHeadings,$sequenceKeys,
$sequenceHeadings)=@_;
+# my $Str = '     ';
my $Str = '';
$Str .= ''."\n";
@@ -415,10 +425,14 @@ sub StudentAverageTotal {
$ProblemsSolved += $cache->{$name.':problemsSolved'};
$TotalProblems += $cache->{$name.':totalProblems'};
}
- $ProblemsSolved /= $StudentCount;
- $TotalProblems /= $StudentCount;
-
- $Str .= ''."\n";
+ if ($StudentCount) {
+ $ProblemsSolved /= $StudentCount;
+ $TotalProblems /= $StudentCount;
+ } else {
+ $ProblemsSolved = 0;
+ $TotalProblems = 0;
+ }
+ $Str .= ''."\n";
$Str .= 'Students Count | '.
$StudentCount.' |
'."\n";
$Str .= 'Total Problems | '.
@@ -427,16 +441,21 @@ sub StudentAverageTotal {
$ProblemsSolved.' |
'."\n";
$Str .= '
'."\n";
- $Str .= ''."\n";
+ $Str .= ''."\n";
$Str .= 'Title | Total Problems | '.
'Average Correct |
'."\n";
foreach my $S(@$sequenceKeys) {
my $title=$cache->{$S.':title'};
#$Str .= $cache->{$S.':problems'};
- #my @problems=split(':', $cache->{$S.':problems'});
+ #my @problems=split(':', $cache->{$S.':problems'});
#my $pCount=scalar @problems;
my $pCount=MaxSeqPr($cache,@$students[0],$S);
- my $crr=sprintf( "%.2f", $Correct{$S}/$StudentCount );
+ my $crr;
+ if ($StudentCount) {
+ $crr=sprintf( "%.2f", $Correct{$S}/$StudentCount );
+ } else {
+ $crr="0.00";
+ }
$Str .= ''.$title.
' | '.$pCount.
' | '.$crr.
|