--- loncom/interface/statistics/lonproblemstatistics.pm 2002/07/24 14:52:32 1.1 +++ loncom/interface/statistics/lonproblemstatistics.pm 2002/07/25 19:29:23 1.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonproblemstatistics.pm,v 1.1 2002/07/24 14:52:32 stredwic Exp $ +# $Id: lonproblemstatistics.pm,v 1.2 2002/07/25 19:29:23 minaeibi Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,7 +31,7 @@ # 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,5/14,5/15,5/19,5/26,7/16,7/25 Behrouz Minaei # ### @@ -43,20 +43,12 @@ use Apache::lonhtmlcommon; use Apache::loncoursedata; use GDBM_File; -my $r; -my %DoDiff; -my %Discuss; my %mapsort; -my %hash; -my %CachData; -my %color; -my %GraphDat; sub BuildProblemStatisticsPage { - my ($cacheDB, $students, $courseID, $c, $jr)=@_; - - $r = $jr; + my ($cacheDB, $students, $courseID, $c, $r,%color)=@_; my %cache; + #my %DoDiff; unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) { return '
Unable to tie database.'; } @@ -69,7 +61,7 @@ sub BuildProblemStatisticsPage { $Ptr .= ''."\n"; $Ptr .= &AscendOrderOptions($cache{'Ascend'}); $Ptr .= &ProblemStatisticsButtons($cache{'DisplayFormat'}); - $Ptr .= ''; + $Ptr .= ''; $Ptr .= &ProblemStatisticsLegend(); @@ -91,17 +83,22 @@ sub BuildProblemStatisticsPage { } my $discriminantFactor; my @list=(); + my %Discuss=&Apache::loncoursedata::LoadDiscussion($courseID); + my $index=0; foreach (@$students) { - $discriminantFactor = &ExtractStudentData(\%cache, $_, \@list); + #&Apache::lonstatistics::Update_PrgWin(++$index,$r); + $discriminantFactor = &ExtractStudentData(\%cache, $_, \@list,\%Discuss); } + #&Apache::lonstatistics::Close_PrgWin($r); + return $Ptr; my ($upper, $lower) = &Discriminant($discriminantFactor); my %Header = (0,"Homework Sets Order",1,"#Stdnts",2,"Tries",3,"Mod", 4,"Mean",5,"#YES",6,"#yes",7,"%Wrng",8,"DoDiff", 9,"S.D.",10,"Skew.",11,"D.F.1st",12,"D.F.2nd", 13, "Disc."); - &Apache::loncoursedata::LoadDiscussion($courseID, $courseID, \%Discuss); - &BuildStatisticsTable(\%cache, $discriminantFactor, \@list, \%Header, - $students); + + my %GraphDat= &BuildStatisticsTable(\%cache, $discriminantFactor, \@list, + \%Header, $students, $r, \%color); untie(%cache); @@ -109,16 +106,16 @@ sub BuildProblemStatisticsPage { } sub BuildDiffGraph { - my ($courseID)=@_; + my ($r)=@_; - my $graphData = &GetGraphData('DiffGraph', $courseID); + my $graphData = &GetGraphData('DiffGraph', $r); return ''; } sub BuildWrongGraph { - my ($courseID)=@_; + my ($r)=@_; - my $graphData = &GetGraphData('WrongGraph', $courseID); + my $graphData = &GetGraphData('WrongGraph', $r); return ''; } @@ -272,17 +269,10 @@ sub Build_log { } sub Activity { -# $rid=~/(\d+)\.(\d+)/; -# my $MapId=$1; -# my $PrbId=$2; -# my $MapOrg = $hash{'map_id_'.$MapId}; -# my $Map = &Apache::lonnet::declutter($MapOrg); -# my $URI = $hash{'src_'.$rid}; -# my $Symb = $Map.'___'.$PrbId.'___'.&Apache::lonnet::declutter($URI); my $file="/home/minaeibi/activity.log"; my $userid='adamsde1'; - $r->print("