Diff for /loncom/interface/loncoursedata.pm between versions 1.137 and 1.138

version 1.137, 2004/07/06 15:50:03 version 1.138, 2004/07/22 15:55:57
Line 2303  sub get_sum_of_scores { Line 2303  sub get_sum_of_scores {
     if (! defined($courseid)) {      if (! defined($courseid)) {
         $courseid = $ENV{'request.course.id'};          $courseid = $ENV{'request.course.id'};
     }      }
       if (defined($students) && 
           ((@$students == 0) ||
            (@$students == 1 && (! defined($students->[0]) || 
                                 $students->[0] eq ''))
            )
           ){
           undef($students);
       }
     #      #
     &setup_table_names($courseid);      &setup_table_names($courseid);
     my $dbh = &Apache::lonmysql::get_dbh();      my $dbh = &Apache::lonmysql::get_dbh();
Line 2325  sub get_sum_of_scores { Line 2333  sub get_sum_of_scores {
     $sth->execute();      $sth->execute();
     my $rows = $sth->fetchrow_arrayref();      my $rows = $sth->fetchrow_arrayref();
     if ($dbh->err) {      if ($dbh->err) {
         &Apache::lonnet::logthis('error = '.$dbh->errstr());          &Apache::lonnet::logthis('error 1 = '.$dbh->errstr());
           &Apache::lonnet::logthis('prepared then executed, fetchrow_arrayrefed'.
                                    $/.$request);
         return (undef,undef);          return (undef,undef);
     }      }
     return ($rows->[0],$rows->[1]);      return ($rows->[0],$rows->[1]);
Line 2505  sub get_student_data { Line 2515  sub get_student_data {
     my $sth = $dbh->prepare($request);      my $sth = $dbh->prepare($request);
     $sth->execute();      $sth->execute();
     if ($dbh->err) {      if ($dbh->err) {
         &Apache::lonnet::logthis('error = '.$dbh->errstr());          &Apache::lonnet::logthis('error 2 = '.$dbh->errstr());
           &Apache::lonnet::logthis('prepared then executed '.$/.$request);
         return undef;          return undef;
     }      }
     my $dataset = $sth->fetchall_arrayref();      my $dataset = $sth->fetchall_arrayref();
Line 2574  sub get_response_data { Line 2585  sub get_response_data {
     my $sth = $dbh->prepare($request);      my $sth = $dbh->prepare($request);
     $sth->execute();      $sth->execute();
     if ($dbh->err) {      if ($dbh->err) {
         &Apache::lonnet::logthis('error = '.$dbh->errstr());          &Apache::lonnet::logthis('error 3 = '.$dbh->errstr());
           &Apache::lonnet::logthis('prepared then executed '.$/.$request);
         return undef;          return undef;
     }      }
     my $dataset = $sth->fetchall_arrayref();      my $dataset = $sth->fetchall_arrayref();
Line 2630  sub get_response_data_by_student { Line 2642  sub get_response_data_by_student {
     my $sth = $dbh->prepare($request);      my $sth = $dbh->prepare($request);
     $sth->execute();      $sth->execute();
     if ($dbh->err) {      if ($dbh->err) {
         &Apache::lonnet::logthis('error = '.$dbh->errstr());          &Apache::lonnet::logthis('error 4 = '.$dbh->errstr());
           &Apache::lonnet::logthis('prepared then executed '.$/.$request);
         return undef;          return undef;
     }      }
     my $dataset = $sth->fetchall_arrayref();      my $dataset = $sth->fetchall_arrayref();
Line 2682  sub get_response_time_data { Line 2695  sub get_response_time_data {
     my $sth = $dbh->prepare($request);      my $sth = $dbh->prepare($request);
     $sth->execute();      $sth->execute();
     if ($dbh->err) {      if ($dbh->err) {
         &Apache::lonnet::logthis('error = '.$dbh->errstr());          &Apache::lonnet::logthis('error 5 = '.$dbh->errstr());
           &Apache::lonnet::logthis('prepared then executed '.$/.$request);
         return undef;          return undef;
     }      }
     my $dataset = $sth->fetchall_arrayref();      my $dataset = $sth->fetchall_arrayref();
Line 2772  sub get_student_scores { Line 2786  sub get_student_scores {
     my $sth = $dbh->prepare($request);      my $sth = $dbh->prepare($request);
     $sth->execute();      $sth->execute();
     if ($dbh->err) {      if ($dbh->err) {
         &Apache::lonnet::logthis('error = '.$dbh->errstr());          &Apache::lonnet::logthis('error 6 = '.$dbh->errstr());
           &Apache::lonnet::logthis('prepared then executed '.$/.$request);
         return undef;          return undef;
     }      }
     $request = 'SELECT score,COUNT(*) FROM '.$tmptable.' GROUP BY score';      $request = 'SELECT score,COUNT(*) FROM '.$tmptable.' GROUP BY score';
Line 2780  sub get_student_scores { Line 2795  sub get_student_scores {
     $sth = $dbh->prepare($request);      $sth = $dbh->prepare($request);
     $sth->execute();      $sth->execute();
     if ($dbh->err) {      if ($dbh->err) {
         &Apache::lonnet::logthis('error = '.$dbh->errstr());          &Apache::lonnet::logthis('error 7 = '.$dbh->errstr());
           &Apache::lonnet::logthis('prepared then executed '.$/.$request);
         return undef;          return undef;
     }      }
     my $dataset = $sth->fetchall_arrayref();      my $dataset = $sth->fetchall_arrayref();

Removed from v.1.137  
changed lines
  Added in v.1.138


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