[LON-CAPA-cvs] cvs: loncom / lonmap.pm

foxr foxr at source.lon-capa.org
Fri Oct 7 08:01:51 EDT 2011


foxr		Fri Oct  7 12:01:51 2011 EDT

  Modified files:              
    /loncom	lonmap.pm 
  Log:
  Tried and seems to work with sequences that have conditions.
  
  
Index: loncom/lonmap.pm
diff -u loncom/lonmap.pm:1.3 loncom/lonmap.pm:1.4
--- loncom/lonmap.pm:1.3	Thu Oct  6 10:56:49 2011
+++ loncom/lonmap.pm	Fri Oct  7 12:01:51 2011
@@ -2,7 +2,7 @@
 #
 #  Read maps into a 'big hash'.
 #
-# $Id: lonmap.pm,v 1.3 2011/10/06 10:56:49 foxr Exp $
+# $Id: lonmap.pm,v 1.4 2011/10/07 12:01:51 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -95,10 +95,7 @@
 
 sub simplify {
     my $expression=shift;
-    my $prior = '';		# This is safe as a null expression is pretty optimal.
-    
-    while ($prior ne $expression) {
-	$prior = $expression;	# Stop when the substitutions below do nothing.
+
 # (0&1) = 1
 	$expression=~s/\(0\&([_\.\d]+)\)/$1/g;
 # (8)=8
@@ -115,7 +112,8 @@
 # ((5&3)|(4&6))|(1&2)=(5&3)|(4&6)|(1&2)
 	$expression=~
 	    s/\((\([_\.\d]+(?:\&[_\.\d]+)*\))((?:\|\([_\.\d]+(?:\&[_\.\d]+)*\))+)\)\|(\([_\.\d]+(?:\&[_\.\d]+)*\))/\($1$2\|$3\)/g;
-    }
+
+
     return $expression;
 }
     
@@ -1387,7 +1385,7 @@
     %encurl         = ();
     %hiddenurl      = ();
     %parmhash       = ();
-    @cond           = ();
+    @cond           = ('true:normal'); # Initial value for cond 0.
     $retfrid        = '';
     $username       = '';
     $userdomain     = '';
@@ -1417,7 +1415,6 @@
 	    &Apache::lonnet::logthis("lonmap::loadmap failed: $cnum/$cdom - did not get url");
 	    return; 
 	}
-	&Apache::lonnet::logthis("Course environment: \n" . Dumper(\%cenv));
 
 	$course_id = $cdom . '_' . $cnum; # Long course id.
 




More information about the LON-CAPA-cvs mailing list