--- loncom/interface/statistics/lonstudentassessment.pm 2005/02/25 23:32:23 1.115 +++ loncom/interface/statistics/lonstudentassessment.pm 2005/03/10 17:33:58 1.117 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.115 2005/02/25 23:32:23 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.117 2005/03/10 17:33:58 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -939,6 +939,7 @@ sub SingleStudentTotal { my $excel_sheet; my $excel_workbook; +my $format; my $filename; my $rows_output; @@ -1005,9 +1006,6 @@ sub excel_initialize { } return if ($request_aborted); # - $filename = '/prtspool/'. - $ENV{'user.name'}.'_'.$ENV{'user.domain'}.'_'. - time.'_'.rand(1000000000).'.xls'; # $excel_workbook = undef; $excel_sheet = undef; @@ -1035,24 +1033,9 @@ sub excel_initialize { my $first_data_row = $rows_output++; # # Create sheet - $excel_workbook = Spreadsheet::WriteExcel->new('/home/httpd'.$filename); - # - # Check for errors - if (! defined($excel_workbook)) { - $r->log_error("Error creating excel spreadsheet $filename: $!"); - $r->print("Problems creating new Excel file. ". - "This error has been logged. ". - "Please alert your LON-CAPA administrator"); - return ; - } - # - # The excel spreadsheet stores temporary data in files, then put them - # together. If needed we should be able to disable this (memory only). - # The temporary directory must be specified before calling 'addworksheet'. - # File::Temp is used to determine the temporary directory. - $excel_workbook->set_tempdir($Apache::lonnet::tmpdir); - # - my $format = &Apache::loncommon::define_excel_formats($excel_workbook); + ($excel_workbook,$filename,$format)= + &Apache::loncommon::create_workbook($r); + return if (! defined($excel_workbook)); # # Add a worksheet my $sheetname = $ENV{'course.'.$ENV{'request.course.id'}.'.description'}; @@ -1610,7 +1593,7 @@ END &Apache::loncommon::csv_translate($seq->compTitle).'",'; my $count = 0; if ($chosen_output->{'every_problem'}) { - foreach my $res (@{$seq->{'contents'}}) { + foreach my $res (&get_resources($navmap,$seq)) { if (scalar(@{$res->parts}) < 1) { next; }