Permalink
Browse files

Whitespace cleanup!

  • Loading branch information...
1 parent e9dc109 commit 6371709b920b654d431c95117d82036343b4a3f4 @spicyj spicyj committed Jun 21, 2011
@@ -48,7 +48,7 @@
</div>
<div class="hints">
- <p><code><var>NOTATION.ddxF</var> = (</code> derivative of <code><var>OUTER.fText</var></code> with respect to <code><var>INNER.fText</var>
+ <p><code><var>NOTATION.ddxF</var> = (</code> derivative of <code><var>OUTER.fText</var></code> with respect to <code><var>INNER.fText</var>
) \cdot (</code> derivative of <code><var>INNER.fText</var></code> with respect to <code>x)</code></p>
<p>The derivative of <code><var>OUTER.fText</var></code> with respect to <code><var>INNER.fText</var> = <var>OUTER.ddxFText</var></code></p>
@@ -5,7 +5,7 @@
<script src="../khan-exercise.js"></script>
</head>
<body>
- <!--
+ <!--
Compares fractions that have the same numerator or have the same denominator.
TODO: would like to draw overlapping circles or rectangle slices for hints.
-->
@@ -15,7 +15,7 @@
<div class="vars" data-ensure="DEN_1 !== DEN_2">
<var id="NUM_1">randRange( 1, 14 )</var>
<var id="DEN_1">randRange( NUM_1 + 1, 15 )</var>
-
+
<var id="NUM_2">NUM_1</var>
<var id="DEN_2">randRange( NUM_2 + 1, 15 )</var>
@@ -31,7 +31,7 @@
<var id="LESS">DEN_1 > DEN_2 ? "less" : "more"</var>
<var id="BIGGER">SMALLER === "smaller" ? "bigger" : "smaller"</var>
</div>
-
+
<div class="problem">
<p>Fill in the blank.</p>
<p>
@@ -62,12 +62,12 @@
<p>So, <code>\dfrac{<var>NUM_1</var>}{<var>DEN_1</var>} <var>SOLUTION</var> \dfrac{<var>NUM_2</var>}{<var>DEN_2</var>}</code></p>
</div>
</div>
-
+
<div id="same-denominator">
<div class="vars" data-ensure="NUM_1 !== NUM_2">
<var id="NUM_1">randRange( 1, 14 )</var>
<var id="DEN_1">randRange( NUM_1 + 1, 15 )</var>
-
+
<var id="DEN_2">DEN_1</var>
<var id="NUM_2">randRange( 1, DEN_2 - 1 )</var>
@@ -80,7 +80,7 @@
})()</var>
<var id="LESS">NUM_1 < NUM_2 ? "less" : "more"</var>
</div>
-
+
<div class="problem">
<p>Fill in the blank.</p>
<p>
@@ -104,7 +104,7 @@
<div class="graph" style="width:200px; height: 200px; float: left;">
piechart( [NUM_2, DEN_2 - NUM_2], ["#ee0000", "#999"], 50 );
</div>
- </div>
+ </div>
</div>
<p><var>plural( NUM_1, "slice" )</var> is <var>LESS</var> pizza than <var>plural( NUM_2, "slice" )</var>.</p>
<p>So, <code>\dfrac{<var>NUM_1</var>}{<var>DEN_1</var>} <var>SOLUTION</var> \dfrac{<var>NUM_2</var>}{<var>DEN_2</var>}</code></p>
@@ -113,4 +113,4 @@
</div>
</div>
</body>
-</html>
+</html>
@@ -16,7 +16,7 @@
<var id="FACTOR">randRange( 2, 3 )</var>
<var id="NUM_1">randRange( 1, 14 )</var>
<var id="NUM_2">randRange( 1, 14 )</var>
-
+
<var id="DEN_1">randRange( NUM_1 + 1, 15 )</var>
<var id="DEN_2">randRange( NUM_2 + 1, 15 )</var>
@@ -26,7 +26,7 @@
var tmp = NUM_1;
NUM_1 = NUM_2;
NUM_2 = tmp;
-
+
tmp = DEN_1;
DEN_1 = DEN_2;
DEN_2 = tmp;
@@ -35,13 +35,13 @@
return "unused var";
})()
</var>
-
+
<var id="LCM">getLCM( DEN_1, DEN_2 )</var>
<var id="F1">LCM / DEN_1</var>
<var id="BECOMES_1">F1 === 1 ? "remains as" : "becomes"</var>
<var id="F2">LCM / DEN_2</var>
<var id="BECOMES_2">F2 === 1 ? "remains as" : "becomes"</var>
-
+
<var id="SOLUTION">(function() {
var f1 = NUM_1 / DEN_1;
var f2 = NUM_2 / DEN_2;
@@ -68,7 +68,7 @@
<li>=</li>
<li>&gt;</li>
</ul>
-
+
<div class="hints">
<p>It is easier to compare these two fractions when they have the same denominator.</p>
<p>Their smallest common denominator is the LCM of <var>DEN_1</var> and <var>DEN_2</var>.</p>
@@ -80,12 +80,12 @@
<p>We see that <code>\dfrac{<var>NUM_1 * F1</var>}{<var>LCM</var>} <var>SOLUTION</var> \dfrac{<var>NUM_2 * F2</var>}{<var>LCM</var>}</code>.</p>
</div>
</div>
-
+
<div id="multiple" data-type="original">
<div class="vars">
<var id="NUM_1">randRange( 1, 4 )</var>
<var id="NUM_2">NUM_1 * FACTOR</var>
-
+
<var id="DEN_1">randRange( NUM_1 + 1, 5 )</var>
<var id="DEN_2">DEN_1 * FACTOR</var>
</div>
@@ -94,4 +94,4 @@
</div>
</div>
</body>
-</html>
+</html>
@@ -53,4 +53,4 @@
</div>
</div>
</body>
-</html>
+</html>
@@ -25,7 +25,7 @@
<!-- increment of selected random value (i.e. 20, 25, 30, 35... are possible values for incr of 5 -->
<var id="PERCENT_UNFAIR_HEADS_INCR">5</var>
-
+
<!-- PROBLEM-SPECIFIC VALUES -->
<!-- random range for total coins in bag -->
<var id="NUM_COINS">randRange(5, 15)</var>
@@ -74,17 +74,14 @@
<var id="CHANCE_UNFAIR_PICKED">NUM_UNFAIR_COINS / NUM_COINS</var>
<var id="CHANCE_FAIR_PICKED">1 - CHANCE_UNFAIR_PICKED</var>
- <var id="ANSWER">round(10000 * (CHANCE_UNFAIR_PICKED * pow((PERCENT_CHANCE_UNFAIR_HEADS / 100), NUM_FLIPS) +
+ <var id="ANSWER">round(10000 * (CHANCE_UNFAIR_PICKED * pow((PERCENT_CHANCE_UNFAIR_HEADS / 100), NUM_FLIPS) +
CHANCE_FAIR_PICKED * pow(.5,NUM_FLIPS))) / 100</var>
</div>
<div class="problems">
<div>
- <p class="problem">You have <code><var>NUM_COINS</var></code> coins in a bag. <code><var>NUM_UNFAIR_COINS</var></code> of them are
- unfair in that they have a <code><var>PERCENT_CHANCE_UNFAIR_HEADS</var>\%</code> chance of coming up heads when
- flipped (the rest are fair coins). You randomly choose one coin from the bag and flip it
- <code><var>NUM_FLIPS</var></code> times.</p>
+ <p class="problem">You have <code><var>NUM_COINS</var></code> coins in a bag. <code><var>NUM_UNFAIR_COINS</var></code> of them are unfair in that they have a <code><var>PERCENT_CHANCE_UNFAIR_HEADS</var>\%</code> chance of coming up heads when flipped (the rest are fair coins). You randomly choose one coin from the bag and flip it <code><var>NUM_FLIPS</var></code> times.</p>
<p class="question">What is the percent probability of getting <code><var>NUM_FLIPS</var></code> heads?</p>
<p>Write your answer as a percent, such as <code>12.34\%</code></p>
<p class="solution" data-type="percent"><var>ANSWER</var></p>
@@ -115,11 +112,11 @@
<!-- hint suggesting combining unfair coin selection with all-heads-flip event -->
<p>Now, then, your chance of both picking the unfair coin and also flipping
<code class="unfair"><var>NUM_FLIPS</var></code> heads--the chance that both these events occur--is what?</p>
-
+
<!-- hint revealing computed chance with unfair coin -->
<p>It is <code class="unfair"><var>UNFAIR_COIN_FRACTION_STRING</var> \times <var>UNFAIR_HEADS_DECIMAL_FORMULA</var></code></p>
-
- <!-- hint questioning the fair coin computation -->
+
+ <!-- hint questioning the fair coin computation -->
<p>Now, the other possibility, picking the fair coin and flipping <code class="fair"><var>NUM_FLIPS</var></code> heads is what?</p>
<!-- hint showing the fair coin computation -->
@@ -130,12 +127,9 @@
<!-- hint revealing the answer -->
<p>Add them! So your answer is
- <code class="unfair"><var>UNFAIR_COIN_FRACTION_STRING</var> \times <var>UNFAIR_HEADS_DECIMAL_FORMULA</var></code>
- +
- <code class="fair"><var>FAIR_COIN_FRACTION_STRING</var> \times <var>FAIR_HEADS_DECIMAL_FORMULA</var></code>
- , or
- <code><var>ANSWER</var>
- \%</code>.</p>
+ <code class="unfair"><var>UNFAIR_COIN_FRACTION_STRING</var> \times <var>UNFAIR_HEADS_DECIMAL_FORMULA</var></code>+
+ <code class="fair"><var>FAIR_COIN_FRACTION_STRING</var> \times <var>FAIR_HEADS_DECIMAL_FORMULA</var></code>, or
+ <code><var>ANSWER</var>\%</code>.</p>
</div>
</div>
</body>
@@ -56,14 +56,14 @@
rectchart( [A, B - A], ["#ee0000", "#999"] );
</div>
</div>
-
+
<div>
<p>How many total slices would we need if want the same amount of <var>pizza( 1 )</var> in <var>C</var> slices? </p>
<div class="graph" style="width: 200px; height: 50px;">
rectchart( [C, D - C], ["#ee0000", "#fff"] );
</div>
</div>
-
+
<div>
<p>We would need to cut the <var>pizza( 1 )</var> into <var>D</var> slices.</p>
<div class="graph" style="width: 200px; height: 50px;">
@@ -103,4 +103,4 @@
</div>
</div>
</body>
-</html>
+</html>
@@ -12,10 +12,10 @@
var exp_zero_prob = .2;
var exp_unit_prob = .1;
-
+
var base_negunit_prob = .2;
var base_unit_prob = .05;
- var base_zero_prob = .05;
+ var base_zero_prob = .05;
var r = KhanUtil.random();
if ( r < exp_zero_prob + exp_unit_prob ) {
@@ -11,7 +11,7 @@
var base_neg_prob = .5;
var exp_neg_prob = .75;
var base_rat_prob = .75;
-
+
var base_neg = Math.random() < base_neg_prob;
var base_n = KhanUtil.randRange( 1, 10 );
var base_d;
@@ -20,7 +20,7 @@
<var id="BASE_NEG">isOdd( EXP_D ) && ( random() < .75 )</var>
<var id="BASE_N">VALS.base_1</var>
<var id="BASE_D">VALS.base_2</var>
-
+
<!-- base flipped if the exponent is negative. -->
<var id="BASEF_N">EXP_NEG ? BASE_D : BASE_N</var>
<var id="BASEF_D">EXP_NEG ? BASE_N : BASE_D</var>
@@ -62,24 +62,24 @@
<!-- "=((4/9)^(1/2))^3" -->
<div data-if="EXP_N > 1"><code>= \left(<var>fracParens( BASEF_N, BASEF_D )</var>^{<var>fracSmall( 1, EXP_D )</var>}\right)^{<var>EXP_N</var>}</code></div>
-
+
<!-- "To simplify (4/9)^(1/2), figure out whta goes in the blank: ?^2 = 4/9" -->
<div>To simplify <code><var>fracParens( BASEF_N, BASEF_D )</var>^{<var>fracSmall( 1, EXP_D )</var>}</code>, figure out what goes in the blank:<br /> <code>\left(<span id="expand">?</span>\right)^{<var>abs( EXP_D )</var>}=<var>frac( BASEF_N, BASEF_D )</var></code></div>
<!-- Replace the ? with 2/3 -->
<span id="expand" data-apply="hint-replace">\color{blue}{<var>frac( ROOT_N, ROOT_D )</var>}</span>
-
+
<!-- "So (4/9)^(1/2)." -->
<div>so <code>\quad<var>fracParens( BASEF_N, BASEF_D )</var>^{<var>fracSmall( 1, EXP_D )</var>}=<var>frac( ROOT_N, ROOT_D )</var></code></div>
-
+
<!-- "So (4/9)^(3/2)=((4/9)^(1/2))^3=(2/3)^3" -->
<div data-if="EXP_N > 1">So <code><var>fracParens( BASEF_N, BASEF_D )</var>^{<var>fracSmall( EXP_N, EXP_D )</var>}=\left(<var>fracParens( BASEF_N, BASEF_D )</var>^{<var>fracSmall( 1, EXP_D )</var>}\right)^{<var>EXP_N</var>}=<var>fracParens( ROOT_N, ROOT_D )</var>^{<var>EXP_N</var>}</code></div>
<div data-if="EXP_N > 1 && reduces( ROOT_N, ROOT_D )"><code>= <var>fraction( ROOT_N, ROOT_D, true, true, false, true )</var>^{<var>EXP_N</var>}</code></div>
-
+
<!-- "=(2/3)(2/3)(2/3)" -->
<div data-if="EXP_N > 1"><code>= <var>expandFractionExponent( ROOT_N, ROOT_D, EXP_N )</var></code></div>
-
+
<!-- FIXME: once there is better loop-templating, put dynamic folding hints. -->
<!-- "= 8/27" -->
<div data-if="EXP_N > 1"><code>= <var>frac( SOL_N, SOL_D )</var></code></div>
@@ -89,11 +89,11 @@
</div>
</body>
</html>
-
-
-
-
-
-
+
+
+
+
+
+
@@ -23,21 +23,21 @@
<p id="second">They ate <code>\dfrac{<var>A + B</var>}{<var>TOTAL</var>}</code> of the <var>pizza( 1 )</var>.</p>
</div>
</div>
-
+
<div id="show-left-want-eaten" data-type="show-total-want-eaten">
<p class="question">If there were <var>plural(LEFT, "slice")</var> remaining, what fraction of the pizza was eaten?</p>
<div class="hints" data-apply="appendContents">
<p id="first">Together they ate <var>A + B</var> slices with <var>plural( LEFT, "slice" )</var> remaining, which means they ate <var>A + B</var> out of <var>TOTAL</var> slices.</p>
</div>
</div>
-
+
<div id="show-first-want-eaten" data-type="show-total-want-eaten">
<p class="question">If <var>person( 1 )</var> ate <code>\dfrac{<var>A</var>}{<var>TOTAL</var>}</code> of the <var>pizza( 1 )</var>, what fraction of the pizza was eaten?</p>
<div class="hints" data-apply="appendContents">
<p id="first">If <var>plural( A, "slice")</var> represents <code>\dfrac{<var>A</var>}{<var>TOTAL</var>}</code> of the <var>pizza( 1 )</var>, there must have been a total of <var>TOTAL</var> slices. <var>person( 1 )</var> and <var>person( 2 )</var> together ate <var>A + B</var> out of <var>TOTAL</var> slices.</p>
</div>
</div>
-
+
<div id="show-total-want-left">
<p class="problem"><var>person( 1 )</var> ate <var>plural( A, "slice" )</var> of <var>pizza( 1 )</var>, and <var>person( 2 )</var> ate <var>plural( B, "slice" )</var>.</p>
<p class="question">If there were initially <var>TOTAL</var> slices, what fraction of the <var>pizza( 1 )</var> is remaining?</p>
@@ -47,7 +47,7 @@
<p id="second">There is <code>\dfrac{<var>LEFT</var>}{<var>TOTAL</var>}</code> of the <var>pizza( 1 )</var> remaining.</p>
</div>
</div>
-
+
<div id="show-first-want-left" data-type="show-total-want-left">
<p class="question">If <var>person( 1 )</var> ate <code>\dfrac{<var>A</var>}{<var>TOTAL</var>}</code> of the <var>pizza( 1 )</var>, what fraction of the pizza is remaining?</p>
<div class="hints" data-apply="appendContents">
@@ -57,4 +57,4 @@
</div>
</div>
</body>
-</html>
+</html>
@@ -9,15 +9,15 @@
<div class="vars" data-ensure="INNER.name !== OUTER.name && INNER.minDegree <= INNER.maxDegree && OUTER.minDegree <= OUTER.maxDegree">
<var id="FUNC_NAMES">["f", "g", "h"]</var>
<var id="FUNC_VARIABLES">["x", "n", "t"]</var>
-
+
<var id="INNER">new Polynomial( randRange(0, 2), randRangeWeighted(1, 3, 3, 0.2), null, randFromArray(FUNC_VARIABLES), randFromArray(FUNC_NAMES) )</var>
-
+
<var id="OUTER">new CompositePolynomial( randRange(0, 2), randRangeWeighted(1, 3, 3, 0.2), null, randFromArray(FUNC_VARIABLES), randFromArray(FUNC_NAMES), INNER )</var>
</div>
<div class="problems">
<div>
- <div class="vars">
+ <div class="vars">
<var id="FUNCTIONS">shuffle([INNER, OUTER])</var>
<var id="SOLVE_FOR">shuffle([INNER, OUTER])</var>
@@ -44,7 +44,7 @@
<div>
<div class="vars" data-ensure="OUTER2.name !== INNER.name && OUTER2.name !== OUTER.name && OUTER2.minDegree <= OUTER2.maxDegree">
<var id="OUTER2">new CompositePolynomial( randRange(0, 2), randRange(1, 3), null, randFromArray(FUNC_VARIABLES), randFromArray(FUNC_NAMES), randFromArray([INNER, OUTER]) )</var>
-
+
<var id="FUNCTIONS">shuffle([INNER, OUTER, OUTER2])</var>
<var id="SOLVE_FOR">shuffle([INNER, OUTER, OUTER2])</var>
@@ -74,7 +74,7 @@
<div class="hints">
<p>First, let's solve for the value of the inner function, <code><var>SOLVE_FOR[1].name</var>(<var>VALUE</var>)</var></code>. Then we'll know what to plug into the outer function.</p>
<p><var>SOLVE_FOR[1].hint(VALUE)</var></p>
-
+
<p>Now we know that <code><var>SOLVE_FOR[1].name</var>(<var>VALUE</var>)</var> = <var>INNER_VALUE</var></code>.
Let's solve for <code><var>SOLVE_FOR[0].name</var>(<var>SOLVE_FOR[1].name</var>(<var>VALUE</var>))</code>, which is <code><var>SOLVE_FOR[0].name</var>(<var>INNER_VALUE</var>)</code>.</p>
@@ -28,7 +28,7 @@
<p>Solve for <code><var>UNKNOWN</var></code>. Round to the nearest tenth.</p>
<p>Make sure you select the proper units. You may do arithmetic with a calculator.</p>
</div>
-
+
<div class="solution" data-type="multiple">
<span class="sol" data-type="decimal" data-max-error="0.1"><var>MOTION[UNKNOWN]</var></span>
<span class="sol" data-type="list" data-choices="['', 'm', 'm/s', 'm/s^2', 's']">
Oops, something went wrong. Retry.

0 comments on commit 6371709

Please sign in to comment.