Diff for /loncom/interface/lonstatistics.pm between versions 1.1 and 1.2

version 1.1, 2002/02/04 16:08:26 version 1.2, 2002/02/05 12:24:45
Line 41  use strict; Line 41  use strict;
 use Apache::Constants qw(:common :http);  use Apache::Constants qw(:common :http);
 use Apache::lonnet();  use Apache::lonnet();
 use Apache::lonhomework;  use Apache::lonhomework;
 use Apache::loncommon();  
 use HTML::TokeParser;  use HTML::TokeParser;
 use GDBM_File;  use GDBM_File;
 use Benchmark;  use Benchmark;
Line 51  my %hash; Line 50  my %hash;
 my %CachData;  my %CachData;
 my %GraphDat;  my %GraphDat;
 my %maps;  my %maps;
   my @mapsort;
 my %section;  my %section;
 my %StuBox;  my %StuBox;
 my %DiscFac;  my %DiscFac;
Line 75  my $cid; Line 75  my $cid;
 my $firstres;  my $firstres;
 my $lastres;  my $lastres;
 my $DiscFlag=0;  my $DiscFlag=0;
   my $HWN=0;
   
 my %Header = (0,"Problem Title",1,"#Stdnts",2,"Tries",3,"Mod",  my %Header = (0,"Problem Title",1,"#Stdnts",2,"Tries",3,"Mod",
               4,"Mean",5,"#YES",6,"#yes",7,"%Wrng",8,"S.D.",                4,"Mean",5,"#YES",6,"#yes",7,"%Wrng",8,"S.D.",
               9,"Skew.",10,"DoDiff",11,"Map");                9,"Skew.",10,"DoDiff",11,"Map");
 #             9,"Skew.",10,"DoDiff",11,"Dis.F.",12,"Resourse URL");  #             9,"Skew.",10,"DoDiff",11,"Dis.F.",12,"Resourse URL");
   
 my %class = ();  my %class = qw(
   );
   
 my @LS;  my @LS;
 my @LF;  my @LF;
Line 214  sub Classify { Line 216  sub Classify {
 #    my %Slvd = &GetUniq(5,"Problems Solved");  #    my %Slvd = &GetUniq(5,"Problems Solved");
   
    # my (@L, $Index,$String)=@_;     # my (@L, $Index,$String)=@_;
   
     my %Time = &GetUniqe(1,"Time",'S');      my %Time = &GetUniqe(1,"Time",'S');
     &GetUniqe(1,"Time",'F');      &GetUniqe(1,"Time",'F');
     &GetUniqe(2,"Discrimination Factor",'S');          &GetUniqe(2,"Discrimination Factor",'S');    
Line 371  sub DiscriminationTable { Line 374  sub DiscriminationTable {
                    "\n".'<td>'.$L_Dis.'</td>'.                     "\n".'<td>'.$L_Dis.'</td>'.
                    "\n".'<td>'.$UpNo.'</td>'.                     "\n".'<td>'.$UpNo.'</td>'.
                    "\n".'<td>'.$LwNo.'</td>'.                     "\n".'<td>'.$LwNo.'</td>'.
                    "\n".'<td>'.($DoD).'</td>'.                     "\n".'<td>'.$DoD.'</td>'.
                    "\n".'</tr>' );                     "\n".'</tr>' );
     }       } 
     $r->print("\n".'</table>');      $r->print("\n".'</table>');
