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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 18 Apr 2003 07:53:15 -0000


albertel		Fri Apr 18 03:53:15 2003 EDT

  Modified files:              
    /loncom/homework	hint.pm 
  Log:
  - better regexp (faster) for detecting non space
  
  
Index: loncom/homework/hint.pm
diff -u loncom/homework/hint.pm:1.40 loncom/homework/hint.pm:1.41
--- loncom/homework/hint.pm:1.40	Mon Apr  7 22:47:42 2003
+++ loncom/homework/hint.pm	Fri Apr 18 03:53:15 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # implements the tags that control the hints
 #
-# $Id: hint.pm,v 1.40 2003/04/08 02:47:42 albertel Exp $
+# $Id: hint.pm,v 1.41 2003/04/18 07:53:15 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -74,7 +74,7 @@
 	&Apache::lonxml::debug("found :$id:$numtries:$hinttries:");
 	my $hinttext=&Apache::lonxml::endredirection;
 	if ($Apache::lonhomework::type ne 'exam' &&
-	    $numtries >= $hinttries && $hinttext !~/^\s*$/) {
+	    $numtries >= $hinttries && $hinttext =~/\S/) {
 	    $result='<table bgcolor="#dddddd"><tr><td>'.
 		$hinttext.'</td></tr></table>';
 	}