--- loncom/interface/lonstatistics.pm 2002/02/04 16:08:26 1.1 +++ loncom/interface/lonstatistics.pm 2002/02/05 12:24:45 1.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonstatistics.pm,v 1.1 2002/02/04 16:08:26 albertel Exp $ +# $Id: lonstatistics.pm,v 1.2 2002/02/05 12:24:45 minaeibi Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,7 +41,6 @@ use strict; use Apache::Constants qw(:common :http); use Apache::lonnet(); use Apache::lonhomework; -use Apache::loncommon(); use HTML::TokeParser; use GDBM_File; use Benchmark; @@ -51,6 +50,7 @@ my %hash; my %CachData; my %GraphDat; my %maps; +my @mapsort; my %section; my %StuBox; my %DiscFac; @@ -75,13 +75,15 @@ my $cid; my $firstres; my $lastres; my $DiscFlag=0; +my $HWN=0; my %Header = (0,"Problem Title",1,"#Stdnts",2,"Tries",3,"Mod", 4,"Mean",5,"#YES",6,"#yes",7,"%Wrng",8,"S.D.", 9,"Skew.",10,"DoDiff",11,"Map"); # 9,"Skew.",10,"DoDiff",11,"Dis.F.",12,"Resourse URL"); -my %class = (); +my %class = qw( +); my @LS; my @LF; @@ -214,6 +216,7 @@ sub Classify { # my %Slvd = &GetUniq(5,"Problems Solved"); # my (@L, $Index,$String)=@_; + my %Time = &GetUniqe(1,"Time",'S'); &GetUniqe(1,"Time",'F'); &GetUniqe(2,"Discrimination Factor",'S'); @@ -371,7 +374,7 @@ sub DiscriminationTable { "\n".''.$L_Dis.''. "\n".''.$UpNo.''. "\n".''.$LwNo.''. - "\n".''.($DoD).''. + "\n".''.$DoD.''. "\n".'' ); } $r->print("\n".''); @@ -573,9 +576,13 @@ sub PreStatTable { ' Mean : Average Number of the tries. [ Tries / #Stdns ]
'. ' #YES : Number of students solved the problem correctly.
'. ' #yes : Number of students solved the problem by override.
'. - ' %Wrng : Percentage of students tried to solve the problem but still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ]
'. - ' S.D. : Standard Deviation of the tries.[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1) where Xi is every student\'s tries ]
'. - ' Skew. : Skewness of the students tries. [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ]
'. + ' %Wrng : Percentage of students tried to solve the problem but'. + ' still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ]
'. + ' S.D. : Standard Deviation of the tries.'. + '[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1)'. + ' where Xi is every student\'s tries ]
'. + ' Skew. : Skewness of the students tries.'. + ' [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ]
'. # ' DoDiff : Degree of Difficulty of the problem. [ Tries/(#YES+#yes+0.1) ]
'. ' DoDiff : Degree of Difficulty of the problem. [ 1 - ((#YES+#yes) / Tries) ]
'. # ' Dis.F. : Discrimination Factor. [ Sum of Partial Credits Awarded / Total Number of Tries in %27 upper and lower students]'. @@ -809,6 +816,8 @@ sub tracetable { my $cmap=$hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$rid}}}; if ( $cmap eq 'sequence' || $cmap eq 'page' ) { $cols[$#cols+1]=0; + $HWN++; + $mapsort[$HWN]=$rid.$hash{'title_'.$rid}; #$maps{&Apache::lonnet::declutter($hash{'src_'.$rid})}= # $hash{'title_'.$rid}; } @@ -823,6 +832,7 @@ sub tracetable { if ($hash{'src_'.$frid}=~ /\.(problem|exam|quiz|assess|survey|form)$/) { $cols[$#cols+1]=$frid; + $mapsort[$HWN] .= '&'.$frid; } } } @@ -831,6 +841,7 @@ sub tracetable { if ($hash{'src_'.$rid}=~ /\.(problem|exam|quiz|assess|survey|form)$/) { $cols[$#cols+1]=$rid; + $mapsort[$HWN] .= '&'.$rid; } } } @@ -1045,7 +1056,7 @@ sub Cache_Statistics { $Override,$Wrng,$SD,$Sk,$DoD,$res,$Prob)=split(/\:/,$Post); $r->print( "\n".''. "\n".''.($nIdx+1).''. - "\n".''.$Temp.''. + "\n".''.$Temp.''. "\n".''.$StdNo.''. "\n".''.$TotalTries.''. "\n".''.$MxTries.''. @@ -1160,11 +1171,19 @@ sub ClassList { } else { $r->print('

Could not access course data

'); - } + } $r->print("Total number of students : ".($#students+1)); $r->rflush(); # --------------- Find all assessments and put them into some linear-like order &tracetable($firstres,'&'.$lastres.'&'); + +#my $c=0; +#foreach(@mapsort) { +# $c++; +# $r->print('
'.$mapsort[$c]); +#} +#$r->print('
Count = '.$c); + } # ------------------------------------------------------------- End render page @@ -1329,7 +1348,6 @@ sub handler { else { $r->content_type('text/html'); } - &Apache::loncommon::no_cache($r); $r->send_http_header; return OK; }