Permalink
Browse files

cleanup

  • Loading branch information...
1 parent efbc39b commit 0415132f2179ed509d1137f1a2e745abebd8a830 @jeffdyer jeffdyer committed Jan 14, 2012
@@ -13,11 +13,11 @@
<var id="MATH">MathModel.init()</var>
<var id="a_val">randRangeNonZero(-4, 4)</var>
<var id="b_val">randRange(6, 19)</var>
- <var id="c_val">randRange(20, 29)</var>
<var id="B">a_val+b_val</var>
<var id="C">a_val*b_val</var>
- <var id="PROBLEM">MATH.parse("x^2+"+B+"x+"+C)</var>
- <var id="SOLUTION">MATH.parse("(x+"+a_val+")(x+"+b_val+")")</var>
+ <var id="PROBLEM">MATH.polynomial([1, B, C], "x")</var>
+ <!-- use parse so that the ast matches the parsed user input -->
+ <var id="SOLUTION">MATH.parse("(x+"+a_val+")(x+"+b_val+")")</var>
</div>
<div>
<p class="question">
@@ -18,11 +18,12 @@
<var id="A">randFromArrayExclude(getFactors(a*b_abs), [1])</var>
<var id="B">a+b</var>
<var id="C">a*b/A</var>
- <var id="gcd1">getGCD(A, a)</var>
- <var id="gcd2">b_sign*getGCD(b_abs, C)</var>
- <var id="PROBLEM">MATH.parse(A+"x^2+"+B+"x+"+C)</var>
- <var id="SOLUTION">MATH.parse("("+gcd1+"x+"+gcd2+")("+A/gcd1+"x+"+a/gcd1+")")</var>
- <var id="HINT1">MATH.parse(gcd1+"x("+A/gcd1+"x+"+a/gcd1+")+"+gcd2+"("+b/gcd2+"x+"+C/gcd2+")")</var>
+ <var id="F1">getGCD(A, a)</var>
+ <var id="F2">b_sign*getGCD(b_abs, C)</var>
+ <var id="PROBLEM">MATH.polynomial([A, B, C], "x")</var>
+ <!-- use parse so that the ast matches the parsed user input -->
+ <var id="SOLUTION">MATH.parse("("+F1+"x+"+F2+")("+A/F1+"x+"+a/F1+")")</var>
+ <var id="HINT1">MATH.parse(F1+"x("+A/F1+"x+"+a/F1+")+"+F2+"("+b/F2+"x+"+C/F2+")")</var>
</div>
<div>
<p class="question">
@@ -16,7 +16,7 @@
<var id="c_val">randRange(20, 29)</var>
<var id="B">a_val+b_val</var>
<var id="C">a_val*b_val</var>
- <var id="PROBLEM">MATH.parse("x^2+"+B+"x+"+C+"=0")</var>
+ <var id="PROBLEM">MATH.polynomial([1, B, C], "x")</var>
</div>
<div>
<p class="question">
@@ -20,7 +20,7 @@
<var id="C">a*b/A</var>
<var id="F1">getGCD(A, a)</var>
<var id="F2">b_sign*getGCD(b_abs, C)</var>
- <var id="PROBLEM">MATH.parse(A+"x^2+"+B+"x+"+C+"=0")</var>
+ <var id="PROBLEM">MATH.polynomial([A, B, C], "x")</var>
<var id="SOLUTION">MATH.parse("("+F1+"x+"+F2+")("+A/F1+"x+"+a/F1+")=0")</var>
<var id="HINT1">MATH.parse(F1+"x("+A/F1+"x+"+a/F1+")+"+F2+"("+b/F2+"x+"+C/F2+")=0")</var>
<var id="X">MATH.parse("x=1/2")</var>
@@ -2,7 +2,7 @@
<html data-require="math graphie ast math-model">
<head>
<meta charset="UTF-8" />
- <title>Factoring Special Product Polynomials with A = 1</title>
+ <title>Factoring Perfect Square Polynomials with A = 1</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
Oops, something went wrong.

0 comments on commit 0415132

Please sign in to comment.