Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
adding final_answer style to final answers
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiash committed Apr 13, 2012
1 parent 2a4d0c8 commit 2f417d3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
6 changes: 0 additions & 6 deletions exercises/factoring_difference_of_squares_3.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@
</div> </div>
<div class="example">a factored expression, like <b>(x+1)(x+3)</b></div> <div class="example">a factored expression, like <b>(x+1)(x+3)</b></div>
</div> </div>
<!--
<div class="solution" data-type="multiple">
<p><span class="sol"><var>F</var></span>(<span class="sol"><var>A</var></span><code>x</code> - <span class="sol"><var>B</var></span>)(<span class="sol"><var>A</var></span><code>x</code> + <span class="sol"><var>B</var></span>)</p>
<p class="example">enter a (possibly negative) integer for each input area.</p>
</div>
-->
</div> </div>
</div> </div>
<div class="hints"> <div class="hints">
Expand Down
22 changes: 13 additions & 9 deletions exercises/factoring_polynomials_3.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -86,15 +86,19 @@
<p>or</p><p><code><var>parseFormat("(#{" + A + "}x^2+#{" + a + "}x)+(#{" + b + "}x+#{" + C + "})", [BLUE, GREEN, GREEN, ORANGE])</var></code></p> <p>or</p><p><code><var>parseFormat("(#{" + A + "}x^2+#{" + a + "}x)+(#{" + b + "}x+#{" + C + "})", [BLUE, GREEN, GREEN, ORANGE])</var></code></p>
<p>The next step is to factor both terms of the above expression:</p> <p>The next step is to factor both terms of the above expression:</p>
</div> </div>
<p> <div>
<code><var>format(HINT1, {del1factors:true, evalBasicNumOps:true})</var></code> <p>
</p> <code><var>format(HINT1, {del1factors:true, evalBasicNumOps:true})</var></code>
<p> </p>
Redistribute the common term to get the answer: </div>
</p> <div class="final_answer">
<p> <p>
<code><var>format(SOLUTION, simplifyOptions.basic, false, "large")</var></code> Redistribute the common term to get the answer:
</p> </p>
<p>
<code><var>format(SOLUTION, simplifyOptions.basic, false, "large")</var></code>
</p>
</div>
</div> </div>
</div> </div>
</div> </div>
Expand Down
4 changes: 2 additions & 2 deletions utils/simplifying-expressions.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@


var hintExpr = getFractionFromOccFactors(factors, newOccFactors, argsOccFactors); var hintExpr = getFractionFromOccFactors(factors, newOccFactors, argsOccFactors);
if (KhanUtil.exprIdentical(newExpr, solExpr)) { if (KhanUtil.exprIdentical(newExpr, solExpr)) {
steps.add("<p>There are no factors that can be simplified in this expression, so the answer is: <code>" + KhanUtil.format(solExpr) + "</code>"); steps.add("<p class='final_answer'>There are no factors that can be simplified in this expression, so the answer is: <code>" + KhanUtil.format(solExpr) + "</code>");
} else { } else {
steps.add("<p>Applying the approach described above gives in this case:</p><p><code>" + KhanUtil.format(hintExpr) + "</code></p>"); steps.add("<p>Applying the approach described above gives in this case:</p><p><code>" + KhanUtil.format(hintExpr) + "</code></p>");
steps.add("<p>We obtain the following expression:</p><p><code>" + KhanUtil.format(solExpr) + "</code></p>"); steps.add("<p class='final_answer'>We obtain the following expression:</p><p><code>" + KhanUtil.format(solExpr) + "</code></p>");
} }
var hints = KhanUtil.genHints(steps); var hints = KhanUtil.genHints(steps);
return {solution: solExpr, hints: hints, choices: choices}; return {solution: solExpr, hints: hints, choices: choices};
Expand Down

0 comments on commit 2f417d3

Please sign in to comment.