--- loncom/interface/lonstatistics.pm 2002/03/06 18:42:01 1.7
+++ loncom/interface/lonstatistics.pm 2002/03/07 00:05:21 1.9
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# (Publication Handler
#
-# $Id: lonstatistics.pm,v 1.7 2002/03/06 18:42:01 minaeibi Exp $
+# $Id: lonstatistics.pm,v 1.9 2002/03/07 00:05:21 minaeibi Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -67,7 +67,6 @@ my $OpSel1;
my $OpSel2;
my $OpSelDis1;
my $OpSelDis2;
-my $CurDis=0;
my $OpSel3;
my $OpSel4;
my $GData;
@@ -79,8 +78,7 @@ my $HWN;
my $P_Order;
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.",12,"U.A.",13,"L.A.",14,"U.R.",15,"L.R.");
+ 9,"S.D.",10,"Skew.",11,"D.F.1st",12,"D.F.2nd");
#------- Processing upperlist and lowerlist according to each problem
sub ProcessDisc {
@@ -91,7 +89,8 @@ sub ProcessDisc {
my @Dis;
my $Slvd=0;
my $tmp;
- my $Sum=0;
+ my $Sum1=0;
+ my $Sum2=0;
my $nIdx=0;
my $nStud=0;
my %Proc;
@@ -103,14 +102,16 @@ sub ProcessDisc {
do {
$nIdx++;
$nStud++;
- $Sum += $Dis[$CurDis];
+ $Sum1 += $Dis[0];
+ $Sum2 += $Dis[1];
($Prb,$tmp)=split(/\=/,$List[$nIdx]);
@Dis=split(/\+/,$tmp);
} while ( $Prb eq $Temp && $nIdx < $Count );
- $Proc{$Temp}=$Sum.':'.$nStud;
- $Proc{$Temp}=($Sum/$nStud).':'.$nStud;
+# $Proc{$Temp}=($Sum1/$nStud).':'.$nStud;
+ $Proc{$Temp}=($Sum1/$nStud).':'.($Sum2/$nStud);
# $r->print("$nIdx) $Temp --> ($nStud) $Proc{$Temp}
");
- $Sum=0;
+ $Sum1=0;
+ $Sum2=0;
$nStud=0;
}
return %Proc;
@@ -348,27 +349,21 @@ sub PreStatTable {
' #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) ]
'.
-# ' DoDiff : Degree of Difficulty of the problem. [ Tries/(#YES+#yes+0.1) ]
'.
- ' DoDiff : Degree of Difficulty of the problem. [ 1 - ((#YES+#yes) / Tries) ]
'.
+# ' DoDiff : Degree of Difficulty of the problem. [ Tries/(#YES+#yes+0.1) ]
'. Kashy formula
+ ' DoDiff : Degree of Difficulty of the problem. [ 1 - ((#YES+#yes) / Tries) ]
'. #Gerd formula
' S.D. : Standard Deviation of the tries.'.
'[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1)'.
' where Xi denotes every student\'s tries ]
'.
' Skew. : Skewness of the students tries.'.
- ' [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ]
'.
-
- ' Dis.F. : Discrimination Factor. [ Sum of Partial Credits'.
- ' Awarded / Total Number of Tries in %27 upper and lower students]
'.
- ' U.A. : Upper %27 Award
'.
- ' L.A. : Lower %27 Award
'.
- ' U.R. : Upper %27 Records
'.
- ' L.R. : Lower %27 Records'.
-
-# "
The Upper 27% has $UpCnt records.".
-# " The Lower 27% has $UpCnt records
".
-# "The Criterion of sorting the students: ".
-# "( Sum of Partial Credits Awarded / ".
-# "Total Number of Tries )".
-
+ ' [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ]
'.
+ ' Dis.F. : Discrimination Factor: A Standard for '.
+ 'evaluating the problem according to a Criterion
'.
+ ' [Applied Criterion in %27 Upper Students - '.
+ 'Applied the same Criterion in %27 Lower Students]
'.
+ ' 1st Criterion for Sorting the Students: '.
+ 'Sum of Partial Credit Awarded / Total Number of Tries
'.
+ ' 2nd Criterion for Sorting the Students: '.
+ 'Total number of Correct Answers / Total Number of Tries'.
'';
$r->print($Ptr);
@@ -563,8 +558,6 @@ sub ExtractStudentData {
# $DisF .= '+'.$TempHash{"$part.Time"};
$TimeTot += $TempHash{"$part.Time"};
$Dis .= $TempHash{$part.'.PrOrd'}.'='.$DisF.'+'.$Yes;
-
- #$r->print('
'.$DisFactor,'###',$DiscFac{$DisFactor});
$ptr .= ":$TempHash{$part.'.Tries'}".
":$TempHash{$part.'.Wrongs'}".
":$TempHash{$part.'.Code'}";
@@ -584,7 +577,6 @@ sub ExtractStudentData {
my $DisFac = ( $TotalTries ) ? ($TotParCr/$TotalTries) : 0;
my $DisFactor = sprintf( "%.4f", $DisFac );
$DiscFac{$DisFactor}=$Dis;
- #$r->print('
'.$DisFactor,'###',$DiscFac{$DisFactor});
#my $time;
#if ($ProbSolved){
#$time = int(($TimeTot/$ProbSolved)-10000000);
@@ -811,14 +803,12 @@ ENDPOP
}
#--------------------- Compute the Discrimination Factors
- my ($UpD,$UpNo)=split(/\:/,$DisUp{$lpr[$i]});
- my ($LwD,$LwNo)=split(/\:/,$DisLow{$lpr[$i]});
- $UpNo = ($UpNo) ? $UpNo : 0;
- $LwNo = ($LwNo) ? $LwNo : 0;
- my $U_D = sprintf("%.2f", $UpD);
- my $L_D = sprintf("%.2f", $LwD);
- my $DisFac = $UpD - $LwD;
- my $_Dis = sprintf("%.2f", $DisFac);
+ my ($Up1,$Up2)=split(/\:/,$DisUp{$lpr[$i]});
+ my ($Lw1,$Lw2)=split(/\:/,$DisLow{$lpr[$i]});
+ my $Dis1 = $Up1 - $Lw1;
+ my $Dis2 = $Up2 - $Lw2;
+ my $_D1 = sprintf("%.2f", $Dis1);
+ my $_D2 = sprintf("%.2f", $Dis2);
#----------------- Some restition in presenting the float numbers
my $Avg = sprintf( "%.2f", $Average );
@@ -829,8 +819,7 @@ ENDPOP
my $join = $PrOrd.':'.$Temp.':'.$StdNo.':'.
$TotalTries.':'.$MxTries.':'.$Avg.':'.
$YES.':'.$Override.':'.$Wrng.':'.$DoD.':'.
- $SD.':'.$Sk.':'.$_Dis.':'.$U_D.':'.
- $L_D.':'.$UpNo.':'.$LwNo.':'.$Prob;
+ $SD.':'.$Sk.':'.$_D1.':'.$_D2.':'.$Prob;
$CachData{($p_count-1)}=$join;
$urlres=~/^(\w+)\/(\w+)/;
@@ -899,11 +888,10 @@ sub Cache_Statistics {
sub TableRow {
my ($Str,$Idx,$RealIdx)=@_;
my($PrOrd,$Temp,$StdNo,$TotalTries,$MxTries,$Avg,$YES,
- $Override,$Wrng,$DoD,$SD,$Sk,$_Dis,$U_D,$L_D,$UpNo,$LwNo,
- $Prob)=split(/\:/,$Str);
+ $Override,$Wrng,$DoD,$SD,$Sk,$_D1,$_D2,$Prob)=split(/\:/,$Str);
$r->print( "\n".'