--- loncom/interface/statistics/lonproblemstatistics.pm 2002/07/29 21:23:22 1.5 +++ loncom/interface/statistics/lonproblemstatistics.pm 2002/07/29 22:01:11 1.6 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonproblemstatistics.pm,v 1.5 2002/07/29 21:23:22 minaeibi Exp $ +# $Id: lonproblemstatistics.pm,v 1.6 2002/07/29 22:01:11 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,7/25 Behrouz Minaei +# 5/12,5/14,5/15,5/19,5/26,7/16,7/25,7/29 Behrouz Minaei # ### @@ -80,24 +80,23 @@ sub BuildProblemStatisticsPage { unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) { return '
Unable to tie database.'; } - my $discriminantFactor; + my %discriminant=(); my @list=(); my %Discuss=&Apache::loncoursedata::LoadDiscussion($courseID); my $index=0; foreach (@$students) { $index++; #&Apache::lonstatistics::Update_PrgWin(++$index,$r); - $discriminantFactor = &ExtractStudentData(\%cache, $_, \@list, - \%Discuss, $r); + &ExtractStudentData(\%cache, $_, \@list,\%Discuss, $r, \%discriminant); } #&Apache::lonstatistics::Close_PrgWin($r); - my ($upper, $lower) = &Discriminant($discriminantFactor); + my ($upper, $lower) = &Discriminant(\%discriminant); 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."); my $color=&setbgcolor(0); - my %GraphDat= &BuildStatisticsTable(\%cache, $discriminantFactor, \@list, + my %GraphDat= &BuildStatisticsTable(\%cache, \%discriminant, \@list, \%Header, $students, $r, $color); untie(%cache); } @@ -146,9 +145,7 @@ sub CloseTable { # ------ Dump the Student's DB file and handling the data for statistics table sub ExtractStudentData { - my ($cache,$name,$list,$Discuss,$r)=@_; - my %discriminantFactor; - + my ($cache,$name,$list,$Discuss,$r,$discriminant)=@_; my $totalTries = 0; my $totalAwarded = 0; my $spent=0; @@ -296,7 +293,7 @@ sub ExtractStudentData { $Discussed=1; } my $time = $cache->{"$name:$LatestVersion:$problem:timestamp"}; - $Dis .= $tempProblemOrder.'='.$DisF.'+'.$Yes; + $Dis .= $tempSequenceOrder.'@'.$pOrder.'='.$DisF.'+'.$Yes; $ptr .= '&'.$partData{$_.':tries'}. '&'.$partData{$_.':wrong'}. '&'.$partData{$_.':code'}; @@ -336,11 +333,9 @@ sub ExtractStudentData { $pstr=$DisFactor.':'.$name.':'.$ProbTot.':'.$TotalOpend.':'. $totalTries.':'.$ProbSolved.':'.$TotFirst.':'. $TS_yes.':'.$TS.':'.$TotDiscuss; - $discriminantFactor{$pstr}=$Dis; + (%$discriminant)->{$pstr}=$Dis; } } - - return (\%discriminantFactor); } @@ -364,11 +359,6 @@ sub BuildStatisticsTable { my $NoElements = scalar @$list; my @List=sort(@$list); -# for (my $c=0;$c<$NoElements;$c++) { -## $r->print(''; - $Ptr .= '#Stdnts: | '; + $Ptr .= '#Stdnts'; $Ptr .= 'Total Number of Students opened the problem.'; $Ptr .= ' |
'; - $Ptr .= 'Tries: | '; + $Ptr .= 'Tries'; $Ptr .= 'Total Number of Tries for solving the problem.'; $Ptr .= ' |
'; - $Ptr .= 'Mod: | '; + $Ptr .= 'Mod'; $Ptr .= 'Maximunm Number of Tries for solving the problem.'; $Ptr .= ' |
'; - $Ptr .= 'Mean: | '; + $Ptr .= 'Mean'; $Ptr .= 'Average Number of the tries. [ Tries / #Stdnts ]'; $Ptr .= ' |
'; - $Ptr .= '#YES: | '; + $Ptr .= '#YES'; $Ptr .= 'Number of students solved the problem correctly.'; $Ptr .= ' |
'; - $Ptr .= '#yes: | '; + $Ptr .= '#yes'; $Ptr .= 'Number of students solved the problem by override.'; $Ptr .= ' |
'; - $Ptr .= '%Wrng: | '; + $Ptr .= '%Wrng'; $Ptr .= 'Percentage of students tried to solve the problem '; $Ptr .= 'but still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ]'; $Ptr .= ' |
'; - $Ptr .= 'DoDiff: | '; + $Ptr .= 'DoDiff'; $Ptr .= 'Degree of Difficulty of the problem. '; $Ptr .= '[ 1 - ((#YES+#yes) / Tries) ]'; $Ptr .= ' |
'; - $Ptr .= 'S.D.: | '; + $Ptr .= 'S.D.'; $Ptr .= 'Standard Deviation of the tries. '; $Ptr .= '[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1) '; $Ptr .= 'where Xi denotes every student\'s tries ]'; $Ptr .= ' |
'; - $Ptr .= 'Skew.: | '; + $Ptr .= 'Skew.'; $Ptr .= 'Skewness of the students tries.'; $Ptr .= '[(sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3)]'; $Ptr .= ' |
'; - $Ptr .= 'Dis.F.: | '; + $Ptr .= 'Dis.F.'; $Ptr .= 'Discrimination Factor: A Standard for evaluating the ';
$Ptr .= 'problem according to a Criterion '; $Ptr .= '[Applied Criterion in %27 Upper Students - '; |