--- loncom/interface/statistics/lonproblemanalysis.pm 2004/01/19 16:33:16 1.57 +++ loncom/interface/statistics/lonproblemanalysis.pm 2004/01/19 21:31:08 1.60 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonproblemanalysis.pm,v 1.57 2004/01/19 16:33:16 matthew Exp $ +# $Id: lonproblemanalysis.pm,v 1.60 2004/01/19 21:31:08 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,6 +33,7 @@ use Apache::lonhtmlcommon(); use Apache::loncoursedata(); use Apache::lonstatistics; use Apache::lonlocal; +use Apache::lonstathelpers; use HTML::Entities(); use Time::Local(); use Spreadsheet::WriteExcel(); @@ -58,22 +59,6 @@ my @SubmitButtons = ({ name => 'PrevProb { name => 'ExcelOutput', text => 'Produce Excel Output' }); -sub render_resource { - my ($resource) = @_; - ## - ## Render the problem - my $base; - ($base,undef) = ($resource->{'src'} =~ m|(.*/)[^/]*$|); - $base = "http://".$ENV{'SERVER_NAME'}.$base; - my $rendered_problem = - &Apache::lonnet::ssi_body($resource->{'src'}); - $rendered_problem =~ s/<\s*form\s*/)|<\/nop>|g; - return '
'. - ''. - $rendered_problem. - '
'; -} sub BuildProblemAnalysisPage { my ($r,$c)=@_; @@ -152,7 +137,7 @@ sub BuildProblemAnalysisPage { my $resource = $current_problem->{'resource'}; $r->print('

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

'); $r->print('

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

'); - $r->print(&render_resource($resource)); + $r->print(&Apache::lonstathelpers::render_resource($resource)); $r->rflush(); my %Data = &get_problem_data($resource->{'src'}); my $ProblemData = $Data{$current_problem->{'part'}. @@ -898,16 +883,16 @@ sub OR_excel_sheet { } # my $result; - $result = &build_problem_data_worksheet($problem_data_sheet,$format, + $result = &OR_build_problem_data_worksheet($problem_data_sheet,$format, $Concepts,$ORdata); if ($result ne 'okay') { # Do something useful } - $result = &build_student_data_worksheet($student_data_sheet,$format); + $result = &OR_build_student_data_worksheet($student_data_sheet,$format); if ($result ne 'okay') { # Do something useful } - $result = &build_response_data_worksheet($response_data_sheet,$format, + $result = &OR_build_response_data_worksheet($response_data_sheet,$format, $PerformanceData,$Foils, $ORdata); if ($result ne 'okay') { @@ -1251,8 +1236,6 @@ sub build_foil_index { my @Foils = sort(keys(%Foildata)); my %Concepts; foreach my $foilid (@Foils) { - &Apache::lonnet::logthis('foilid = '.$foilid); - &Apache::lonnet::logthis('_Concept = '.$Foildata{$foilid}->{'_Concept'}); push(@{$Concepts{$Foildata{$foilid}->{'_Concept'}}}, $foilid); } @@ -1289,7 +1272,6 @@ sub build_foil_index { foreach my $concept (sort $sortfunction (keys(%Concepts))) { if (! defined($Concepts{$concept})) { $Concepts{$concept}=[]; - &Apache::lonnet::logthis('concept error: '.$concept.' does not have a value'); # next; } push(@Concepts,{ name => $concept, @@ -1720,6 +1702,7 @@ sub Process_OR_Row { my @Foilsubs = split('&',$submission); for (my $j=0;$j<=$#Foilgrades;$j++) { my ($foilid,$correct) = split('=',$Foilgrades[$j]); + $foilid = &Apache::lonnet::unescape($foilid); my (undef,$submission) = split('=',$Foilsubs[$j]); if ($correct) { $RowData{$foilid}->{'_correct'}++;