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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Thu, 19 Apr 2007 17:40:43 -0000


raeburn		Thu Apr 19 13:40:43 2007 EDT

  Modified files:              
    /loncom/homework	lonmaxima.pm 
  Log:
  - Make check for true or false case insensitive (maxima/clisp on SuSE returns upper case; maxima/gcl on Fedora returns lower case).
  - regexp for false now /^\s*false\s*$/ (i.e., $ termination added - assuming there's no \n here). Should there be a chomp($reply)?     
  
  
Index: loncom/homework/lonmaxima.pm
diff -u loncom/homework/lonmaxima.pm:1.12 loncom/homework/lonmaxima.pm:1.13
--- loncom/homework/lonmaxima.pm:1.12	Tue Dec 19 12:44:16 2006
+++ loncom/homework/lonmaxima.pm	Thu Apr 19 13:40:43 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Interface routines to MAXIMA CAS
 #
-# $Id: lonmaxima.pm,v 1.12 2006/12/19 17:44:16 www Exp $
+# $Id: lonmaxima.pm,v 1.13 2007/04/19 17:40:43 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -101,8 +101,8 @@
     }
     my $reply=&runscript($socket,$script);
     &disconnect($socket);
-    if ($reply=~/^\s*true\s*$/) { return 'EXACT_ANS'; }
-    if ($reply=~/^\s*false\s*/) { return 'INCORRECT'; } 
+    if ($reply=~/^\s*true\s*$/i) { return 'EXACT_ANS'; }
+    if ($reply=~/^\s*false\s*$/i) { return 'INCORRECT'; } 
     return 'BAD_FORMULA';
 }