--- loncom/interface/statistics/lonstudentassessment.pm 2004/05/18 17:43:36 1.101 +++ loncom/interface/statistics/lonstudentassessment.pm 2004/08/25 21:04:37 1.104 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.101 2004/05/18 17:43:36 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.104 2004/08/25 21:04:37 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -607,6 +607,7 @@ Return a line of the chart for a student my $nodata_count; # The number of students for which there is no data my %prog_state; # progress state used by loncommon PrgWin routines + my $total_sum_width; sub html_initialize { my ($r) = @_; @@ -633,6 +634,7 @@ sub html_initialize { } # # Compute the column widths and output the sequence titles + my $total_count; foreach my $sequence (&Apache::lonstatistics::Sequences_with_Assess()){ # # Comptue column widths @@ -642,6 +644,7 @@ sub html_initialize { # Use 1 digit for a space $sequence->{'width_sum'} += 1; } + $total_count += $sequence->{'num_assess_parts'}; # Use 3 digits for the sum $sequence->{'width_sum'} += 3; } @@ -672,7 +675,8 @@ sub html_initialize { length($sequence->{'title'}) ).$padding; } - $Str .= "total\n"; + $total_sum_width = length($total_count)+1; + $Str .= " total\n"; $Str .= "
";
     $r->print($Str);
     $r->rflush();
@@ -690,6 +694,10 @@ sub html_outputstudent {
     my @to_show = &get_student_fields_to_show();
     foreach my $field (@to_show) {
         my $title=$student->{$field};
+        # Deal with 'comments' - how I love special cases
+        if ($field eq 'comments') {
+            $title = ''.&mt('Comments').'';
+        }
         my $base = length($title);
         my $width=$Apache::lonstatistics::StudentData{$field}->{'width'};
         $Str .= $title.' 'x($width-$base).$padding;
@@ -767,9 +775,9 @@ sub html_outputstudent {
         $max   += $seq_stats->{'max'};
     }
     if (! defined($score)) {
-        $score = ' 'x3;
+        $score = ' ' x $total_sum_width;
     }
-    $Str .= ' '.' 'x(length($max)-length($score)).$score.'/'.$max;
+    $Str .= ' '.' 'x($total_sum_width-length($score)).$score.' / '.$max;
     $Str .= " \n";
     #
     $r->print($Str);
@@ -1321,7 +1329,12 @@ sub excel_outputstudent {
     # Write out student data
     my @to_show = &get_student_fields_to_show();
     foreach my $field (@to_show) {
-        $excel_sheet->write($rows_output,$cols_output++,$student->{$field});
+        my $value = $student->{$field};
+        if ($field eq 'comments') {
+            $value = &Apache::lonmsg::retrieve_instructor_comments
+                ($student->{'username'},$student->{'domain'});
+        }
+        $excel_sheet->write($rows_output,$cols_output++,$value);
     }
     #
     # Get student assessment data
@@ -1582,7 +1595,12 @@ sub csv_outputstudent {
     # Output student fields
     my @to_show = &get_student_fields_to_show();
     foreach my $field (@to_show) {
-        $Str .= '"'.&Apache::loncommon::csv_translate($student->{$field}).'",';
+        my $value = $student->{$field};
+        if ($field eq 'comments') {
+            $value = &Apache::lonmsg::retrieve_instructor_comments
+                ($student->{'username'},$student->{'domain'});
+        }        
+        $Str .= '"'.&Apache::loncommon::csv_translate($value).'",';
     }
     #
     # Get student assessment data
@@ -1768,7 +1786,7 @@ sub StudentTriesOnSequence {
                 }
             }
             #
-            if (! defined($tries)) {
+            if (! defined($tries) || $symbol eq '.') {
                 $tries = $symbol;
             }
             push (@TriesData,$tries);