# The LearningOnline Network with CAPA # (Publication Handler # # $Id: lonproblemanalysis.pm,v 1.6 2002/08/13 14:44:33 stredwic Exp $ # # Copyright Michigan State University Board of Trustees # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). # # LON-CAPA is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # LON-CAPA is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with LON-CAPA; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # /home/httpd/html/adm/gpl.txt # # 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; use strict; use Apache::lonnet(); use GDBM_File; my $jr; 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'}.'