--- loncom/interface/statistics/lonproblemanalysis.pm 2002/08/13 00:37:18 1.5 +++ loncom/interface/statistics/lonproblemanalysis.pm 2003/09/29 21:13:23 1.24 @@ -1,7 +1,6 @@ # The LearningOnline Network with CAPA -# (Publication Handler # -# $Id: lonproblemanalysis.pm,v 1.5 2002/08/13 00:37:18 stredwic Exp $ +# $Id: lonproblemanalysis.pm,v 1.24 2003/09/29 21:13:23 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -26,443 +25,202 @@ # 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 +# 5/12,7/26,9/7,11/22 Behrouz Minaei # ### -package Apache::lonproblemanalysis; +package Apache::lonproblemanalysis; use strict; use Apache::lonnet(); -use GDBM_File; - -my $jr; +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; - if(&Apache::loncoursedata::DownloadStudentCourseDataSeparate($students, 'true', - $cacheDB, 'true', - 'true', $courseID, - $r, $c) ne 'OK') { - $r->print($Str); - return; - } - - - unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { - $Str .= 'Unable to tie database.'; - $r->print($Str); - return; - } - - my ($problemId, $part, $responseId)=split(':',$cache{'AnalyzeInfo'}); - my $uri = $cache{$problemId.':source'}; - my $problem = $cache{$problemId.':problem'}; - my $title = $cache{$problemId.':title'}; - my $interval = $cache{'Interval'}; - - my %ConceptData; - $ConceptData{"Interval"} = $interval; - - #Initialize the option response true answers - my ($analyzeData) = &InitAnalysis($uri, $part, $responseId, $problem, - $students->[0], $courseID); - if(defined($analyzeData->{'error'})) { - $Str .= $analyzeData->{'error'}.''. + # Oh this is dumb! Need to rewrite relative links + # otherwise images (for example) will not show. + &Apache::lonnet::ssi_body($resource->{'src'}). + ' |
\nProblem choice = $symb $id\n\n"); + $r->print('