Diff for /loncom/interface/loncoursedata.pm between versions 1.121 and 1.122

version 1.121, 2004/03/07 20:53:40 version 1.122, 2004/03/07 21:42:19
Line 1867  populated and all local caching variable Line 1867  populated and all local caching variable
 properly.  This means you need to call &ensure_current_data for  properly.  This means you need to call &ensure_current_data for
 the students you are concerned with prior to calling this routine.  the students you are concerned with prior to calling this routine.
   
 Inputs: $students, $symb, $part, $courseid  Inputs: $students, $symb, $part, $courseid, $starttime, $endtime
   
 =over 4  =over 4
   
Line 1880  Each hash must contain at least the 'use Line 1880  Each hash must contain at least the 'use
   
 =item $courseid is the course id, of course!  =item $courseid is the course id, of course!
   
   =item $starttime and $endtime are unix times which to use to limit
   the statistical data.
   
 =back  =back
   
 Outputs: See the code for up to date information.  A hash reference is  Outputs: See the code for up to date information.  A hash reference is
Line 1915  able to answer it correctly. Line 1918  able to answer it correctly.
 ################################################  ################################################
 ################################################  ################################################
 sub get_problem_statistics {  sub get_problem_statistics {
     my ($Sections,$status,$symb,$part,$courseid) = @_;      my ($Sections,$status,$symb,$part,$courseid,$starttime,$endtime) = @_;
     return if (! defined($symb) || ! defined($part));      return if (! defined($symb) || ! defined($part));
     $courseid = $ENV{'request.course.id'} if (! defined($courseid));      $courseid = $ENV{'request.course.id'} if (! defined($courseid));
     #      #
Line 1945  sub get_problem_statistics { Line 1948  sub get_problem_statistics {
     if (defined($status) && lc($status) ne 'any') {      if (defined($status) && lc($status) ne 'any') {
         $request .= " AND b.status='".$status."'";          $request .= " AND b.status='".$status."'";
     }      }
       #
       &Apache::lonnet::logthis('starttime = '.$starttime);
       my $time_requirements = undef;
       if (defined($starttime)) {
           $time_requirements .= 'a.timestamp>='.$starttime;
           if (defined($endtime)) {
               $time_requirements .= ' AND a.timestamp<='.$endtime;
           }
       } elsif (defined($endtime)) {
           $time_requirements .= 'a.timestamp<='.$endtime;
       }
       if (defined($time_requirements)) {
           $request .= ' AND '.$time_requirements;
       }
     $dbh->do($request);      $dbh->do($request);
 #    &Apache::lonnet::logthis('request = '.$/.$request);  #    &Apache::lonnet::logthis('request = '.$/.$request);
     $request = 'SELECT COUNT(*),SUM(tries),MAX(tries),AVG(tries),STD(tries) '.      $request = 'SELECT COUNT(*),SUM(tries),MAX(tries),AVG(tries),STD(tries) '.

Removed from v.1.121  
changed lines
  Added in v.1.122


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