Diff for /loncom/interface/loncoursedata.pm between versions 1.63 and 1.66

version 1.63, 2003/03/27 19:29:36 version 1.66, 2003/04/01 16:53:50
Line 104  sub get_sequence_assessment_data { Line 104  sub get_sequence_assessment_data {
     my $fn=$ENV{'request.course.fn'};      my $fn=$ENV{'request.course.fn'};
     ##      ##
     ## use navmaps      ## use navmaps
     my $navmap = Apache::lonnavmaps::navmap->new(Apache->request,$fn.".db",      my $navmap = Apache::lonnavmaps::navmap->new($fn.".db",
                                                  $fn."_parms.db",1,0);                                                   $fn."_parms.db",1,0);
     if (!defined($navmap)) {      if (!defined($navmap)) {
         return 'Can not open Coursemap';          return 'Can not open Coursemap';
Line 1150  the students you are concerned with prio Line 1150  the students you are concerned with prio
   
 Inputs: $students, $symb, $part, $courseid  Inputs: $students, $symb, $part, $courseid
   
   =over 4
   
   =item $students is an array of hash references.  
   Each hash must contain at least the 'username' and 'domain' of a student.
   
   =item $symb is the symb for the problem.
   
   =item $part is the part id you need statistics for
   
   =item $courseid is the course id, of course!
   
   =back
   
   Outputs: See the code for up to date information.  A hash reference is
   returned.  The hash has the following keys defined:
   
   =over 4
   
   =item num_students The number of students attempting the problem
         
   =item tries The total number of tries for the students
         
   =item max_tries The maximum number of tries taken
         
   =item mean_tries The average number of tries
         
   =item num_solved The number of students able to solve the problem
         
   =item num_override The number of students whose answer is 'correct_by_override'
         
   =item deg_of_diff The degree of difficulty of the problem
         
   =item std_tries The standard deviation of the number of tries
         
   =item skew_tries The skew of the number of tries
   
   =item per_wrong The number of students attempting the problem who were not
   able to answer it correctly.
   
   =back
   
 =cut  =cut
   
 ################################################  ################################################
Line 1182  sub get_problem_statistics { Line 1223  sub get_problem_statistics {
         'CREATE TEMPORARY TABLE '.$stats_table.          'CREATE TEMPORARY TABLE '.$stats_table.
             ' SELECT student_id,solved,award,tries FROM '.$performance_table.              ' SELECT student_id,solved,award,tries FROM '.$performance_table.
                 ' WHERE symb_id='.$symb_id.' AND part_id='.$part_id;                  ' WHERE symb_id='.$symb_id.' AND part_id='.$part_id;
       if (defined($students)) {
           $request .= ' AND ('.
               join(' OR ', map {'student_id='.
                                     &get_student_id($_->{'username'},
                                                     $_->{'domain'})
                                     } @$students
                    ).')';
       }
 #    &Apache::lonnet::logthis($request);  #    &Apache::lonnet::logthis($request);
     $dbh->do($request);      $dbh->do($request);
     my ($num,$tries,$mod,$mean,$STD) = &execute_SQL_request      my ($num,$tries,$mod,$mean,$STD) = &execute_SQL_request
Line 1202  sub get_problem_statistics { Line 1251  sub get_problem_statistics {
     $solved = 0 if (! defined($solved));      $solved = 0 if (! defined($solved));
     #      #
     my $DegOfDiff = 'nan';      my $DegOfDiff = 'nan';
     $DegOfDiff = 1-($Solved + $solved)/$tries if ($tries>0);      $DegOfDiff = 1-($Solved)/$tries if ($tries>0);
   
     my $SKEW = 'nan';      my $SKEW = 'nan';
       my $wrongpercent = 0;
     if ($num > 0) {      if ($num > 0) {
         ($SKEW) = &execute_SQL_request($dbh,'SELECT SQRT(SUM('.          ($SKEW) = &execute_SQL_request($dbh,'SELECT SQRT(SUM('.
                                      'POWER(tries - '.$STD.',3)'.                                       'POWER(tries - '.$STD.',3)'.
                                      '))/'.$num.' FROM '.$stats_table);                                       '))/'.$num.' FROM '.$stats_table);
           $wrongpercent=int(10*100*($num-$Solved+$solved)/$num)/10;
     }      }
     #      #
     $dbh->do('DROP TABLE '.$stats_table);  # May return an error      $dbh->do('DROP TABLE '.$stats_table);  # May return an error
     return ($num,$tries,$mod,$mean,$Solved,$solved,$DegOfDiff,$STD,$SKEW);      return { num_students => $num,
                tries        => $tries,
                max_tries    => $mod,
                mean_tries   => $mean,
                std_tries    => $STD,
                skew_tries   => $SKEW,
                num_solved   => $Solved,
                num_override => $solved,
                per_wrong    => $wrongpercent,
                deg_of_diff  => $DegOfDiff }
 }  }
   
 sub execute_SQL_request {  sub execute_SQL_request {

Removed from v.1.63  
changed lines
  Added in v.1.66


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