[LON-CAPA-cvs] cvs: loncom /interface lonstatistics.pm

minaeibi lon-capa-cvs@mail.lon-capa.org
Wed, 06 Mar 2002 23:56:13 -0000


minaeibi		Wed Mar  6 18:56:13 2002 EDT

  Modified files:              
    /loncom/interface	lonstatistics.pm 
  Log:
  Added 2 criteria for discimination Factor
  
  
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.7 loncom/interface/lonstatistics.pm:1.8
--- loncom/interface/lonstatistics.pm:1.7	Wed Mar  6 13:42:01 2002
+++ loncom/interface/lonstatistics.pm	Wed Mar  6 18:56:13 2002
@@ -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.8 2002/03/06 23:56:13 minaeibi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -67,7 +67,6 @@
 my $OpSel2;
 my $OpSelDis1;
 my $OpSelDis2;
-my $CurDis=0;
 my $OpSel3;
 my $OpSel4;
 my $GData;
@@ -79,8 +78,7 @@
 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 @@
     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 @@
 	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} <br>");
-	$Sum=0;
+	$Sum1=0;
+	$Sum2=0;
 	$nStud=0;
     }
     return %Proc;
@@ -348,27 +349,21 @@
     '<b>  #yes   </b>: Number of students solved the problem by override.<br>'.
     '<b>  %Wrng  </b>: Percentage of students tried to solve the problem but'.
     ' still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ]<br>'.
-#    '  DoDiff : Degree of Difficulty of the problem. [ Tries/(#YES+#yes+0.1) ]<br>'.
-    '<b>  DoDiff </b>: Degree of Difficulty of the problem. [ 1 - ((#YES+#yes) / Tries) ]<br>'.
+#    '  DoDiff : Degree of Difficulty of the problem. [ Tries/(#YES+#yes+0.1) ]<br>'. Kashy formula
+    '<b>  DoDiff </b>: Degree of Difficulty of the problem. [ 1 - ((#YES+#yes) / Tries) ]<br>'. #Gerd formula
     '<b>  S.D.  </b> : Standard Deviation of the tries.'.
     '[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1)'.
     ' where Xi denotes every student\'s tries ]<br>'.
     '<b>  Skew.  </b>: Skewness of the students tries.'.
-    ' [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ]<br>'.
-
-    '<b>  Dis.F. </b>: Discrimination Factor. [ Sum of Partial Credits'.
-    ' Awarded / Total Number of Tries in %27 upper and lower students]<br>'.	
-    '<b>  U.A.   </b>: Upper %27 Award<br>'.	
-    '<b>  L.A.   </b>: Lower %27 Award<br>'.	
-    '<b>  U.R.   </b>: Upper %27 Records<br>'.	
-    '<b>  L.R.   </b>: Lower %27 Records'.	
-
-#    "<br>The <b>Upper 27%</b> has <b>$UpCnt</b> records.".
-#    "&nbsp;&nbsp;The <b>Lower 27%</b> has <b>$UpCnt</b> records <br>".
-#    "The Criterion of sorting the students: ". 
-#    "<b>( Sum of Partial Credits Awarded / ".
-#    "Total Number of Tries )</b>".
-
+	' [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ]<br>'.
+    '<b>  Dis.F. </b>: Discrimination Factor: A Standard for '.
+	'evaluating the problem according to a Criterion<br>'.
+	'<b>           [Applied Criterion in %27 Upper Students - '.
+	'Applied the same Criterion in %27 Lower Students]</b><br>'.
+    '<b>           1st </b>Criterion for Sorting the Students: '.
+	'Sum of Partial Credit Awarded / Total Number of Tries<br>'.
+    '<b>           2nd </b>Criterion for Sorting the Students: '.
+	'Total number of Correct Answers / Total Number of Tries'.	
             '</pre>';
 
     $r->print($Ptr);
@@ -811,14 +806,12 @@
 	    }
 
 #--------------------- 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 +822,7 @@
 	    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 +891,10 @@
 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".'<tr>'.
                "\n".'<td>'.($RealIdx+1).'</td>'.
-               "\n".'<td bgcolor="#FFFFFF">'.$Temp.'</td>'.
+               "\n".'<td>'.$Temp.'</td>'.
                "\n".'<td bgcolor="#EEFFCC"> '.$StdNo.'</td>'.
                "\n".'<td bgcolor="#EEFFCC">'.$TotalTries.'</td>'.
                "\n".'<td bgcolor="#EEFFCC">'.$MxTries.'</td>'.
@@ -914,11 +905,8 @@
                "\n".'<td bgcolor="#FFDDDD">'.$DoD.'</td>'.
                "\n".'<td bgcolor="#DDFFDD"> '.$SD.'</td>'.
                "\n".'<td bgcolor="#DDFFDD"> '.$Sk.'</td>'.
-               "\n".'<td bgcolor="#FFDDCC"> '.$_Dis.'</td>'.
-               "\n".'<td bgcolor="#FFFFDD"> '.$U_D.'</td>'.
-               "\n".'<td bgcolor="#FFFFDD"> '.$L_D.'</td>'.
-               "\n".'<td bgcolor="#FFFFDD"> '.$UpNo.'</td>'.
-               "\n".'<td bgcolor="#FFFFDD"> '.$LwNo.'</td>'.
+               "\n".'<td bgcolor="#FFDDFF"> '.$_D1.'</td>'.
+               "\n".'<td bgcolor="#FFDDFF"> '.$_D2.'</td>'.
                "\n".'</tr>' );
     $GraphDat{$RealIdx}=$DoD.':'.$Wrng;
 }
@@ -1148,19 +1136,10 @@
 }
 
 sub GetStatus {
-
-#    $OpSelDis1='';
-#    $OpSelDis2='';
     $OpSel1='';
     $OpSel2='';
     $OpSel3='';
     $OpSel4='';
-
-#    if ( $ENV{'form.DisType'} eq 'Total Number of Correct Answers' ) { 
-#	$OpSelDis1='selected'; 
-#	$CurDis=0;
-#    }
-#    else { $OpSel2 = 'selected'; $CurDis = 1;}
 
     if ( $ENV{'form.order'} eq 'Descending' ) { $OpSel2='selected'; }
     else { $OpSel1 = 'selected'; }