Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix #33076 remove extraneous hint

Summary: There's no reason for one-root to inherit from original

Test Plan: Tested locally

Reviewers: stephanie

Reviewed By: stephanie

Differential Revision: http://phabricator.khanacademy.org/D897
  • Loading branch information...
commit c9bb36efa9890c1a0b79c667c35b190ff55211fc 1 parent d3ce772
Ben Eater beneater authored
74 exercises/simplifying_square_roots_of_negatives.html
View
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html data-require="math math-format">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Simplifying square roots of negative numbers</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+<body>
+ <div class="exercise">
+ <div class="problems">
+ <div id="already-simplified" data-weight="2">
+ <div class="vars">
+ <var id="NUM">randFromArray([30, 42, 66, 70, 105, 110, 154, 165, 210])</var>
+ </div>
+
+ <p class="question">
+ Simplify <code>\sqrt{<var>-NUM</var>}</code>.
+ </p>
+
+ <div class="solution" data-type="radical" data-complex-radical><var>NUM</var></div>
+
+ <div class="hints">
+ <p>The number <code><var>NUM</var></code> has no perfect square factors.</p>
+ <p>Remember that <code>\sqrt{-1} = i</code>.</p>
+ <p class="final_answer">Thus, <code>\sqrt{<var>-NUM</var>} = \sqrt{<var>NUM</var> \cdot (-1)} = \sqrt{<var>NUM</var>}~i</code> is the simplest form</p>
+ </div>
+ </div>
+
+ <div id="perfect-squares" data-weight="2">
+ <div class="vars">
+ <var id="NUM">randFromArray([9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225])</var>
+ <var id="SPLIT">splitRadical(NUM)</var>
+ <var id="COEFFICIENT">SPLIT[0] === 1 ? "" : SPLIT[0]</var>
+ </div>
+
+ <p class="question">
+ Simplify <code>\sqrt{<var>-NUM</var>}</code>.
+ </p>
+
+ <div class="solution" data-type="radical" data-complex-radical><var>NUM</var></div>
+
+ <div class="hints">
+ <p>The number <code><var>NUM</var></code> is a perfect square, so <code><var>-NUM</var> = <var>COEFFICIENT</var>^2 \cdot (-1)</code>.</p>
+ <p>Remember that <code>\sqrt{-1} = i</code>.</p>
+ <p class="final_answer"> Thus, <code>\sqrt{<var>-NUM</var>} = \sqrt{<var>COEFFICIENT</var>^2 \cdot (-1)} = <var>COEFFICIENT</var>i</code>.</p>
+ </div>
+ </div>
+
+ <div id="not-yet-simple" data-weight="6">
+ <div class="vars">
+ <var id="NUM">randFromArray([8, 12, 18, 20, 24, 27, 28, 32, 40, 44, 45, 48, 50, 54, 56, 60, 63, 72, 75, 80, 88, 90, 98, 99, 120, 125, 128, 140, 150, 160, 175, 180, 200, 216])</var>
+ <var id="SPLIT">splitRadical(NUM)</var>
+ <var id="COEFFICIENT">SPLIT[0] === 1 ? "" : SPLIT[0]</var>
+ <var id="RADICAL">SPLIT[1] === 1 ? "" : SPLIT[1]</var>
+ </div>
+
+ <p class="question">
+ Simplify <code>\sqrt{<var>-NUM</var>}</code>.
+ </p>
+
+ <div class="solution" data-type="radical" data-complex-radical><var>NUM</var></div>
+
+ <div class="hints">
+ <p>The largest perfect square that divides <code><var>NUM</var></code> is <code><var>COEFFICIENT * COEFFICIENT</var></code>.</p>
+ <p>Factoring it out, we have <code><var>NUM</var> = <var>COEFFICIENT</var>^2 \cdot <var>RADICAL</var></code>.</p>
+ <p>So <code>\sqrt{<var>-NUM</var>} = \sqrt{<var>COEFFICIENT</var>^2 \cdot <var>RADICAL</var> \cdot (-1)}</code>.</p>
+ <p>Remember that <code>\sqrt{-1} = i</code>.</p>
+ <p class="final_answer">Thus, <code>\sqrt{<var>-NUM</var>} = \sqrt{<var>COEFFICIENT</var>^2 \cdot <var>RADICAL</var> \cdot (-1)} = <var>COEFFICIENT</var>\sqrt{<var>RADICAL</var>}~i</code>.</p>
+ </div>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
20 exercises/solving_quadratics_by_factoring.html
View
@@ -41,7 +41,7 @@
</div>
<div class="hints" data-apply="appendContents">
- <div id="hint1">
+ <div>
<p>The two numbers <code class="hint_pink"><var>-A</var></code> and <code class="hint_pink"><var>-B</var></code> satisfy both conditions:</p>
<p><code>
\qquad \color{<var>PINK</var>}{<var>-A</var>} + \color{<var>PINK</var>}{<var>-B</var>} =
@@ -52,22 +52,22 @@
\color{<var>BLUE</var>}{<var>SIMPLECONSTANT</var>}
</code></p>
</div>
- <p id="hint2">
+ <p>
So <code>(x <var>A &lt; 0 ? "+" : ""</var> \color{<var>PINK</var>}{<var>-A</var>})
(x <var>B &lt; 0 ? "+" : ""</var> \color{<var>PINK</var>}{<var>-B</var>}) = 0</code>.
</p>
- <p id="hint3">
+ <p>
Since <code>(x <var>A &lt; 0 ? "+" : ""</var> <var>-A</var>)
(x <var>B &lt; 0 ? "+" : ""</var> <var>-B</var>) = 0</code>,
we know that one or both quantities must equal zero for the equation to be true.
</p>
- <p id="hint4"><code>x + <var>-A</var> = 0</code> or <code>x + <var>-B</var> = 0</code></p>
- <p id="hint5"><b>Thus, <code>x = <var>A</var></code> and <code>x = <var>B</var></code> are the solutions.</b></p>
+ <p><code>x + <var>-A</var> = 0</code> or <code>x + <var>-B</var> = 0</code></p>
+ <p>Thus, <code>x = <var>A</var></code> and <code>x = <var>B</var></code> are the solutions.</p>
</div>
</div>
- <div id="one-root" data-type="original">
+ <div id="one-root">
<div class="vars">
<var id="CONSTANT">SQUARE * A * A</var>
<var id="SIMPLECONSTANT">A * A</var>
@@ -80,7 +80,7 @@
<p><code>x = \quad</code><span class="sol"><var>A</var></span></p>
</div>
<div class="hints" data-apply="appendContents">
- <div id="hint1">
+ <div>
<p>The number <code class="hint_pink"><var>-A</var></code> used twice satisfies both conditions:</p>
<p><code>
\qquad \color{<var>PINK</var>}{<var>-A</var>} + \color{<var>PINK</var>}{<var>-A</var>} =
@@ -91,9 +91,9 @@
\color{<var>BLUE</var>}{<var>SIMPLECONSTANT</var>}
</code></p>
</div>
- <p id="hint2">So <code>(x <var>A &lt; 0 ? "+" : ""</var> \color{<var>PINK</var>}{<var>-A</var>})^2 = 0</code>.</p>
- <p id="hint3"><code>x + <var>-A</var> = 0</code></p>
- <p id="hint4"><b>Thus, <code>x = <var>A</var></code> is the solution.</b></p>
+ <p>So <code>(x <var>A &lt; 0 ? "+" : ""</var> \color{<var>PINK</var>}{<var>-A</var>})^2 = 0</code>.</p>
+ <p><code>x + <var>-A</var> = 0</code></p>
+ <p>Thus, <code>x = <var>A</var></code> is the solution.</p>
</div>
</div>
</div>
1  test/exercises/simplifying_square_roots_of_negatives.js
View
@@ -0,0 +1 @@
+Khan.testExercise({"exercise":"simplifying_square_roots_of_negatives","problems":[{"seed":1243431447,"type":"already-simplified","VARS":{"NUM":154,"SPLIT":[1,154],"COEFFICIENT":"","RADICAL":154},"solution":["","154"],"pass":true},{"seed":205606759,"type":"already-simplified","VARS":{"NUM":70,"SPLIT":[1,70],"COEFFICIENT":"","RADICAL":70},"solution":["","70"],"pass":true},{"seed":113089252,"type":"already-simplified","VARS":{"NUM":154,"SPLIT":[1,154],"COEFFICIENT":"","RADICAL":154},"solution":["","154"],"pass":true},{"seed":202294133,"type":"already-simplified","VARS":{"NUM":210,"SPLIT":[1,210],"COEFFICIENT":"","RADICAL":210},"solution":["","210"],"pass":true},{"seed":267244160,"type":"already-simplified","VARS":{"NUM":70,"SPLIT":[1,70],"COEFFICIENT":"","RADICAL":70},"solution":["","70"],"pass":true},{"seed":101192034,"type":"perfect-squares","VARS":{"NUM":196,"SPLIT":[14,1],"COEFFICIENT":14,"RADICAL":""},"solution":["14",""],"pass":true},{"seed":237306786,"type":"perfect-squares","VARS":{"NUM":225,"SPLIT":[15,1],"COEFFICIENT":15,"RADICAL":""},"solution":["15",""],"pass":true},{"seed":258311946,"type":"perfect-squares","VARS":{"NUM":9,"SPLIT":[3,1],"COEFFICIENT":3,"RADICAL":""},"solution":["3",""],"pass":true},{"seed":19747205,"type":"perfect-squares","VARS":{"NUM":16,"SPLIT":[4,1],"COEFFICIENT":4,"RADICAL":""},"solution":["4",""],"pass":true},{"seed":22474603,"type":"perfect-squares","VARS":{"NUM":144,"SPLIT":[12,1],"COEFFICIENT":12,"RADICAL":""},"solution":["12",""],"pass":true},{"seed":205941790,"type":"not-yet-simple","VARS":{"NUM":63,"SPLIT":[3,7],"COEFFICIENT":3,"RADICAL":7},"solution":["3","7"],"pass":true},{"seed":129756701,"type":"not-yet-simple","VARS":{"NUM":88,"SPLIT":[2,22],"COEFFICIENT":2,"RADICAL":22},"solution":["2","22"],"pass":true},{"seed":158533811,"type":"not-yet-simple","VARS":{"NUM":98,"SPLIT":[7,2],"COEFFICIENT":7,"RADICAL":2},"solution":["7","2"],"pass":true},{"seed":176515527,"type":"not-yet-simple","VARS":{"NUM":125,"SPLIT":[5,5],"COEFFICIENT":5,"RADICAL":5},"solution":["5","5"],"pass":true},{"seed":202107033,"type":"not-yet-simple","VARS":{"NUM":48,"SPLIT":[4,3],"COEFFICIENT":4,"RADICAL":3},"solution":["4","3"],"pass":true},{"seed":91412249,"type":"already-simplified","VARS":{"NUM":66,"SPLIT":[1,66],"COEFFICIENT":"","RADICAL":66},"solution":["","66"],"pass":true},{"seed":79075691,"type":"already-simplified","VARS":{"NUM":66,"SPLIT":[1,66],"COEFFICIENT":"","RADICAL":66},"solution":["","66"],"pass":true},{"seed":81292096,"type":"already-simplified","VARS":{"NUM":66,"SPLIT":[1,66],"COEFFICIENT":"","RADICAL":66},"solution":["","66"],"pass":true},{"seed":70739588,"type":"already-simplified","VARS":{"NUM":42,"SPLIT":[1,42],"COEFFICIENT":"","RADICAL":42},"solution":["","42"],"pass":true},{"seed":58053812,"type":"already-simplified","VARS":{"NUM":70,"SPLIT":[1,70],"COEFFICIENT":"","RADICAL":70},"solution":["","70"],"pass":true},{"seed":100988473,"type":"perfect-squares","VARS":{"NUM":144,"SPLIT":[12,1],"COEFFICIENT":12,"RADICAL":""},"solution":["12",""],"pass":true},{"seed":194364952,"type":"perfect-squares","VARS":{"NUM":16,"SPLIT":[4,1],"COEFFICIENT":4,"RADICAL":""},"solution":["4",""],"pass":true},{"seed":40092797,"type":"perfect-squares","VARS":{"NUM":81,"SPLIT":[9,1],"COEFFICIENT":9,"RADICAL":""},"solution":["9",""],"pass":true},{"seed":134449553,"type":"perfect-squares","VARS":{"NUM":121,"SPLIT":[11,1],"COEFFICIENT":11,"RADICAL":""},"solution":["11",""],"pass":true},{"seed":171956971,"type":"perfect-squares","VARS":{"NUM":144,"SPLIT":[12,1],"COEFFICIENT":12,"RADICAL":""},"solution":["12",""],"pass":true},{"seed":188121618,"type":"not-yet-simple","VARS":{"NUM":80,"SPLIT":[4,5],"COEFFICIENT":4,"RADICAL":5},"solution":["4","5"],"pass":true},{"seed":153838523,"type":"not-yet-simple","VARS":{"NUM":80,"SPLIT":[4,5],"COEFFICIENT":4,"RADICAL":5},"solution":["4","5"],"pass":true},{"seed":152778956,"type":"not-yet-simple","VARS":{"NUM":120,"SPLIT":[2,30],"COEFFICIENT":2,"RADICAL":30},"solution":["2","30"],"pass":true},{"seed":195314900,"type":"not-yet-simple","VARS":{"NUM":160,"SPLIT":[4,10],"COEFFICIENT":4,"RADICAL":10},"solution":["4","10"],"pass":true},{"seed":233142206,"type":"not-yet-simple","VARS":{"NUM":180,"SPLIT":[6,5],"COEFFICIENT":6,"RADICAL":5},"solution":["6","5"],"pass":true}],"issues":0});
1  test/index.html
View
@@ -130,6 +130,7 @@
<script src="exercises/shifting_and_reflecting_functions.js"></script>
<script src="exercises/simplifying_fractions.js"></script>
<script src="exercises/simplifying_radicals.js"></script>
+ <script src="exercises/simplifying_square_roots_of_negatives.js"></script>
<script src="exercises/slope_of_a_line.js"></script>
<script src="exercises/solid_geometry.js"></script>
<script src="exercises/solving_for_a_variable.js"></script>
11 utils/answer-types.js
View
@@ -444,7 +444,10 @@ $.extend(Khan.answerTypes, {
solutionarea.addClass("radical")
.append(inte)
.append('<span class="surd">&radic;</span>')
- .append(rad.addClass("overline"));
+ .append(rad.addClass("overline"))
+ if (options.complexRadical !== undefined) {
+ solutionarea.append('<span class="surd" style="font-family: MathJax_Math;">i</span>')
+ };
var ret = function() {
// Load entered values into inteGuess, radGuess
@@ -470,7 +473,11 @@ $.extend(Khan.answerTypes, {
}
};
if (options.simplify === "required") {
- ret.examples = ["a simplified radical, like <code>\\sqrt{2}</code> or <code>3\\sqrt{5}</code>"];
+ if (options.complexRadical !== undefined) {
+ ret.examples = ["a simplified radical, like <code>\\sqrt{2}~i</code> or <code>3\\sqrt{5}~i</code>"];
+ } else {
+ ret.examples = ["a simplified radical, like <code>\\sqrt{2}</code> or <code>3\\sqrt{5}</code>"];
+ }
} else {
ret.examples = ["a radical, like <code>\\sqrt{8}</code> or <code>2\\sqrt{2}</code>"];
}
Please sign in to comment.
Something went wrong with that request. Please try again.