# Khan/khan-exercises

Clean up the exercise files using the new cleaning utility.

jeresig committed Apr 16, 2013
1 parent d50d27c commit e9807fff11c4a28fa61effa4641a2518d84b306b
Showing 444 changed files with 7,574 additions and 7,200 deletions.
 @@ -1,15 +1,15 @@ - - - + + + Finding absolute values
-
- rand(5) > 0 ? randRange( 1, 9 ) : 0 - rand(3) > 0 ? "." + randRange(1, 9) : "" +
+ rand(5) > 0 ? randRange( 1, 9 ) : 0 + rand(3) > 0 ? "." + randRange(1, 9) : "" randFromArray(["", "-"])
@@ -40,14 +40,15 @@ numberLine( start, end ); style({ stroke: "#6495ED", fill: "#6495ED" }); graph.pt = circle( [ x, 0 ], 0.15 ); - style({ stroke: "#FFA500", fill: "#FFA500", strokeWidth: 3.5, arrows: "->" }); + style({ stroke: "#FFA500", fill: "#FFA500", strokeWidth: 3.5, arrows: "->" }); path( [ [ originX, 0 ], [ x, 0 ] ] ); circle( [ originX, 0 ], 0.10 ); graph.pt.toFront();

The distance from 0 to SIGN + INT + FRAC is INT + FRAC, which equals the absolute value.

-

In other words, INT + FRAC is the non-negative version of SIGN + INT + FRAC.

+

In other words, INT + FRAC is the non-negative version of SIGN + INT + FRAC.

- - + + +
@@ -1,7 +1,7 @@
<!DOCTYPE html>
-<html data-require="math math-format">
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<!DOCTYPE html>
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>Absolute value equations</title>
<script src="../khan-exercise.js"></script>
@@ -12,10 +12,10 @@
<div class="vars">
<var id="A">randRange(2, 8)</var>
<var id="B">randRangeNonZero(-10, 10)</var>
- <var id="C" data-ensure="C !== A">
+ <var data-ensure="C !== A" id="C">

#### petercollingridge Apr 16, 2013

Member

I realise these changes were done automatically, but is there a way to avoid doing this, which doesn't appear to do anything except make it harder to read?

#### jeresig Apr 16, 2013

Member

Unfortunately there isn't, at least not with lxml - they all happen automatically and there's no way to enforce argument order.

#### petercollingridge Apr 16, 2013

Member

Fair enough, I thought that might be the case.

randRangeNonZero(-6, 6)
</var>
- <var id="D" data-ensure="D !== B">randRange(2, 10)</var>
+ <var data-ensure="D !== B" id="D">randRange(2, 10)</var>
<var id="E">randRangeNonZero(-10, 10)</var>
<var id="NO_SOLUTION">(D - B) / (A - C) &lt;= 0</var>
<var id="POS_SOLUTION">
@@ -43,21 +43,21 @@
</code>
</p>
- <div class="solution" data-type="multiple">
- <div class="sol" data-type="set">
- <div class="set-sol" data-each="SOLUTIONS as SOLUTION">
+ <div data-type="multiple" class="solution">
+ <div data-type="set" class="sol">
+ <div data-each="SOLUTIONS as SOLUTION" class="set-sol">
<var>SOLUTION</var>
</div>
<p class="input-format">
<code>x = </code> <span class="entry short40"></span>
- &nbsp; or
+ &#160; or
<code>x = </code> <span class="entry short40"></span>
</p>
</div>
<p></p>
<div>
<label>
- <span class="sol" data-type="checkbox">
+ <span data-type="checkbox" class="sol">
<var>NO_SOLUTION</var>
</span>
No solution
@@ -72,7 +72,7 @@
to not be graded. Otherwise it returns true an the
rest of the multiple answer will be checked normally.
-->
- <div class="sol" data-type="custom" required>
+ <div required="" data-type="custom" class="sol">
<div class="guess">
\$("#solutionarea input").eq(0).val() === ""
&amp;&amp;
@@ -106,7 +106,7 @@
</div>
<div class="hints">
- <div data-if="A > C" data-unwrap>
+ <div data-if="A &gt; C" data-unwrap="">
<div>
<p>
<var>C &gt; 0 ? "Subtract" : "Add"</var>
@@ -164,7 +164,7 @@
<var>SIMPLIFIED</var></code>
</p>
</div>
- <div data-if="!NO_SOLUTION" data-unwrap>
+ <div data-if="!NO_SOLUTION" data-unwrap="">
<div>
<p>
Because the absolute value of an expression
@@ -271,7 +271,7 @@
</code></p>
</div>
</div>
- <div data-else data-unwrap>
+ <div data-else="" data-unwrap="">
<div>
<p>
<var>A &gt; 0 ? "Subtract" : "Add"</var>
@@ -328,7 +328,7 @@
<var>SIMPLIFIED</var> = |x + <var>E</var>|
</code></p>
</div>
- <div data-if="!NO_SOLUTION" data-unwrap>
+ <div data-if="!NO_SOLUTION" data-unwrap="">
<div>
<p>
Because the absolute value of an expression
@@ -446,13 +446,14 @@
<var>fractionReduce.apply(null, POS_SOLUTION)</var>
</code>.
</p>
- <p data-else>
+ <p data-else="">
The absolute value cannot be negative. Therefore, there
is no solution.
</p>
</div>
</div>
</div>
</div>
-</body>
-</html>
+
+
+</body></html>
 @@ -1,7 +1,7 @@ - - - + + + Absolute value of complex numbers @@ -22,7 +22,7 @@

REPRESENTATION

-
+
ABS_SQUARE
@@ -32,7 +32,7 @@ of complex numbers can be determined using the distance formula.

-
+
graphInit({ range: [[-10, 10], [-10, 10]], scale: 20, @@ -55,7 +55,7 @@

-
+
path([ [0,0], [REAL, IMAG]], { stroke: KhanUtil.ORANGE }); @@ -65,7 +65,7 @@

-
+
path([ [0,0], [REAL, 0], [REAL, IMAG]], { stroke: KhanUtil.BLUE }); @@ -77,8 +77,8 @@

- Substituting into the Pythagorean theorem:
- \qquad |REPRESENTATION|^2 = abs( REAL )^2 + abs( IMAG )^2, so
+ Substituting into the Pythagorean theorem:
+ \qquad |REPRESENTATION|^2 = abs( REAL )^2 + abs( IMAG )^2, so
\qquad |REPRESENTATION| = \sqrt{abs( REAL )^2 + abs( IMAG )^2}.

@@ -87,12 +87,13 @@

Simplifying the radical gives formattedSquareRootOf( ABS_SQUARE ). That is the absolute value of REPRESENTATION.

-

+

The radical cannot be simplified. The absolute value of REPRESENTATION is \sqrt{ABS_SQUARE}.

- + +
 @@ -1,13 +1,13 @@ - - - + + + Adding and subtracting complex numbers
-
+
randRange( -5, 5 ) randRange( -5, 5 ) randRange( -5, 5 ) @@ -54,12 +54,12 @@ (A_REP_COLORED) OPERATOR (B_REP_COLORED)

-
- +