--- loncom/interface/statistics/lonstudentsubmissions.pm 2008/12/12 05:52:26 1.52 +++ loncom/interface/statistics/lonstudentsubmissions.pm 2010/04/12 16:28:22 1.59 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentsubmissions.pm,v 1.52 2008/12/12 05:52:26 raeburn Exp $ +# $Id: lonstudentsubmissions.pm,v 1.59 2010/04/12 16:28:22 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -225,7 +225,12 @@ sub prepare_html_output { my @extra_resp_headers = &get_extra_response_headers(); # # Create the table header - my @student_columns = ('username','domain','id','section'); + my @student_columns = @Apache::lonstatistics::SelectedStudentData; + foreach (@student_columns) { + if($_ eq 'all') { + @student_columns = ('fullname','username','domain','id','section','status','groups','comments'); + } + } # my %headers; my $student_column_count = scalar(@student_columns); @@ -285,7 +290,7 @@ sub prepare_html_output { $headers{'part'} .= qq{$tmpname}; $nonempty_part_headers = 1; } else { - $headers{'part'} .= qq{ }; + $headers{'part'} .= qq{ }; } $prob_span += $part_span; } @@ -326,8 +331,16 @@ sub prepare_html_output { } last if ($c->aborted()); foreach my $field (@student_columns) { - $student_row_data .= - ''.$student->{$field}.''; + $student_row_data .= ''; + # handle comments like in lonstudentassessment.pm + if($field eq 'comments') { + $student_row_data .= + ''.&mt('Comments').''; + } else { + $student_row_data .= $student->{$field}; + } + $student_row_data .= ''; } # # Figure out what it is we need to output for this student @@ -444,6 +457,7 @@ sub prepare_html_output { undef(@essays); } } # end of student loop + $r->print(''.$/); return; } @@ -931,11 +945,13 @@ sub prepare_csv_output { time.'_'.rand(1000000000).'.csv'; unless ($outputfile = Apache::File->new('>/home/httpd'.$filename)) { $r->log_error("Couldn't open $filename for output $!"); - $r->print('
' - .&mt('Problems occurred in writing the CSV file. ' - .'This error has been logged. ' - .'Please alert your LON-CAPA administrator.') - .'
'); + $r->print( + '

' + .&mt('Problems occurred in writing the CSV file.') + .' '.&mt('This error has been logged.') + .' '.&mt('Please alert your LON-CAPA administrator.') + .'

' + ); $outputfile = undef; } # @@ -1081,7 +1097,7 @@ sub CreateInterface { foreach ('HTML','Excel','CSV') { $output_selector .= '