Diff for /loncom/interface/lonstatistics.pm between versions 1.7 and 1.9

version 1.7, 2002/03/06 18:42:01 version 1.9, 2002/03/07 00:05:21
Line 67  my $OpSel1; Line 67  my $OpSel1;
 my $OpSel2;  my $OpSel2;
 my $OpSelDis1;  my $OpSelDis1;
 my $OpSelDis2;  my $OpSelDis2;
 my $CurDis=0;  
 my $OpSel3;  my $OpSel3;
 my $OpSel4;  my $OpSel4;
 my $GData;  my $GData;
Line 79  my $HWN; Line 78  my $HWN;
 my $P_Order;  my $P_Order;
 my %Header = (0,"Homework Sets Order",1,"#Stdnts",2,"Tries",3,"Mod",  my %Header = (0,"Homework Sets Order",1,"#Stdnts",2,"Tries",3,"Mod",
               4,"Mean",5,"#YES",6,"#yes",7,"%Wrng",8,"DoDiff",                4,"Mean",5,"#YES",6,"#yes",7,"%Wrng",8,"DoDiff",
               9,"S.D.",10,"Skew.",                9,"S.D.",10,"Skew.",11,"D.F.1st",12,"D.F.2nd");
               11,"D.F.",12,"U.A.",13,"L.A.",14,"U.R.",15,"L.R.");  
   
 #------- Processing upperlist and lowerlist according to each problem  #------- Processing upperlist and lowerlist according to each problem
 sub ProcessDisc {  sub ProcessDisc {
Line 91  sub ProcessDisc { Line 89  sub ProcessDisc {
     my @Dis;      my @Dis;
     my $Slvd=0;      my $Slvd=0;
     my $tmp;      my $tmp;
     my $Sum=0;      my $Sum1=0;
       my $Sum2=0;
     my $nIdx=0;      my $nIdx=0;
     my $nStud=0;      my $nStud=0;
     my %Proc;      my %Proc;
Line 103  sub ProcessDisc { Line 102  sub ProcessDisc {
  do {   do {
     $nIdx++;      $nIdx++;
     $nStud++;      $nStud++;
     $Sum += $Dis[$CurDis];      $Sum1 += $Dis[0];
       $Sum2 += $Dis[1];
     ($Prb,$tmp)=split(/\=/,$List[$nIdx]);      ($Prb,$tmp)=split(/\=/,$List[$nIdx]);
     @Dis=split(/\+/,$tmp);      @Dis=split(/\+/,$tmp);
  } while ( $Prb eq $Temp && $nIdx < $Count );   } while ( $Prb eq $Temp && $nIdx < $Count );
  $Proc{$Temp}=$Sum.':'.$nStud;  # $Proc{$Temp}=($Sum1/$nStud).':'.$nStud;
  $Proc{$Temp}=($Sum/$nStud).':'.$nStud;   $Proc{$Temp}=($Sum1/$nStud).':'.($Sum2/$nStud);
 #        $r->print("$nIdx) $Temp --> ($nStud) $Proc{$Temp} <br>");  #        $r->print("$nIdx) $Temp --> ($nStud) $Proc{$Temp} <br>");
  $Sum=0;   $Sum1=0;
    $Sum2=0;
  $nStud=0;   $nStud=0;
     }      }
     return %Proc;      return %Proc;
Line 348  sub PreStatTable { Line 349  sub PreStatTable {
     '<b>  #yes   </b>: Number of students solved the problem by override.<br>'.      '<b>  #yes   </b>: Number of students solved the problem by override.<br>'.
     '<b>  %Wrng  </b>: Percentage of students tried to solve the problem but'.      '<b>  %Wrng  </b>: Percentage of students tried to solve the problem but'.
     ' still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ]<br>'.      ' still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ]<br>'.
 #    '  DoDiff : Degree of Difficulty of the problem. [ Tries/(#YES+#yes+0.1) ]<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>'.      '<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.'.      '<b>  S.D.  </b> : Standard Deviation of the tries.'.
     '[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1)'.      '[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1)'.
     ' where Xi denotes every student\'s tries ]<br>'.      ' where Xi denotes every student\'s tries ]<br>'.
     '<b>  Skew.  </b>: Skewness of the students tries.'.      '<b>  Skew.  </b>: Skewness of the students tries.'.
     ' [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ]<br>'.   ' [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ]<br>'.
       '<b>  Dis.F. </b>: Discrimination Factor: A Standard for '.
     '<b>  Dis.F. </b>: Discrimination Factor. [ Sum of Partial Credits'.   'evaluating the problem according to a Criterion<br>'.
     ' Awarded / Total Number of Tries in %27 upper and lower students]<br>'.   '<b>           [Applied Criterion in %27 Upper Students - '.
     '<b>  U.A.   </b>: Upper %27 Award<br>'.   'Applied the same Criterion in %27 Lower Students]</b><br>'.
     '<b>  L.A.   </b>: Lower %27 Award<br>'.      '<b>           1st </b>Criterion for Sorting the Students: '.
     '<b>  U.R.   </b>: Upper %27 Records<br>'.   'Sum of Partial Credit Awarded / Total Number of Tries<br>'.
     '<b>  L.R.   </b>: Lower %27 Records'.      '<b>           2nd </b>Criterion for Sorting the Students: '.
    'Total number of Correct Answers / Total Number of Tries'.
 #    "<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>".  
   
             '</pre>';              '</pre>';
   
     $r->print($Ptr);      $r->print($Ptr);
Line 563  sub ExtractStudentData { Line 558  sub ExtractStudentData {
 #    $DisF .= '+'.$TempHash{"$part.Time"};  #    $DisF .= '+'.$TempHash{"$part.Time"};
     $TimeTot += $TempHash{"$part.Time"};      $TimeTot += $TempHash{"$part.Time"};
     $Dis .= $TempHash{$part.'.PrOrd'}.'='.$DisF.'+'.$Yes;      $Dis .= $TempHash{$part.'.PrOrd'}.'='.$DisF.'+'.$Yes;
   
             #$r->print('<br>'.$DisFactor,'###',$DiscFac{$DisFactor});  
     $ptr .= ":$TempHash{$part.'.Tries'}".      $ptr .= ":$TempHash{$part.'.Tries'}".
             ":$TempHash{$part.'.Wrongs'}".              ":$TempHash{$part.'.Wrongs'}".
                             ":$TempHash{$part.'.Code'}";                              ":$TempHash{$part.'.Code'}";
Line 584  sub ExtractStudentData { Line 577  sub ExtractStudentData {
     my $DisFac = ( $TotalTries ) ? ($TotParCr/$TotalTries) : 0;      my $DisFac = ( $TotalTries ) ? ($TotParCr/$TotalTries) : 0;
     my $DisFactor = sprintf( "%.4f", $DisFac );      my $DisFactor = sprintf( "%.4f", $DisFac );
     $DiscFac{$DisFactor}=$Dis;      $DiscFac{$DisFactor}=$Dis;
             #$r->print('<br>'.$DisFactor,'###',$DiscFac{$DisFactor});  
     #my $time;      #my $time;
     #if ($ProbSolved){      #if ($ProbSolved){
  #$time = int(($TimeTot/$ProbSolved)-10000000);   #$time = int(($TimeTot/$ProbSolved)-10000000);
Line 811  ENDPOP Line 803  ENDPOP
     }      }
   
 #--------------------- Compute the Discrimination Factors  #--------------------- Compute the Discrimination Factors
     my ($UpD,$UpNo)=split(/\:/,$DisUp{$lpr[$i]});      my ($Up1,$Up2)=split(/\:/,$DisUp{$lpr[$i]});
     my ($LwD,$LwNo)=split(/\:/,$DisLow{$lpr[$i]});      my ($Lw1,$Lw2)=split(/\:/,$DisLow{$lpr[$i]});
     $UpNo = ($UpNo) ? $UpNo : 0;      my $Dis1 = $Up1 - $Lw1;
     $LwNo = ($LwNo) ? $LwNo : 0;      my $Dis2 = $Up2 - $Lw2;
     my $U_D = sprintf("%.2f", $UpD);      my $_D1 = sprintf("%.2f", $Dis1);
     my $L_D = sprintf("%.2f", $LwD);      my $_D2 = sprintf("%.2f", $Dis2);
     my $DisFac = $UpD - $LwD;  
     my $_Dis = sprintf("%.2f", $DisFac);  
   
 #-----------------  Some restition in presenting the float numbers  #-----------------  Some restition in presenting the float numbers
     my $Avg = sprintf( "%.2f", $Average );      my $Avg = sprintf( "%.2f", $Average );
Line 829  ENDPOP Line 819  ENDPOP
     my $join = $PrOrd.':'.$Temp.':'.$StdNo.':'.      my $join = $PrOrd.':'.$Temp.':'.$StdNo.':'.
                        $TotalTries.':'.$MxTries.':'.$Avg.':'.                         $TotalTries.':'.$MxTries.':'.$Avg.':'.
                        $YES.':'.$Override.':'.$Wrng.':'.$DoD.':'.                         $YES.':'.$Override.':'.$Wrng.':'.$DoD.':'.
        $SD.':'.$Sk.':'.$_Dis.':'.$U_D.':'.         $SD.':'.$Sk.':'.$_D1.':'.$_D2.':'.$Prob;
                        $L_D.':'.$UpNo.':'.$LwNo.':'.$Prob;  
     $CachData{($p_count-1)}=$join;      $CachData{($p_count-1)}=$join;
   
     $urlres=~/^(\w+)\/(\w+)/;      $urlres=~/^(\w+)\/(\w+)/;
Line 899  sub Cache_Statistics { Line 888  sub Cache_Statistics {
 sub TableRow {  sub TableRow {
     my ($Str,$Idx,$RealIdx)=@_;      my ($Str,$Idx,$RealIdx)=@_;
     my($PrOrd,$Temp,$StdNo,$TotalTries,$MxTries,$Avg,$YES,      my($PrOrd,$Temp,$StdNo,$TotalTries,$MxTries,$Avg,$YES,
        $Override,$Wrng,$DoD,$SD,$Sk,$_Dis,$U_D,$L_D,$UpNo,$LwNo,         $Override,$Wrng,$DoD,$SD,$Sk,$_D1,$_D2,$Prob)=split(/\:/,$Str);
        $Prob)=split(/\:/,$Str);  
     $r->print( "\n".'<tr>'.      $r->print( "\n".'<tr>'.
                "\n".'<td>'.($RealIdx+1).'</td>'.                 "\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"> '.$StdNo.'</td>'.
                "\n".'<td bgcolor="#EEFFCC">'.$TotalTries.'</td>'.                 "\n".'<td bgcolor="#EEFFCC">'.$TotalTries.'</td>'.
                "\n".'<td bgcolor="#EEFFCC">'.$MxTries.'</td>'.                 "\n".'<td bgcolor="#EEFFCC">'.$MxTries.'</td>'.
Line 914  sub TableRow { Line 902  sub TableRow {
                "\n".'<td bgcolor="#FFDDDD">'.$DoD.'</td>'.                 "\n".'<td bgcolor="#FFDDDD">'.$DoD.'</td>'.
                "\n".'<td bgcolor="#DDFFDD"> '.$SD.'</td>'.                 "\n".'<td bgcolor="#DDFFDD"> '.$SD.'</td>'.
                "\n".'<td bgcolor="#DDFFDD"> '.$Sk.'</td>'.                 "\n".'<td bgcolor="#DDFFDD"> '.$Sk.'</td>'.
                "\n".'<td bgcolor="#FFDDCC"> '.$_Dis.'</td>'.                 "\n".'<td bgcolor="#FFDDFF"> '.$_D1.'</td>'.
                "\n".'<td bgcolor="#FFFFDD"> '.$U_D.'</td>'.                 "\n".'<td bgcolor="#FFDDFF"> '.$_D2.'</td>'.
                "\n".'<td bgcolor="#FFFFDD"> '.$L_D.'</td>'.  
                "\n".'<td bgcolor="#FFFFDD"> '.$UpNo.'</td>'.  
                "\n".'<td bgcolor="#FFFFDD"> '.$LwNo.'</td>'.  
                "\n".'</tr>' );                 "\n".'</tr>' );
     $GraphDat{$RealIdx}=$DoD.':'.$Wrng;      $GraphDat{$RealIdx}=$DoD.':'.$Wrng;
 }  }
Line 1022  sub ClassList { Line 1007  sub ClassList {
     $name=&Apache::lonnet::unescape($name);      $name=&Apache::lonnet::unescape($name);
     $students[$thisindex]=$name;      $students[$thisindex]=$name;
     my ($sname,$sdom)=split(/\:/,$name);      my ($sname,$sdom)=split(/\:/,$name);
   
     #my %reply=&Apache::lonnet::idrget($sdom,$sname);      #my %reply=&Apache::lonnet::idrget($sdom,$sname);
     #my $reply=&Apache::lonnet::reply('get:'.$sdom.':'.$sname.      #my $reply=&Apache::lonnet::reply('get:'.$sdom.':'.$sname.
     #         ':environment:lastname&generation&firstname&middlename',      #         ':environment:lastname&generation&firstname&middlename',
Line 1031  sub ClassList { Line 1015  sub ClassList {
     if ($ssec==-1) {next;}      if ($ssec==-1) {next;}
     $ssec=($ssec) ? $ssec : '(none)';      $ssec=($ssec) ? $ssec : '(none)';
     #$ssec=(int($ssec)) ? int($ssec) : $ssec;      #$ssec=(int($ssec)) ? int($ssec) : $ssec;
     #$r->print($sname.'...'.$ssec.'<br>');  
     $section{$ssec}=$ssec;      $section{$ssec}=$ssec;
     if ($CurSec eq 'All Sections' || $ssec eq $CurSec) {      if ($CurSec eq 'All Sections' || $ssec eq $CurSec) {
  $students[$StudNo]=$name;   $students[$StudNo]=$name;
Line 1048  sub ClassList { Line 1031  sub ClassList {
         $r->rflush();          $r->rflush();
 # --------------- Find all assessments and put them into some linear-like order  # --------------- Find all assessments and put them into some linear-like order
  &tracetable($firstres,'&'.$lastres.'&');   &tracetable($firstres,'&'.$lastres.'&');
   
 #    my $c=0;  #    my $c=0;
 #    foreach (sort keys %mapsort) {  #    foreach (sort keys %mapsort) {
 # $r->print('<br>'.$c.')'.$_.' ... '.$mapsort{$_});  # $r->print('<br>'.$c.')'.$_.' ... '.$mapsort{$_});
 # $c++;  # $c++;
 #    }  #    }
 #foreach(@cols) {  
 #    $c++;  
 #    $r->print('<br>'.$cols[$c]);  
 #}  
 #$r->print('<br> Count = '.$c);  
   
     }      }
   
 # ------------------------------------------------------------- End render page   # ------------------------------------------------------------- End render page 
Line 1148  sub StudentOptions { Line 1124  sub StudentOptions {
 }  }
   
 sub GetStatus {  sub GetStatus {
   
 #    $OpSelDis1='';  
 #    $OpSelDis2='';  
     $OpSel1='';      $OpSel1='';
     $OpSel2='';      $OpSel2='';
     $OpSel3='';      $OpSel3='';
     $OpSel4='';      $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'; }      if ( $ENV{'form.order'} eq 'Descending' ) { $OpSel2='selected'; }
     else { $OpSel1 = 'selected'; }      else { $OpSel1 = 'selected'; }
   

Removed from v.1.7  
changed lines
  Added in v.1.9


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>