--- loncom/interface/statistics/lonproblemanalysis.pm 2003/10/20 20:42:39 1.43 +++ loncom/interface/statistics/lonproblemanalysis.pm 2003/10/21 16:00:30 1.44 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonproblemanalysis.pm,v 1.43 2003/10/20 20:42:39 matthew Exp $ +# $Id: lonproblemanalysis.pm,v 1.44 2003/10/21 16:00:30 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -91,7 +91,9 @@ sub BuildProblemAnalysisPage { # my $resource = &get_resource_from_symb($symb); if (defined($resource)) { + $r->print('

'.$resource->{'title'}.'

'); $r->print('

'.$resource->{'src'}.'

'); + $r->rflush(); my %Data = &get_problem_data($resource->{'src'}); my $PerformanceData = &Apache::loncoursedata::get_optionresponse_data @@ -118,30 +120,33 @@ sub BuildProblemAnalysisPage { $rendered_problem. ''); $r->rflush(); - ## - ## Analyze the problem - if (defined($PerformanceData) && - ref($PerformanceData) eq 'ARRAY') { - if ($ENV{'form.AnalyzeOver'} eq 'Tries') { - my $analysis_html = &tries_analysis($r,$PerformanceData, - $ORdata); - $r->print($analysis_html); - $r->rflush(); - } elsif ($ENV{'form.AnalyzeOver'} eq 'Time') { - my $analysis_html = &time_analysis($PerformanceData, - $ORdata); - $r->print($analysis_html); - $r->rflush(); + if (! exists($ENV{'form.ExcelOutput'})) { + ## + ## Analyze the problem + if (defined($PerformanceData) && + ref($PerformanceData) eq 'ARRAY') { + if ($ENV{'form.AnalyzeOver'} eq 'Tries') { + my $analysis_html = &tries_analysis($r, + $PerformanceData, + $ORdata); + $r->print($analysis_html); + $r->rflush(); + } elsif ($ENV{'form.AnalyzeOver'} eq 'Time') { + my $analysis_html = &time_analysis($PerformanceData, + $ORdata); + $r->print($analysis_html); + $r->rflush(); + } else { + $r->print('

'. + &mt('The analysis you have selected is '. + 'not supported at this time'). + '

'); + } } else { $r->print('

'. - &mt('The analysis you have selected is '. - 'not supported at this time'). + &mt('There is no student data for this problem.'). '

'); } - } else { - $r->print('

'. - &mt('There is no student data for this problem.'). - '

'); } } else { $r->print('resource is undefined'); @@ -735,10 +740,9 @@ sub Concept_Time_Analysis { ## ######################################################### ######################################################### - sub prepare_excel_sheet { my ($r,$resource,$PerformanceData,$ORdata) = @_; - my $response = '

'.&mt('Excel Spreadsheet Creation').'

'; + my $response = ''; my (undef,$Foils,$Concepts) = &build_foil_index($ORdata); # # Create excel worksheet @@ -761,7 +765,6 @@ sub prepare_excel_sheet { my $format; $format->{'header'} = $workbook->add_format(bold => 1, bottom => 1, -# text_wrap => 1, align => 'center'); $format->{'bold'} = $workbook->add_format(bold=>1); $format->{'h1'} = $workbook->add_format(bold=>1, size=>18); @@ -796,14 +799,16 @@ sub prepare_excel_sheet { if ($result ne 'okay') { # Do something useful } - $response_data_sheet->activate(); + $response_data_sheet->activate(); # # Close the excel file $workbook->close(); # # Write a link to allow them to download it - $result .= '
'. - 'Your Excel spreadsheet.'."\n"; + $result .= '

'.&mt('Excel Raw Data Output').'

'. + '

'. + &mt('Your Excel spreadsheet.'). + '

'."\n"; return $result; }