--- loncom/interface/statistics/lonproblemstatistics.pm 2005/04/07 06:56:24 1.104 +++ loncom/interface/statistics/lonproblemstatistics.pm 2006/02/05 19:10:28 1.106 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonproblemstatistics.pm,v 1.104 2005/04/07 06:56:24 albertel Exp $ +# $Id: lonproblemstatistics.pm,v 1.106 2006/02/05 19:10:28 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -661,6 +661,11 @@ Main interface to problem statistics. my $navmap; my @sequences; +sub clean_up { + undef($navmap); + undef(@sequences); +} + sub BuildProblemStatisticsPage { my ($r,$c)=@_; undef($navmap); @@ -705,6 +710,7 @@ sub BuildProblemStatisticsPage { 'for the first analysis. Future analysis this session '. ' will not have this delay.'). '

'); + &clean_up(); return; } $r->rflush(); @@ -718,6 +724,7 @@ sub BuildProblemStatisticsPage { if (! ref($navmap)) { $r->print('

'.&mt('A course-wide error occured.').'

'. '

'.$navmap.'

'); + &clean_up(); return; } if (exists($env{'form.Excel'})) { @@ -765,6 +772,7 @@ sub BuildProblemStatisticsPage { &output_sequence_statistics($r); } } + &clean_up(); return; } @@ -1622,7 +1630,7 @@ sub compute_discrimination_factor { (\@Resources, [&Apache::lonstatistics::get_selected_sections()], $Apache::lonstatistics::enrollment_status,undef, - $starttime,$endtime); + $starttime,$endtime, $symb); # # compute their percent scores on the problems in the sequence, my $number_to_grab = int(scalar(@{$ranking})/4); @@ -1632,7 +1640,7 @@ sub compute_discrimination_factor { my @TopSet = map { $_->[&Apache::loncoursedata::RNK_student()]; - } @{$ranking}[($num_students-$number_to_grab)..($num_students-1)]; + } @{$ranking}[-$number_to_grab..0]; if (! @BottomSet || (@BottomSet == 1 && $BottomSet[0] eq '') || ! @TopSet || (@TopSet == 1 && $TopSet[0] eq '')) { return 'nan';