Permalink
Browse files

Clean up the exercise files using the new cleaning utility.

  • Loading branch information...
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 @@
<!DOCTYPE html>
-<html data-require="math graphie graphie-helpers">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<!DOCTYPE html>
+<html data-require="math graphie graphie-helpers"><head>
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>Finding absolute values</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="SIGN === &quot;&quot; || INT !== 0 || FRAC !== &quot;&quot;">
- <var id="INT">rand(5) > 0 ? randRange( 1, 9 ) : 0</var>
- <var id="FRAC">rand(3) > 0 ? "." + randRange(1, 9) : ""</var>
+ <div data-ensure='SIGN === "" || INT !== 0 || FRAC !== ""' class="vars">
+ <var id="INT">rand(5) &gt; 0 ? randRange( 1, 9 ) : 0</var>
+ <var id="FRAC">rand(3) &gt; 0 ? "." + randRange(1, 9) : ""</var>
<var id="SIGN">randFromArray(["", "-"])</var>
</div>
@@ -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: "-&gt;" });
path( [ [ originX, 0 ], [ x, 0 ] ] );
circle( [ originX, 0 ], 0.10 );
graph.pt.toFront();
</div>
<p>The distance from <code>0</code> to <code><var>SIGN + INT + FRAC</var></code> is <code><var>INT + FRAC</var></code>, which equals the absolute value.</p>
- <p data-if="SIGN !== &quot;&quot;">In other words, <code><var>INT + FRAC</var></code> is the non-negative version of <code><var>SIGN + INT + FRAC</var></code>.</p>
+ <p data-if='SIGN !== ""'>In other words, <code><var>INT + FRAC</var></code> is the non-negative version of <code><var>SIGN + INT + FRAC</var></code>.</p>
</div>
</div>
-</body>
-</html>
+
+
+</body></html>
@@ -1,7 +1,7 @@
<!DOCTYPE html>
-<html data-require="math math-format">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<!DOCTYPE html>
+<html data-require="math math-format"><head>
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>Absolute value equations</title>
<script src="../khan-exercise.js"></script>
</head>
@@ -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">

This comment has been minimized.

Show comment Hide comment
@petercollingridge

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?

@petercollingridge

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?

This comment has been minimized.

Show comment Hide comment
@jeresig

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.

@jeresig

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.

This comment has been minimized.

Show comment Hide comment
@petercollingridge

petercollingridge Apr 16, 2013

Member

Fair enough, I thought that might be the case.

@petercollingridge

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 @@
<!DOCTYPE html>
-<html data-require="math graphie math-format">
-<head>
- <meta charset="UTF-8" />
+<!DOCTYPE html>
+<html data-require="math graphie math-format"><head>
+ <meta charset="UTF-8">
<title>Absolute value of complex numbers</title>
<script src="../khan-exercise.js"></script>
</head>
@@ -22,7 +22,7 @@
<p>
<code><var>REPRESENTATION</var></code>
</p>
- <div class="solution" data-type="radical">
+ <div data-type="radical" class="solution">
<var>ABS_SQUARE</var>
</div>
<div class="hints">
@@ -32,7 +32,7 @@
of complex numbers can be determined using the distance formula.
</p>
<div>
- <div class="graphie" id="graph">
+ <div id="graph" class="graphie">
graphInit({
range: [[-10, 10], [-10, 10]],
scale: 20,
@@ -55,7 +55,7 @@
</p>
</div>
<div>
- <div class="graphie" data-update="graph">
+ <div data-update="graph" class="graphie">
path([ [0,0], [REAL, IMAG]], {
stroke: KhanUtil.ORANGE
});
@@ -65,7 +65,7 @@
</p>
</div>
<div>
- <div class="graphie" data-update="graph">
+ <div data-update="graph" class="graphie">
path([ [0,0], [REAL, 0], [REAL, IMAG]], {
stroke: KhanUtil.BLUE
});
@@ -77,8 +77,8 @@
</p>
</div>
<p>
- Substituting into the Pythagorean theorem:<br />
- <code>\qquad |<var>REPRESENTATION</var>|^2 = <var>abs( REAL )</var>^2 + <var>abs( IMAG )</var>^2</code>, so <br />
+ Substituting into the Pythagorean theorem:<br>
+ <code>\qquad |<var>REPRESENTATION</var>|^2 = <var>abs( REAL )</var>^2 + <var>abs( IMAG )</var>^2</code>, so <br>
<code>\qquad |<var>REPRESENTATION</var>| = \sqrt{<var>abs( REAL )</var>^2 + <var>abs( IMAG )</var>^2}</code>.
</p>
<p>
@@ -87,12 +87,13 @@
<p data-if="squareRootCanSimplify( ABS_SQUARE )">
Simplifying the radical gives <code><var>formattedSquareRootOf( ABS_SQUARE )</var></code>. That is the absolute value of <code><var>REPRESENTATION</var></code>.
</p>
- <p data-else>
+ <p data-else="">
The radical cannot be simplified. The absolute value of <code><var>REPRESENTATION</var></code> is <code>\sqrt{<var>ABS_SQUARE</var>}</code>.
</p>
</div>
</div>
</div>
</div>
-</body>
+
+</body></html>
@@ -1,13 +1,13 @@
<!DOCTYPE html>
-<html data-require="math math-format">
-<head>
- <meta charset="UTF-8" />
+<!DOCTYPE html>
+<html data-require="math math-format"><head>
+ <meta charset="UTF-8">
<title>Adding and subtracting complex numbers</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="ANSWER_IMAG !== -1">
+ <div data-ensure="ANSWER_IMAG !== -1" class="vars">
<var id="A_REAL">randRange( -5, 5 )</var>
<var id="A_IMAG">randRange( -5, 5 )</var>
<var id="B_REAL">randRange( -5, 5 )</var>
@@ -54,12 +54,12 @@
(<var>A_REP_COLORED</var>) <var>OPERATOR</var> (<var>B_REP_COLORED</var>)
</code>
</p>
- <div class="solution" data-type="multiple">
- <span class="sol short50" data-forms="integer, decimal" data-fallback="0" data-inexact data-max-error="0.01">
+ <div data-type="multiple" class="solution">
+ <span data-inexact="" data-fallback="0" data-forms="integer, decimal" class="sol short50" data-max-error="0.01">
<var>ANSWER_REAL</var>
</span>
<code>+</code>
- <span class="sol short50" data-forms="integer, decimal" data-fallback="1" data-inexact data-max-error="0.01">
+ <span data-inexact="" data-fallback="1" data-forms="integer, decimal" class="sol short50" data-max-error="0.01">
<var>ANSWER_IMAG</var>
</span>
<code>i</code>
@@ -97,6 +97,7 @@
</div>
</div>
</div>
-</body>
-</html>
+
+
+</body></html>
Oops, something went wrong.

0 comments on commit e9807ff

Please sign in to comment.