--- loncom/interface/statistics/lonproblemanalysis.pm 2002/08/05 20:53:38 1.4 +++ loncom/interface/statistics/lonproblemanalysis.pm 2003/10/10 13:35:43 1.29 @@ -1,7 +1,6 @@ # The LearningOnline Network with CAPA -# (Publication Handler # -# $Id: lonproblemanalysis.pm,v 1.4 2002/08/05 20:53:38 stredwic Exp $ +# $Id: lonproblemanalysis.pm,v 1.29 2003/10/10 13:35:43 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,501 +24,427 @@ # # http://www.lon-capa.org/ # -# (Navigate problems for statistical reports -# YEAR=2001 -# 5/5,7/9,7/25/1,8/11,9/13,9/26,10/5,10/9,10/22,10/26 Behrouz Minaei -# 11/1,11/4,11/16,12/14,12/16,12/18,12/20,12/31 Behrouz Minaei -# YEAR=2002 -# 1/22,2/1,2/6,2/25,3/2,3/6,3/17,3/21,3/22,3/26,4/7,5/6 Behrouz Minaei -# 5/12,5/14,5/15,5/19,5/26,7/16 Behrouz Minaei -# -### -package Apache::lonproblemanalysis; +package Apache::lonproblemanalysis; use strict; use Apache::lonnet(); -use GDBM_File; - -#my $jr; +use Apache::loncommon(); +use Apache::lonhtmlcommon(); +use Apache::loncoursedata(); +use Apache::lonstatistics; +use Apache::lonlocal; sub BuildProblemAnalysisPage { - my ($cacheDB, $r)=@_; - - my %cache; - unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { - $r->print('
Unable to tie database.'); - return; - } - - $r->print(&IntervalOptions($cache{'Interval'})); - $r->rflush(); - $r->print(&OptionResponseTable($cache{'OptionResponses'}, \%cache)); - - untie(%cache); - - return; -} - -sub BuildAnalyzePage { - my ($cacheDB, $students, $courseID,$r)=@_; - -# $jr = $r; - my $c = $r->connection; - - my $Str = ''; - my %cache; - &Create_PrgWin($r); - my $count=0; - foreach (@$students) { - &Update_PrgWin(scalar(@$students),$count,$_,$r); - if($c->aborted) { - return $Str; - } - my $downloadTime=''; - if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { - $downloadTime = $cache{$_.':lastDownloadTime'}; - untie(%cache); - } - if($downloadTime eq 'Not downloaded') { - my $courseData = - &Apache::loncoursedata::DownloadCourseInformation($_, - $courseID); - if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT(),0640)) { - &Apache::loncoursedata::ProcessStudentData(\%cache, - $courseData, $_); - untie(%cache); + my ($r,$c)=@_; + $r->print('