[LON-CAPA-cvs] cvs: loncom /homework/caparesponse caparesponse.pm

raeburn raeburn@source.lon-capa.org
Wed, 02 Feb 2011 18:48:06 -0000


raeburn		Wed Feb  2 18:48:06 2011 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - Consolidate two if blocks into single block.
  - Log reported removal of control characters from stringresponse submission correctly.
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.244 loncom/homework/caparesponse/caparesponse.pm:1.245
--- loncom/homework/caparesponse/caparesponse.pm:1.244	Tue Jan 25 04:30:13 2011
+++ loncom/homework/caparesponse/caparesponse.pm	Wed Feb  2 18:48:06 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.244 2011/01/25 04:30:13 raeburn Exp $
+# $Id: caparesponse.pm,v 1.245 2011/02/02 18:48:06 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1231,15 +1231,13 @@
 			my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list()",$safeeval);
                         if ($$args_ref{'type'} =~ /^c[si]$/) {
                             $ansstring{$name} = pop(@msgs);
-                        }
-                        if ($$args_ref{'type'} =~ /^c[si]$/) {
                             my $control_chars_removed = pop(@msgs);
                             my $error = pop(@msgs);
                             if (($error ne '') || 
-                                ($control_chars_removed ne '')) {
+                                ($control_chars_removed)) {
                                 my ($symb,$courseid,$sdomain,$sname) =
                                     &Apache::lonnet::whichuser();
-                                if ($control_chars_removed ne '') {
+                                if ($control_chars_removed) {
                                     my $showresponse = $response;
                                     if ($response =~ /[\000-\037]/) {
                                         $response =~ s/[\000-\037]//g;