Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Realign linear_equations exercises to tutorial

Summary:
one_step_equations is now only a+x=b
linear_equations_1 is now only ax=b and x/a=b

Test Plan: Tested locally

Reviewers: stephanie

Reviewed By: stephanie

Differential Revision: http://phabricator.khanacademy.org/D911
  • Loading branch information...
commit 3402466232b78d067e6c34bec336196152b975ec 1 parent 3a9c2f1
@beneater beneater authored
View
4 css/khan-exercise.css
@@ -5,10 +5,10 @@ var { font-style: normal; }
.hint_blue { color: #6495ED; }
.hint_orange { color: #FFA500; }
.hint_pink { color: #FF00AF; }
-.hint_red { color: red; }
+.hint_red { color: #DF0030; }
.hint_green { color: #28AE7B; }
.hint_gray { color: gray; }
-.hint_purple{ color: purple; }
+.hint_purple{ color: #9D38BD; }
.final_answer { font-weight: bold; }
View
113 exercises/linear_equations_1.html
@@ -8,42 +8,107 @@
<body>
<div class="exercise">
<div class="vars">
- <!--
- An example where some form of exercise inheritance would be useful.
- Linear Eq 1 ==> AX = D
- Linear Eq 2 ==> AX + B = CX
- Linear Eq 3 ==> AX + B = CX + D
-
- Issue #36 for reference.
- -->
- <var id="A">randRange( 2, 10 )</var>
- <var id="D">randRange( 2, 10 )</var>
- <var id="SOLUTION">fractionReduce( D, A )</var>
- <var id="ONE_OVER_A">fractionReduce( 1, A )</var>
+ <var id="X">randFromArray("x")</var>
+ <var id="A">randRange(2, 10)</var>
+ <var id="D">randRange(2, 10)</var>
+ <var id="SOLUTION">fractionReduce(D, A)</var>
+ <var id="ONE_OVER_A">fractionReduce(1, A)</var>
</div>
<div class="problems">
- <div>
- <p class="question">Solve for <code>x</code>:</p>
- <div><code><var>A</var>x = <var>D</var></code></div>
+ <div id="mul-var-on-left">
+ <p class="question">Solve for <code><var>X</var></code>:</p>
+ <div><code><var>A</var><var>X</var> = <var>D</var></code></div>
<div class="solution" data-type="multiple">
- <p><code>x =</code> <span class="sol"><var> D / A </var></span></p>
+ <p><code><var>X</var> =</code> <span class="sol"><var>D / A</var></span></p>
</div>
+ <div class="hints">
+ <div>
+ <p><span class="hint_red">Divide</span> both sides <span class="hint_red">by <code><var>A</var></code></span>:</p>
+ <p><code>
+ \red{\dfrac{\color{black}{<var>A</var><var>X</var>}}{<var>A</var>}} =
+ \red{\dfrac{\color{black}{<var>D</var>}}{<var>A</var>}}
+ </code></p>
+ </div>
+ <div>
+ <p>Simplify:</p>
+ <p><code>\dfrac{\cancel{<var>A</var>}<var>X</var>}{\cancel{<var>A</var>}} = <var>SOLUTION</var></code></p>
+ </div>
+ <p><code><var>X</var> = <var>SOLUTION</var></code></p>
+ </div>
+ </div>
+
+ <div id="mul-var-on-right">
+ <p class="question">Solve for <code><var>X</var></code>:</p>
+ <div><code><var>D</var> = <var>A</var><var>X</var></code></div>
+ <div class="solution" data-type="multiple">
+ <p><code><var>X</var> =</code> <span class="sol"><var>D / A</var></span></p>
+ </div>
+ <div class="hints">
+ <div>
+ <p><span class="hint_red">Divide</span> both sides <span class="hint_red">by <code><var>A</var></code></span>:</p>
+ <p><code>
+ \red{\dfrac{\color{black}{<var>D</var>}}{<var>A</var>}} =
+ \red{\dfrac{\color{black}{<var>A</var><var>X</var>}}{<var>A</var>}}
+ </code></p>
+ </div>
+ <div>
+ <p>Simplify:</p>
+ <p><code><var>SOLUTION</var> = \dfrac{\cancel{<var>A</var>}<var>X</var>}{\cancel{<var>A</var>}}</code></p>
+ </div>
+ <p><code><var>X</var> = <var>SOLUTION</var></code></p>
+ </div>
</div>
- </div>
- <div class="hints">
- <div>
- <p>Multiply both sides by <code><var>ONE_OVER_A</var></code>.</p>
- <p><code>(<var>ONE_OVER_A</var>) \cdot (<var>A</var>x) = (<var>ONE_OVER_A</var>) \cdot (<var>D</var>)</code></p>
+ <div id="div-var-on-left">
+ <p class="question">Solve for <code><var>X</var></code>:</p>
+ <div><code>\dfrac{<var>X</var>}{<var>A</var>} = <var>D</var></code></div>
+
+ <div class="solution" data-type="multiple">
+ <p><code><var>X</var> =</code> <span class="sol"><var>D * A</var></span></p>
+ </div>
+ <div class="hints">
+ <div>
+ <p><span class="hint_red">Multiply</span> both sides <span class="hint_red">by <code><var>A</var></code></span>:</p>
+ <p><code>
+ \dfrac{<var>X</var>}{<var>A</var>} \red{\cdot <var>A</var>} =
+ <var>D</var> \red{\cdot <var>A</var>}
+ </code></p>
+ </div>
+ <div>
+ <p>Simplify:</p>
+ <p><code>\dfrac{<var>X</var>}{\cancel{<var>A</var>}} \cdot \cancel{<var>A</var>} = <var>A * D</var></code></p>
+ </div>
+ <p><code><var>X</var> = <var>A * D</var></code></p>
+ </div>
</div>
- <div>
- <p>Simplify.</p>
- <p><code>x = <var>SOLUTION</var></code></p>
+
+ <div id="div-var-on-right">
+ <p class="question">Solve for <code><var>X</var></code>:</p>
+ <div><code><var>D</var> = \dfrac{<var>X</var>}{<var>A</var>}</code></div>
+
+ <div class="solution" data-type="multiple">
+ <p><code><var>X</var> =</code> <span class="sol"><var>D * A</var></span></p>
+ </div>
+ <div class="hints">
+ <div>
+ <p><span class="hint_red">Multiply</span> both sides <span class="hint_red">by <code><var>A</var></code></span>:</p>
+ <p><code>
+ <var>D</var> \red{\cdot <var>A</var>} =
+ \dfrac{<var>X</var>}{<var>A</var>} \red{\cdot <var>A</var>}
+ </code></p>
+ </div>
+ <div>
+ <p>Simplify:</p>
+ <p><code><var>A * D</var> = \dfrac{<var>X</var>}{\cancel{<var>A</var>}} \cdot \cancel{<var>A</var>}</code></p>
+ </div>
+ <p><code><var>X</var> = <var>A * D</var></code></p>
+ </div>
</div>
</div>
+
</div>
</body>
</html>
View
164 exercises/one_step_equations.html
@@ -7,108 +7,136 @@
</head>
<body>
<div class="exercise">
- <div class="vars">
- <var id="LETTERS">"abkmnpvx"</var>
- <var id="X">LETTERS.charAt( randRange( 0, LETTERS.length - 1 ) )</var>
+ <div class="summary">
+ <p>Solve equations in the forms:</p>
+ <p><code>\qquad x + 5 = 10</code></p>
+ <p><code>\qquad 5 + x = 10</code></p>
+ <p><code>\qquad 10 = x + 5</code></p>
+ <p><code>\qquad 10 = 5 + x</code></p>
</div>
+ <div class="vars" data-ensure="A !== B">
+ <var id="X">randFromArray("abkmnpvx")</var>
+ <var id="A">randRangeNonZero(-30, 30)</var>
+ <var id="B">randRangeNonZero(-30, 30)</var>
+ </div>
+ <p class="question">Solve for <code><var>X</var></code>:</p>
+ <div class="solution" data-type="multiple">
+ <p><code><var>X</var>=</code> <span class="sol"><var>B - A</var></code></p>
+ </div>
+
<div class="problems">
- <div id="add" data-weight="4">
- <div class="vars" data-ensure="Y !== Z">
- <var id="INDEX">randRange( 0, 3 )</var>
- <var id="Y">randRangeNonZero( -30, 30 )</var>
- <var id="Z">randRangeNonZero( -30, 30 )</var>
- <var id="Y_SIGN">Y > 0 ? "-" : "+"</var>
- <var id="LEFT">[expr( ["+", X, Y] ), expr( ["+", Y, X] ), Z, Z][INDEX]</var>
- <var id="RIGHT">[Z, Z, expr( ["+", X, Y] ), expr( ["+", Y, X] )][INDEX]</var>
- </div>
- <p class="question">Solve for <code><var>X</var></code>.</p>
- <p><code>\large{<var>LEFT</var> = <var>RIGHT</var>}</code></p>
- <div class="solution" data-type="rational"></div>
- <div class="solution" data-type="multiple">
- <p><code><var>X</var>=</code> <span class="sol"><var>Z - Y</var></span></p>
- </div>
+ <div id="a-x-eq-b">
+ <p class="problem"><code><var>A</var> + <var>X</var> = <var>B</var></code></p>
<div class="hints">
<div>
- <p><span data-if="Y &lt; 0">Add <var>Y * -1</var> to</span><span data-else>Subtract <var>Y</var> from</span> both sides.</p>
- <p data-if="INDEX &lt; 2"><code>\large{<var>X</var> = <var>RIGHT</var>\color{blue}{<var>Y_SIGN</var><var>abs( Y )</var>}}</code></p>
- <p data-else><code>\large{<var>LEFT</var>\color{blue}{<var>Y_SIGN</var><var>abs( Y )</var>} = <var>X</var>}</code></p>
+ <p>
+ <span data-if="A < 0"><span class="hint_red">Add <code><var>abs(A)</var></code></span> to both sides:</span>
+ <span data-else><span class="hint_red">Subtract <code><var>abs(A)</var></code></span> from both sides:</span>
+ </p><p><code>\qquad
+ \begin{eqnarray} \\
+ <var>A</var> + <var>X</var> &amp;=&amp; <var>B</var> \\ \\
+ \red{<var>A &lt; 0 ? "+" : "-"</var><var>abs(A)</var>} &amp;&amp; \red{<var>A &lt; 0 ? "+" : "-"</var><var>abs(A)</var>}
+ \end{eqnarray}
+ </code></p>
+ </div>
+ <div>
+ </p><p><code>\qquad
+ \begin{eqnarray}
+ \hphantom{<var>A</var> + <var>X</var>} &amp;\hphantom{=}&amp; \hphantom{<var>B</var>} \\
+ <var>X</var> &amp;=&amp; <var>B</var> \red{- <var>A</var>} \\
+ \end{eqnarray}
+ </code></p>
</div>
<div>
<p>Simplify.</p>
- <p><code>\large{<var>X</var> = <var>Z - Y</var>}</code></p>
+ <p><code>\qquad <var>X</var> = <var>B - A</var></code></p>
</div>
</div>
</div>
- <div id="multiply" data-weight="2">
- <div class="vars">
- <var id="INDEX">randRange( 0, 1 )</var>
- <var id="Y">randRange( 2, 20 ) * randRangeNonZero( -1, 1 )</var>
- <var id="Z">randRange( 2, 20 - abs( Y ) + 5 ) * randRangeNonZero( -1, 1 ) * Y</var>
- <var id="Y_SIGN">Y * Z > 0 ? "" : "-"</var>
- <var id="LEFT">[expr( ["*", Y, X] ), Z][INDEX]</var>
- <var id="RIGHT">[Z, expr( ["*", Y, X] )][INDEX]</var>
- </div>
- <p class="question">Solve for <code><var>X</var></code>.</p>
- <p><code>\large{<var>LEFT</var> = <var>RIGHT</var>}</code></p>
- <div class="solution" data-type="multiple">
- <p><code><var>X</var>=</code> <span class="sol" data-type="rational"><var>Z / Y</var></span></p>
- </div>
-
+ <div id="x-a-eq-b">
+ <p class="problem"><code><var>X</var> + <var>A</var> = <var>B</var></code></p>
<div class="hints">
- <div data-if="INDEX === 0">
- <p>Divide both sides by <var>Y</var>.</p>
- <p data-if="Y &lt; 0 && Z &lt; 0"><code>\large{<var>X</var> = \dfrac{<var>Z</var>}{\color{blue}{<var>Y</var>}}}</code></p>
- <p data-else><code>\large{<var>X</var> = <span data-if="Y &lt; 0">\color{blue}{<var>Y_SIGN</var>}</span><span data-else><var>Y_SIGN</var></span>\dfrac{<var>abs( Z )</var>}{\color{blue}{<var>abs( Y )</var>}}}</code></p>
+ <div>
+ <p>
+ <span data-if="A < 0"><span class="hint_red">Add <code><var>abs(A)</var></code></span> to both sides:</span>
+ <span data-else><span class="hint_red">Subtract <code><var>abs(A)</var></code></span> from both sides:</span>
+ </p><p><code>\qquad
+ \begin{eqnarray} \\
+ <var>X</var> + <var>A</var> &amp;=&amp; <var>B</var> \\ \\
+ \red{<var>A &lt; 0 ? "+" : "-"</var><var>abs(A)</var>} &amp;&amp; \red{<var>A &lt; 0 ? "+" : "-"</var><var>abs(A)</var>}
+ \end{eqnarray}
+ </code></p>
</div>
- <div data-else>
- <p>Divide both sides by <var>Y</var>.</p>
- <p data-if="Y &lt; 0 && Z &lt; 0"><code>\large{\dfrac{<var>Z</var>}{\color{blue}{<var>Y</var>}} = <var>X</var>}</code></p>
- <p data-else><code>\large{<span data-if="Y &lt; 0">\color{blue}{<var>Y_SIGN</var>}</span><span data-else><var>Y_SIGN</var></span>\dfrac{<var>abs( Z )</var>}{\color{blue}{<var>abs( Y )</var>}} = <var>X</var>}</code></p>
+ <div>
+ </p><p><code>\qquad
+ \begin{eqnarray}
+ \hphantom{<var>A</var> + <var>X</var>} &amp;\hphantom{=}&amp; \hphantom{<var>B</var>} \\
+ <var>X</var> &amp;=&amp; <var>B</var> \red{- <var>A</var>} \\
+ \end{eqnarray}
+ </code></p>
</div>
<div>
<p>Simplify.</p>
- <p><code>\large{<var>X</var> = <var>Z / Y</var>}</code></p>
+ <p><code>\qquad <var>X</var> = <var>B - A</var></code></p>
</div>
</div>
</div>
- <div id="divide" data-weight="1">
- <div class="vars">
- <var id="INDEX">randRange( 0, 1 )</var>
- <var id="Y">randRange( 2, 20 )</var>
- <var id="Z">randRange( 2, 20 - abs( Y ) + 5 ) * randRangeNonZero( -1, 1 )</var>
- </div>
- <p class="problem"><b>Solve for <code><var>X</var></code>.</b></p>
- <p class="question"><code>\large{\dfrac{<var>X</var>}{<var>Y</var>} = <var>Z</var>}</code></p>
-
- <div class="solution" data-type="multiple">
- <p><code><var>X</var>=</code> <span class="sol" data-type="rational"><var>Z * Y</var></span></p>
- </div>
-
+ <div id="b-eq-a-x">
+ <p class="problem"><code><var>B</var> = <var>A</var> + <var>X</var></code></p>
<div class="hints">
<div>
- <p>Multiply both sides by <var>Y</var>.</p>
- <p><code>\large{<var>X</var> = <var>Z</var> \cdot {\color{blue}{<var>Y</var>}}}</code></p>
+ <p>
+ <span data-if="A < 0"><span class="hint_red">Add <code><var>abs(A)</var></code></span> to both sides:</span>
+ <span data-else><span class="hint_red">Subtract <code><var>abs(A)</var></code></span> from both sides:</span>
+ </p><p><code>\qquad
+ \begin{eqnarray} \\
+ \hphantom{<var>B</var> \red{- <var>A</var>}} &amp;\hphantom{=}&amp; \hphantom{<var>X</var>} \\
+ <var>B</var> &amp;=&amp; <var>A</var> + <var>X</var> \\ \\
+ \red{<var>A &lt; 0 ? "+" : "-"</var><var>abs(A)</var>} &amp;&amp; \red{<var>A &lt; 0 ? "+" : "-"</var><var>abs(A)</var>} \\
+ \end{eqnarray}
+ </code></p>
+ </div>
+ <div>
+ </p><p><code>\qquad
+ \begin{eqnarray} \\
+ <var>B</var> \red{- <var>A</var>} &amp;=&amp; <var>X</var> \\
+ \end{eqnarray}
+ </code></p>
</div>
<div>
<p>Simplify.</p>
- <p><code>\large{<var>X</var> = <var>Z * Y</var>}</code></p>
+ <p><code>\qquad <var>X</var> = <var>B - A</var></code></p>
</div>
</div>
</div>
- <div id="divide-right" data-type="divide" data-weight="1">
- <p class="question"><code>\large{<var>Z</var> = \dfrac{<var>X</var>}{<var>Y</var>}}</code></p>
+ <div id="b-eq-x-a">
+ <p class="problem"><code><var>B</var> = <var>X</var> + <var>A</var></code></p>
<div class="hints">
<div>
- <p>Multiply both sides by <var>Y</var>.</p>
- <p><code>\large{<var>Z</var> \cdot {\color{blue}{<var>Y</var>}} = <var>X</var>}</code></p>
+ <p>
+ <span data-if="A < 0"><span class="hint_red">Add <code><var>abs(A)</var></code></span> to both sides:</span>
+ <span data-else><span class="hint_red">Subtract <code><var>abs(A)</var></code></span> from both sides:</span>
+ </p><p><code>\qquad
+ \begin{eqnarray} \\
+ \hphantom{<var>B</var> \red{- <var>A</var>}} &amp;\hphantom{=}&amp; \hphantom{<var>X</var>} \\
+ <var>B</var> &amp;=&amp; <var>X</var> + <var>A</var> \\ \\
+ \red{<var>A &lt; 0 ? "+" : "-"</var><var>abs(A)</var>} &amp;&amp; \red{<var>A &lt; 0 ? "+" : "-"</var><var>abs(A)</var>} \\
+ \end{eqnarray}
+ </code></p>
+ </div>
+ <div>
+ </p><p><code>\qquad
+ \begin{eqnarray} \\
+ <var>B</var> \red{- <var>A</var>} &amp;=&amp; <var>X</var> \\
+ \end{eqnarray}
+ </code></p>
</div>
<div>
<p>Simplify.</p>
- <p><code>\large{<var>X</var> = <var>Z * Y</var>}</code></p>
+ <p><code>\qquad <var>X</var> = <var>B - A</var></code></p>
</div>
</div>
</div>
</div>
- </div>
</body>
</html>
Please sign in to comment.
Something went wrong with that request. Please try again.