Diff for /loncom/interface/loncoursedata.pm between versions 1.102 and 1.104

version 1.102, 2003/10/07 15:30:09 version 1.104, 2003/10/17 21:36:10
Line 1987  sub execute_SQL_request { Line 1987  sub execute_SQL_request {
     return ();      return ();
 }  }
   
   #sub get_timestamp_data {
   #    my ($students,$symb,
 sub get_optionresponse_data {  sub get_optionresponse_data {
     my ($students,$symb,$response,$courseid) = @_;      my ($students,$symb,$response,$courseid) = @_;
     return if (! defined($symb) ||       return undef if (! defined($symb) || 
                ! defined($response));                 ! defined($response));
     $courseid = $ENV{'request.course.id'} if (! defined($courseid));      $courseid = $ENV{'request.course.id'} if (! defined($courseid));
     #      #
Line 2000  sub get_optionresponse_data { Line 2002  sub get_optionresponse_data {
     my $dbh = &Apache::lonmysql::get_dbh();      my $dbh = &Apache::lonmysql::get_dbh();
     return undef if (! defined($dbh));      return undef if (! defined($dbh));
     my $request = 'SELECT '.      my $request = 'SELECT '.
         'a.response_specific_value, a.submission, b.timestamp, c.tries '.          'a.awarddetail, a.response_specific_value, a.submission, '.
           'b.timestamp, c.tries '.
         'FROM '.$fulldump_response_table.' AS a '.          'FROM '.$fulldump_response_table.' AS a '.
         'LEFT JOIN '.$fulldump_timestamp_table.' AS b '.          'LEFT JOIN '.$fulldump_timestamp_table.' AS b '.
         'ON a.symb_id=b.symb_id AND a.student_id=b.student_id AND '.          'ON a.symb_id=b.symb_id AND a.student_id=b.student_id AND '.
Line 2012  sub get_optionresponse_data { Line 2015  sub get_optionresponse_data {
         'a.symb_id='.$symb_id.' AND a.response_id='.$response_id;          'a.symb_id='.$symb_id.' AND a.response_id='.$response_id;
     if (defined($students)) {      if (defined($students)) {
         $request .= ' AND ('.          $request .= ' AND ('.
             join(' OR ', map {'student_id='.              join(' OR ', map {'a.student_id='.
                                   &get_student_id($_->{'username'},                                    &get_student_id($_->{'username'},
                                                   $_->{'domain'})                                                    $_->{'domain'})
                               } @$students                                } @$students
                  ).')';                   ).')';
     }      }
     $request .= ' ORDER BY b.timestamp';      $request .= ' ORDER BY b.timestamp';
     &Apache::lonnet::logthis("request =\n".$request);  #    &Apache::lonnet::logthis("request =\n".$request);
     my $sth = $dbh->prepare($request);      my $sth = $dbh->prepare($request);
     $sth->execute();      $sth->execute();
     my $dataset = $sth->fetchall_arrayref();      my $dataset = $sth->fetchall_arrayref();
     if (ref($dataset) eq 'ARRAY' && scalar(@$dataset)>0) {      if (ref($dataset) eq 'ARRAY' && scalar(@$dataset)>0) {
         return @$dataset;          return $dataset;
     }      }
 }  }
   

Removed from v.1.102  
changed lines
  Added in v.1.104


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