version 1.241, 2010/10/14 19:55:04
|
version 1.242, 2010/10/18 19:47:39
|
Line 1229 sub end_stringresponse {
|
Line 1229 sub end_stringresponse {
|
${$safeeval->varglob('LONCAPA::CAPAresponse_answer')}=dclone($answer{$name}); |
${$safeeval->varglob('LONCAPA::CAPAresponse_answer')}=dclone($answer{$name}); |
my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list()",$safeeval); |
my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list()",$safeeval); |
if ($$args_ref{'type'} =~ /^c[si]$/) { |
if ($$args_ref{'type'} =~ /^c[si]$/) { |
|
my $control_chars_removed = pop(@msgs); |
my $error = pop(@msgs); |
my $error = pop(@msgs); |
if ($error ne '') { |
if (($error ne '') || |
|
($control_chars_removed ne '')) { |
my ($symb,$courseid,$domain,$name) = |
my ($symb,$courseid,$domain,$name) = |
&Apache::lonnet::whichuser(); |
&Apache::lonnet::whichuser(); |
&Apache::lonnet::logthis("Stringresponse grading error: $error for $name:$domain in $courseid for part: $part response: $id and symb: $symb"); |
if ($control_chars_removed ne '') { |
|
my $showresponse = $response; |
|
if ($response =~ /[\000-\037]/) { |
|
$response =~ s/[\000-\037]//g; |
|
} |
|
if ($showresponse =~ /[\r\n\f]/) { |
|
my @lines = split(/[\r\n\f]+/,$showresponse); |
|
$showresponse = join('\\n',@lines); |
|
} |
|
&Apache::lonnet::logthis("Stringresponse grading: control characters stripped from submission ".$showresponse." for $name:$domain in $courseid for part: $part response: $id and symb: $symb"); |
|
$Apache::lonhomework::results{"resource.$part.$id.submission"} = $response; |
|
} |
|
if ($error ne '') { |
|
&Apache::lonnet::logthis("Stringresponse grading error: $error for $name:$domain in $courseid for part: $part response: $id and symb: $symb"); |
|
} |
} |
} |
} |
} |
&Apache::lonxml::debug('msgs are'.join(':',@msgs)); |
&Apache::lonxml::debug('msgs are'.join(':',@msgs)); |