--- loncom/lonmap.pm 2011/10/06 10:56:49 1.3 +++ loncom/lonmap.pm 2011/10/07 12:01:51 1.4 @@ -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 @@ my %cenv; # Course environment. 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 @@ sub simplify { # ((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 @@ sub loadmap { %encurl = (); %hiddenurl = (); %parmhash = (); - @cond = (); + @cond = ('true:normal'); # Initial value for cond 0. $retfrid = ''; $username = ''; $userdomain = ''; @@ -1417,7 +1415,6 @@ sub loadmap { &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.