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

version 1.100, 2003/10/02 20:48:57 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 1248  sub update_full_student_data { Line 1249  sub update_full_student_data {
                 $store_command .= "('".join("','",$symb_id,$part_id,                  $store_command .= "('".join("','",$symb_id,$part_id,
                                             $student_id,                                              $student_id,
                                             $transaction,                                              $transaction,
                                               $data->{'tries'},
                                             $data->{'award'},                                              $data->{'award'},
                                             $data->{'awarded'},                                              $data->{'awarded'},
                                             $data->{'previous'})."'),";                                              $data->{'previous'})."'),";
Line 1276  sub update_full_student_data { Line 1278  sub update_full_student_data {
                     $store_command .= "('".join("','",$symb_id,$part_id,                      $store_command .= "('".join("','",$symb_id,$part_id,
                                                 $resp_id,$student_id,                                                  $resp_id,$student_id,
                                                 $transaction,                                                  $transaction,
                                                 $data->{'tries'},  
                                                 $data->{'awarddetail'},                                                  $data->{'awarddetail'},
                                                 $data->{'response_specific'},                                                  $data->{'response_specific'},
                                                 $data->{'response_specific_value'},                                                  $data->{'response_specific_value'},
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.100  
changed lines
  Added in v.1.103


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