Line 573  sub PreStatTable { Line 576  sub PreStatTable {
     '  Mean   : Average Number of the tries. [ Tries / #Stdns ]<br>'.      '  Mean   : Average Number of the tries. [ Tries / #Stdns ]<br>'.
     '  #YES   : Number of students solved the problem correctly.<br>'.       '  #YES   : Number of students solved the problem correctly.<br>'. 
     '  #yes   : Number of students solved the problem by override.<br>'.      '  #yes   : Number of students solved the problem by override.<br>'.
     '  %Wrng  : Percentage of students tried to solve the problem but still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ]<br>'.      '  %Wrng  : Percentage of students tried to solve the problem but'.
     '  S.D.   : Standard Deviation of the tries.[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1) where Xi is every student\'s tries ]<br>'.      ' still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ]<br>'.
     '  Skew.  : Skewness of the students tries. [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ]<br>'.      '  S.D.   : Standard Deviation of the tries.'.
       '[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1)'.
       ' where Xi is every student\'s tries ]<br>'.
       '  Skew.  : Skewness of the students tries.'.
       ' [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ]<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>'.
     '  DoDiff : Degree of Difficulty of the problem. [ 1 - ((#YES+#yes) / Tries) ]<br>'.      '  DoDiff : Degree of Difficulty of the problem. [ 1 - ((#YES+#yes) / Tries) ]<br>'.
 #    '  Dis.F. : Discrimination Factor. [ Sum of Partial Credits Awarded / Total Number of Tries in %27 upper and lower students]</b>'.  #    '  Dis.F. : Discrimination Factor. [ Sum of Partial Credits Awarded / Total Number of Tries in %27 upper and lower students]</b>'.
Line 809  sub tracetable { Line 816  sub tracetable {
    my $cmap=$hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$rid}}};     my $cmap=$hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$rid}}};
            if ( $cmap eq 'sequence' || $cmap eq 'page' ) {              if ( $cmap eq 'sequence' || $cmap eq 'page' ) { 
                $cols[$#cols+1]=0;                 $cols[$#cols+1]=0;
          $HWN++;
                  $mapsort[$HWN]=$rid.$hash{'title_'.$rid}; 
                #$maps{&Apache::lonnet::declutter($hash{'src_'.$rid})}=                  #$maps{&Apache::lonnet::declutter($hash{'src_'.$rid})}= 
                #      $hash{'title_'.$rid};                  #      $hash{'title_'.$rid}; 
            }             }
Line 823  sub tracetable { Line 832  sub tracetable {
                  if ($hash{'src_'.$frid}=~                   if ($hash{'src_'.$frid}=~
                                  /\.(problem|exam|quiz|assess|survey|form)$/) {                                   /\.(problem|exam|quiz|assess|survey|form)$/) {
      $cols[$#cols+1]=$frid;       $cols[$#cols+1]=$frid;
        $mapsort[$HWN] .= '&'.$frid;
                  }                   }
       }        }
    }     }
Line 831  sub tracetable { Line 841  sub tracetable {
              if ($hash{'src_'.$rid}=~               if ($hash{'src_'.$rid}=~
                                  /\.(problem|exam|quiz|assess|survey|form)$/) {                                   /\.(problem|exam|quiz|assess|survey|form)$/) {
          $cols[$#cols+1]=$rid;           $cols[$#cols+1]=$rid;
    $mapsort[$HWN] .= '&'.$rid;
              }               }
           }            }
        }         }
Line 1045  sub Cache_Statistics { Line 1056  sub Cache_Statistics {
             $Override,$Wrng,$SD,$Sk,$DoD,$res,$Prob)=split(/\:/,$Post);              $Override,$Wrng,$SD,$Sk,$DoD,$res,$Prob)=split(/\:/,$Post);
  $r->print( "\n".'<tr>'.   $r->print( "\n".'<tr>'.
                "\n".'<td>'.($nIdx+1).'</td>'.                 "\n".'<td>'.($nIdx+1).'</td>'.
                "\n".'<td>'.$Temp.'</td>'.                 "\n".'<td  bgcolor="#FFFFFF">'.$Temp.'</td>'.
                "\n".'<td>'.$StdNo.'</td>'.                 "\n".'<td>'.$StdNo.'</td>'.
                "\n".'<td>'.$TotalTries.'</td>'.                 "\n".'<td>'.$TotalTries.'</td>'.
                "\n".'<td>'.$MxTries.'</td>'.                 "\n".'<td>'.$MxTries.'</td>'.
Line 1160  sub ClassList { Line 1171  sub ClassList {
  }   }
  else {   else {
     $r->print('<h1>Could not access course data</h1>');      $r->print('<h1>Could not access course data</h1>');
  }   } 
         $r->print("Total number of students : ".($#students+1));          $r->print("Total number of students : ".($#students+1));
         $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;
   #foreach(@mapsort) {
   #    $c++;
   #    $r->print('<br>'.$mapsort[$c]);
   #}
   #$r->print('<br> Count = '.$c);
   
     }      }
   
 # ------------------------------------------------------------- End render page   # ------------------------------------------------------------- End render page 
Line 1329  sub handler { Line 1348  sub handler {
     else {      else {
  $r->content_type('text/html');   $r->content_type('text/html');
     }      }
     &Apache::loncommon::no_cache($r);  
     $r->send_http_header;      $r->send_http_header;
     return OK;      return OK;
  }       }    

Removed from v.1.1  
changed lines
  Added in v.1.2


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