--- loncom/interface/loncoursedata.pm 2003/10/02 20:48:57 1.100 +++ loncom/interface/loncoursedata.pm 2003/10/09 14:50:01 1.103 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.100 2003/10/02 20:48:57 matthew Exp $ +# $Id: loncoursedata.pm,v 1.103 2003/10/09 14:50:01 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1222,6 +1222,7 @@ sub update_full_student_data { # However, there is one wrinkle: submissions which end in # and odd number of '\' cause insert errors to occur. # Best trap this somehow... + $value =~ s/\'/\\\'/g; my ($offensive_string) = ($value =~ /(\\+)$/); if (length($offensive_string) % 2) { $value =~ s/\\$/\\\\/; @@ -1248,6 +1249,7 @@ sub update_full_student_data { $store_command .= "('".join("','",$symb_id,$part_id, $student_id, $transaction, + $data->{'tries'}, $data->{'award'}, $data->{'awarded'}, $data->{'previous'})."'),"; @@ -1276,7 +1278,6 @@ sub update_full_student_data { $store_command .= "('".join("','",$symb_id,$part_id, $resp_id,$student_id, $transaction, - $data->{'tries'}, $data->{'awarddetail'}, $data->{'response_specific'}, $data->{'response_specific_value'}, @@ -1986,9 +1987,11 @@ sub execute_SQL_request { return (); } +#sub get_timestamp_data { +# my ($students,$symb, sub get_optionresponse_data { my ($students,$symb,$response,$courseid) = @_; - return if (! defined($symb) || + return undef if (! defined($symb) || ! defined($response)); $courseid = $ENV{'request.course.id'} if (! defined($courseid)); # @@ -2011,19 +2014,19 @@ sub get_optionresponse_data { 'a.symb_id='.$symb_id.' AND a.response_id='.$response_id; if (defined($students)) { $request .= ' AND ('. - join(' OR ', map {'student_id='. + join(' OR ', map {'a.student_id='. &get_student_id($_->{'username'}, $_->{'domain'}) } @$students ).')'; } $request .= ' ORDER BY b.timestamp'; - &Apache::lonnet::logthis("request =\n".$request); +# &Apache::lonnet::logthis("request =\n".$request); my $sth = $dbh->prepare($request); $sth->execute(); my $dataset = $sth->fetchall_arrayref(); if (ref($dataset) eq 'ARRAY' && scalar(@$dataset)>0) { - return @$dataset; + return $dataset; } }