[LON-CAPA-cvs] cvs: rat(version_2_1_2_s10) / lonuserstate.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 23 Feb 2006 08:38:54 -0000

```albertel		Thu Feb 23 03:38:54 2006 EDT

Modified files:              (Branch: version_2_1_2_s10)
/rat	lonuserstate.pm
Log:
- backport 1.101 to 1.99

Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.99 rat/lonuserstate.pm:1.99.2.1
--- rat/lonuserstate.pm:1.99	Tue Jan 10 16:41:29 2006
+++ rat/lonuserstate.pm	Thu Feb 23 03:38:54 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Construct and maintain state and binary representation of course for user
#
-# \$Id: lonuserstate.pm,v 1.99 2006/01/10 21:41:29 albertel Exp \$
+# \$Id: lonuserstate.pm,v 1.99.2.1 2006/02/23 08:38:54 albertel Exp \$
#
# Copyright Michigan State University Board of Trustees
#
@@ -318,6 +318,8 @@

sub simplify {
my \$expression=shift;
+# (0&1) = 1
+    \$expression=~s/\(0\&(\d+)\)/\$1/g;
# (8)=8
\$expression=~s/\((\d+)\)/\$1/g;
# 8&8=8
@@ -327,8 +329,8 @@
# (5&3)&4=5&3&4
\$expression=~s/\((\d+)((?:\&\d+)+)\)\&(\d+\D)/\$1\$2\&\$3/g;
# (((5&3)|(4&6)))=((5&3)|(4&6))
-    \$expression=~
-	s/\((\(\(\d+(?:\&\d+)*\)(?:\|\(\d+(?:\&\d+)*\))+\))\)/\$1/g;
+#    \$expression=~
+#	s/\((\(\(\d+(?:\&\d+)*\)(?:\|\(\d+(?:\&\d+)*\))+\))\)/\$1/g;
# ((5&3)|(4&6))|(1&2)=(5&3)|(4&6)|(1&2)
\$expression=~
s/\((\(\d+(?:\&\d+)*\))((?:\|\(\d+(?:\&\d+)*\))+)\)\|(\(\d+(?:\&\d+)*\))/\(\$1\$2\|\$3\)/g;

```