--- loncom/interface/loncoursedata.pm 2004/01/19 16:31:25 1.112 +++ loncom/interface/loncoursedata.pm 2004/03/09 21:42:01 1.112.2.1 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.112 2004/01/19 16:31:25 matthew Exp $ +# $Id: loncoursedata.pm,v 1.112.2.1 2004/03/09 21:42:01 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1225,11 +1225,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/\\$/\\\\/; - } + $value = $dbh->quote($value); } if ($field eq 'submissiongrading' || $field eq 'molecule') { @@ -2075,6 +2071,10 @@ sub get_response_data { } my $dataset = $sth->fetchall_arrayref(); if (ref($dataset) eq 'ARRAY' && scalar(@$dataset)>0) { + # Clear the \'s from around the submission + for (my $i =0;$i[$i]->[3] =~ s/(\'$|^\')//g; + } return $dataset; } }