Diff for /loncom/interface/loncoursedata.pm between versions 1.101 and 1.103

version 1.101, 2003/10/03 16:39:17 version 1.103, 2003/10/09 14:50:01
Line 1222  sub update_full_student_data { Line 1222  sub update_full_student_data {
                     # However, there is one wrinkle: submissions which end in                      # However, there is one wrinkle: submissions which end in
                     # and odd number of '\' cause insert errors to occur.                        # and odd number of '\' cause insert errors to occur.  
                     # Best trap this somehow...                      # Best trap this somehow...
                       $value =~ s/\'/\\\'/g;
                     my ($offensive_string) = ($value =~ /(\\+)$/);                      my ($offensive_string) = ($value =~ /(\\+)$/);
                     if (length($offensive_string) % 2) {                      if (length($offensive_string) % 2) {
                         $value =~ s/\\$/\\\\/;                          $value =~ s/\\$/\\\\/;
Line 1986  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 2011  sub get_optionresponse_data { Line 2014  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.101  
changed lines
  Added in v.1.103


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