Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWWDillingham WesleyDillingham <wwdillingham@sugarlabs.org>2009-06-30 18:01:22 (GMT)
committer WWDillingham WesleyDillingham <wwdillingham@sugarlabs.org>2009-06-30 18:01:22 (GMT)
commitdb0545fab3c8d040c9764032b4c26bcc04cb2cd9 (patch)
treefbc34299c870d6b2ddbaebd7db0af14129ec0635
parent9da97956ce8675fccc55b3fb0a48f878946d6747 (diff)
Created only_addition[] which keeps track of equations with only one operation in them
-rw-r--r--order_of_operations_parser.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/order_of_operations_parser.php b/order_of_operations_parser.php
index 3b29771..d025d8f 100644
--- a/order_of_operations_parser.php
+++ b/order_of_operations_parser.php
@@ -83,7 +83,14 @@ for (i=0;i<=$numRecords;i++)
//Now we need to determine if a particular question contained ONLY a particular operation
- if (preg_match($regexp, $equation
+
+ //Matches operations with ONLY ADDITION
+ if (preg_match($regexp, $equation) && !preg_match("-", $equation), && !preg_match("/", $equation), && !preg_match("*", $equation))
+ {
+ only_addition[tok[2]]++
+ }
+
+
/*# Matches operations with ONLY ADDITION
if ( !match($3, /\//) && !match($3, /[0-9]\-[0-9]/) && match($3, /\+/) && !match($3, /\*/) )