Browse files

<s and things

  • Loading branch information...
1 parent 65eec09 commit f065d79c042a9e7d3100fe640482a30cd2bc2bd6 @spicyj spicyj committed Jan 4, 2012
Showing with 190 additions and 192 deletions.
  1. +3 −3 exercises/adding_and_subtracting_polynomials.html
  2. +1 −1 exercises/addition_1.html
  3. +2 −2 exercises/addition_rule_of_probability.html
  4. +38 −38 exercises/angles_1.html
  5. +28 −28 exercises/angles_2.html
  6. +1 −1 exercises/circumradius.html
  7. +2 −2 exercises/comparing_fractions_1.html
  8. +1 −1 exercises/comparing_fractions_2.html
  9. +3 −3 exercises/compound_inequalities.html
  10. +4 −4 exercises/converting_mixed_numbers_and_improper_fractions.html
  11. +3 −3 exercises/corresponding_angles_2.html
  12. +3 −3 exercises/decimals_on_the_number_line.html
  13. +3 −3 exercises/dependent_probability.html
  14. +1 −1 exercises/division_0.5.html
  15. +1 −1 exercises/division_1.html
  16. +4 −4 exercises/domain_and_range_0.5.html
  17. +3 −3 exercises/equation_of_a_line.html
  18. +3 −3 exercises/even_and_odd_functions.html
  19. +1 −3 exercises/even_and_odd_integers.html
  20. +1 −1 exercises/exponents_2.html
  21. +1 −1 exercises/exponents_3.html
  22. +2 −2 exercises/exponents_4.html
  23. +1 −1 exercises/fractions_on_the_number_line.html
  24. +1 −1 exercises/fractions_on_the_number_line_2.html
  25. +1 −1 exercises/fractions_on_the_number_line_3.html
  26. +5 −5 exercises/functions_1.html
  27. +1 −1 exercises/graphs_of_sine_and_cosine.html
  28. +4 −4 exercises/inverse_trig_functions.html
  29. +5 −5 exercises/kinematic_equations.html
  30. +2 −2 exercises/limits_2.html
  31. +3 −3 exercises/line_relationships.html
  32. +3 −3 exercises/linear_equations_4.html
  33. +1 −1 exercises/mean_median_and_mode.html
  34. +1 −1 exercises/multiplication_0.5.html
  35. +1 −1 exercises/multiplication_1.html
  36. +1 −1 exercises/multiplying_expressions_1.html
  37. +1 −1 exercises/multiplying_fractions_1.html
  38. +1 −1 exercises/multiplying_fractions_word_problems.html
  39. +9 −9 exercises/multiplying_polynomials.html
  40. +2 −2 exercises/quadratic_equation.html
  41. +9 −9 exercises/quadratic_inequalities_1.html
  42. +1 −1 exercises/rate_problems_1.html
  43. +6 −6 exercises/representing_numbers.html
  44. +12 −12 exercises/scaling_vectors.html
  45. +6 −6 exercises/signs_of_a_parabola.html
  46. +3 −3 exercises/slope_of_a_line.html
  47. +1 −1 exercises/subtraction_1.html
View
6 exercises/adding_and_subtracting_polynomials.html
@@ -42,9 +42,9 @@
<var id="NON_ZERO_INDICES">randRangeUniqueNonZero( 0, MAX_DEGREE, randRange(2, 3) ).sort().reverse()</var>
<var id="POL_1, POL_2" data-ensure="POL_1.add( POL_2 ).getNumberOfTerms() >= 1 && POL_1.subtract( POL_2 ).getNumberOfTerms() >= 1">tabulate( function() {
var coefs = [];
- for ( var i = 0; i <= MAX_DEGREE; i++ ) {
+ for ( var i = 0; i &lt;= MAX_DEGREE; i++ ) {
var value = 0;
- for ( var j = 0; j < NON_ZERO_INDICES.length; j++ ) {
+ for ( var j = 0; j &lt; NON_ZERO_INDICES.length; j++ ) {
if ( i === NON_ZERO_INDICES[ j ] ) {
value = randRangeNonZero( -7, 7 );
break;
@@ -103,7 +103,7 @@
</div>
<div>
<p>Identify like terms.</p>
- <p><code><span data-each="[ POL_1, POL_2 ] as POL"><span data-each="NON_ZERO_INDICES as n, index" data-unwrap><var>( POL.coefs[ index ] < 0 ) ? "-" : ( n === 0 && POL === POL_1 ) ? "" : "+"</var>\color{<var>COLORS[ n ]</var>}{<var>abs( POL.coefs[ index ] ) === 1 ? "" : abs( POL.coefs[ index ] )</var><var>X</var>^<var>index</var>}</span></span></code></p>
+ <p><code><span data-each="[ POL_1, POL_2 ] as POL"><span data-each="NON_ZERO_INDICES as n, index" data-unwrap><var>( POL.coefs[ index ] &lt; 0 ) ? "-" : ( n === 0 && POL === POL_1 ) ? "" : "+"</var>\color{<var>COLORS[ n ]</var>}{<var>abs( POL.coefs[ index ] ) === 1 ? "" : abs( POL.coefs[ index ] )</var><var>X</var>^<var>index</var>}</span></span></code></p>
</div>
<div>
View
2 exercises/addition_1.html
@@ -21,7 +21,7 @@
});
label( [0, 0],
- "\\Huge{\\color{#6495ED}{ <var>A</var> } + \\color{#28AE7B}{ <var>B</var> } = {?}}",
+ "\\Huge{\\color{#6495ED}{" + A + "} + \\color{#28AE7B}{" + B + "} = {?}}",
"right" );
</div>
</div>
View
4 exercises/addition_rule_of_probability.html
@@ -57,10 +57,10 @@
( function() {
var optionalPercentage = USEPERCENTAGES ? "% are " : " ";
var qstn = INTRO;
- for (var i=0; i< ORDER.length-1; i++) {
+ for (var i=0; i &lt; ORDER.length-1; i++) {
qstn += (i===ORDER.length-2) ? " and " : "";
qstn += VARVALS[ORDER[i]] + optionalPercentage + VARDESC[ORDER[i]];
- qstn += (i< ORDER.length-2) ? ", " : ". ";
+ qstn += (i &lt; ORDER.length-2) ? ", " : ". ";
}
qstn += QSTNPRETEXT + VARDESC[ORDER[ORDER.length-1]] + QSTNPOSTTEXT;
return qstn;
View
76 exercises/angles_1.html
@@ -88,23 +88,23 @@
// Label the given angles
if( RAND3 == 0 ) {
- label( [0.5, 1.8], "\\color{green}{<var>ACCUTEANGLE</var>&deg;}",
+ label( [0.5, 1.8], "\\color{green}{" + ACCUTEANGLE + "&deg;}",
"above" );
arc( [0, 0], 1.2, 70, 90, { stroke: "green" } );
ORIGINAL_LABEL = label( [-1.2, -0.75],
"\\color{blue}{\\angle{AGF}}= {?}", "below left" );
arc( [0, 0], 1.2, 180, 248, { stroke: "blue" } );
} else if ( RAND3 == 1 ) {
- label( [-1.2, -0.75], "\\color{green}{<var>90-ACCUTEANGLE</var>&deg;}",
+ label( [-1.2, -0.75], "\\color{green}{" + (90-ACCUTEANGLE) + "&deg;}",
"below left" );
arc( [0, 0], 1.2, 180, 248, { stroke: "green" } );
ORIGINAL_LABEL = label( [0.5, 1.8],
"\\color{blue}{\\angle{CGE}} = {?}", "above" );
arc( [0, 0], 1.2, 70, 90, { stroke: "blue" } );
} else {
- label( [0, -2], "\\color{green}{<var>ACCUTEANGLE</var>&deg;}",
+ label( [0, -2], "\\color{green}{" + ACCUTEANGLE + "&deg;}",
"below left" );
arc( [0, 0], 1.2, 248, 270, { stroke: "green" } );
@@ -138,7 +138,7 @@
because they are opposite angles from each other. Opposite angles
are congruent (equal).
<span class="graphie" data-update="complementary-and-opposite">
- label( [1.2, 0], "\\color{orange}{<var>90 - ACCUTEANGLE</var>&deg;}",
+ label( [1.2, 0], "\\color{orange}{" + (90 - ACCUTEANGLE) + "&deg;}",
"above right" );
arc( [0, 0], 1.2, 0, 68, { stroke: "orange" } );
</span>
@@ -157,7 +157,7 @@
<code>\color{orange}{\angle{EGB}} = \color{purple}{90&deg;}
- \color{green}{\angle{CGE}} = <var>90 - ACCUTEANGLE</var>&deg;</code>
<span class="graphie" data-update="complementary-and-opposite">
- label( [1.2, 0], "\\color{orange}{<var>90 - ACCUTEANGLE</var>&deg;}",
+ label( [1.2, 0], "\\color{orange}{" + (90 - ACCUTEANGLE) + "&deg;}",
"above right" );
arc( [0, 0], 1.2, 0, 68, { stroke: "orange" } );
</span>
@@ -176,7 +176,7 @@
\color{purple}{90&deg;} - \color{green}{\angle{DGF}} =
<var>90 - ACCUTEANGLE</var>&deg;</code>
<span class="graphie" data-update="complementary-and-opposite">
- label( [-1.2, 0], "\\color{orange}{<var>90 - ACCUTEANGLE</var>&deg;}",
+ label( [-1.2, 0], "\\color{orange}{" + 90 - ACCUTEANGLE + "&deg;}",
@beneater
Khan Academy member
beneater added a line comment Mar 14, 2013

nope

@spicyj
Khan Academy member
spicyj added a line comment Mar 14, 2013

eh?

@beneater
Khan Academy member
beneater added a line comment Mar 14, 2013

image

@cbhl
cbhl added a line comment Mar 14, 2013

I don't even -- this is a year old commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
"below left" );
arc( [0, 0], 1.2, 180, 248, { stroke: "orange" } );
</span>
@@ -190,7 +190,7 @@
<span class="graphie" data-update="complementary-and-opposite">
ORIGINAL_LABEL.remove();
label( [-1.2, -0.75],
- "\\color{blue}{\\angle{AGF}}=<var>90 - ACCUTEANGLE</var>&deg;",
+ "\\color{blue}{\\angle{AGF}}=" + (90 - ACCUTEANGLE) + "&deg;",
"below left" );
</span>
</p>
@@ -202,7 +202,7 @@
<span class="graphie" data-update="complementary-and-opposite">
ORIGINAL_LABEL.remove();
label( [0.5, 1.8],
- "\\color{blue}{\\angle{CGE}} = <var>ACCUTEANGLE</var>&deg;",
+ "\\color{blue}{\\angle{CGE}} = " + ACCUTEANGLE + "&deg;",
"above" )
</span>
</p>
@@ -214,7 +214,7 @@
<span class="graphie" data-update="complementary-and-opposite">
ORIGINAL_LABEL.remove();
label( [1.5, 0],
- "\\color{blue}{\\angle{BGE}} = <var>90 - ACCUTEANGLE</var>&deg;",
+ "\\color{blue}{\\angle{BGE}} = " + (90 - ACCUTEANGLE) + "&deg;",
"above right" );
</span>
</p>
@@ -273,23 +273,23 @@
// Label the angles acording to variation
if( RAND2 == 0 ) {
- label( [3, -2], "\\color{green}{<var>Tri_Y</var>&deg;}",
+ label( [3, -2], "\\color{green}{" + Tri_Y + "&deg;}",
"above left" );
arc( [4, -2], 1.2, 130, 180, { stroke: "green" } );
- label( [0, 1.5], "\\color{purple}{<var>Tri_Z</var>&deg;}",
+ label( [0, 1.5], "\\color{purple}{" + Tri_Z + "&deg;}",
"below" );
arc( [0, 3], 1.5, 230, 310, { stroke: "purple" } );
ORIGINAL_LABEL = label( [-4.7, -2], "\\color{blue}{\\angle{DAB}}= {?}",
"above left" );
arc( [-4, -2], .75, 50, 180, { stroke: "blue" } );
} else {
- label( [-4.7, -2], "\\color{green}{<var>180 - Tri_X</var>&deg;}",
+ label( [-4.7, -2], "\\color{green}{" + (180 - Tri_X) + "&deg;}",
"above left" );
arc( [-4, -2], .75, 50, 180, { stroke: "green" } );
- label( [0, 1.5], "\\color{purple}{<var>Tri_Z</var>&deg;}",
+ label( [0, 1.5], "\\color{purple}{" + Tri_Z + "&deg;}",
"below" );
arc( [0, 3], 1.5, 230, 310, { stroke: "purple" } );
@@ -317,7 +317,7 @@
</code>,
This is because angles inside a triangle add up to 180 degrees.
<span class="graphie" data-update="supplementary-and-triangle">
- label( [-3.3, -2], "\\color{orange}{<var>Tri_X</var>&deg;}",
+ label( [-3.3, -2], "\\color{orange}{" + Tri_X + "&deg;}",
"above right" );
arc( [-4, -2], 0.75, 0, 49, {stroke: "orange"} );
</span>
@@ -331,7 +331,7 @@
because supplementary angles along a line add up to
180 degrees.
<span class="graphie" data-update="supplementary-and-triangle">
- label( [-3.3, -2], "\\color{orange}{<var>Tri_X</var>&deg;}",
+ label( [-3.3, -2], "\\color{orange}{" + Tri_X + "&deg;}",
"above right" );
arc( [-4, -2], 0.75, 0, 49, {stroke: "orange"} );
</span>
@@ -347,7 +347,7 @@
<span class="graphie" data-update="supplementary-and-triangle">
ORIGINAL_LABEL.remove();
label( [-4.7, -2],
- "\\color{blue}{\\angle{DAB}} = <var>Tri_Y + Tri_Z</var>&deg;",
+ "\\color{blue}{\\angle{DAB}} = " + (Tri_Y + Tri_Z) + "&deg;",
"above left" );
</span>
@@ -362,7 +362,7 @@
<span class="graphie" data-update="supplementary-and-triangle">
ORIGINAL_LABEL.remove();
label( [2.80, -2],
- "\\color{blue}{\\angle{ACB}} = <var>Tri_Y</var>&deg;",
+ "\\color{blue}{\\angle{ACB}} = " + Tri_Y + "&deg;",
"above left" );
</span>
</p>
@@ -446,32 +446,32 @@
"\\color{blue}{\\angle{AIH}} = {?}", "left" );
arc( [1.25, -3], .75, 135, 190, {stroke: "blue"} );
- label( [-4.2, 4.25], "\\color{green}{<var>Tri_Z</var>&deg;}", "below" );
+ label( [-4.2, 4.25], "\\color{green}{" + Tri_Z + "&deg;}", "below" );
arc( [-4.47, 5.25], 1, 255, 330, {stroke: "green"} );
- label( [-5.5, -3.5], "\\color{purple}{<var>Tri_X</var>&deg;}",
+ label( [-5.5, -3.5], "\\color{purple}{" + Tri_X + "&deg;}",
"above right" );
arc( [-6, -4], 1, 10, 80, {stroke: "purple"} );
} else if( RAND3 == 1 ) {
ORIGINAL_LABEL = label( [3.5, -2.6],
"\\color{blue}{\\angle{AKJ}} = {?}", "above" );
arc( [5.7, -2.3], 0.75, 139, 194, {stroke: "blue"} );
- label( [-4.4, 0.65], "\\color{green}{<var>Tri_Z</var>&deg;}", "below" );
+ label( [-4.4, 0.65], "\\color{green}{" + Tri_Z + "&deg;}", "below" );
arc( [-5.07, 1.75], 1, 257, 326, {stroke: "green"} );
- label( [-5.5, -3.5], "\\color{purple}{<var>Tri_X</var>&deg;}",
+ label( [-5.5, -3.5], "\\color{purple}{" + Tri_X + "&deg;}",
"above right" );
arc( [-6, -4], 1, 10, 80, {stroke: "purple"} );
} else {
ORIGINAL_LABEL = label( [-5.5, -3.5],
"\\color{blue}{\\angle{BAC}} = {?}", "above right" );
arc( [-6, -4], 1, 10, 80, {stroke: "blue"} );
- label( [4.1, -2.6], "\\color{purple}{<var>Tri_Y</var>&deg;}", "above" );
+ label( [4.1, -2.6], "\\color{purple}{" + Tri_Y + "&deg;}", "above" );
arc( [5.7, -2.3], 0.75, 139, 194, {stroke: "purple"} );
- label( [-4.4, 0.65], "\\color{green}{<var>Tri_Z</var>&deg;}", "below" );
+ label( [-4.4, 0.65], "\\color{green}{" + Tri_Z + "&deg;}", "below" );
arc( [-5.07, 1.75], 1, 257, 326, {stroke: "green"} );
}
@@ -491,7 +491,7 @@
because they are corresponding angles formed by 2 parallel lines and
a transversal line. Corresponding angles are congruent (equal).
<span class="graphie" data-update="parallel-and-triangle">
- label( [-4.60, 0.75], "\\color{orange}{<var>Tri_Z</var>&deg;}",
+ label( [-4.60, 0.75], "\\color{orange}{" + Tri_Z + "&deg;}",
"below" );
arc( [-5.07, 1.75], 1, 260, 325, {stroke: "orange"} );
</span>
@@ -501,7 +501,7 @@
because they are corresponding angles formed by 2 parallel lines and
a transversal line. Corresponding angles are congruent (equal).
<span class="graphie" data-update="parallel-and-triangle">
- label( [-4.00, 4.25], "\\color{orange}{<var>Tri_Z</var>&deg;}",
+ label( [-4.00, 4.25], "\\color{orange}{" + Tri_Z + "&deg;}",
"below" );
arc( [-4.47, 5.25], 1, 257, 325, {stroke: "orange"} );
</span>
@@ -519,7 +519,7 @@
<span class="graphie" data-update="parallel-and-triangle">
ORIGINAL_LABEL.remove();
label( [0, -2.50],
- "\\color{blue}{\\angle{AIH}} = <var>180 - Tri_X - Tri_Z</var>&deg;",
+ "\\color{blue}{\\angle{AIH}} = " + (180 - Tri_X - Tri_Z) + "&deg;",
"left" );
</span>
</p>
@@ -528,11 +528,11 @@
ORIGINAL_LABEL.remove();
if ( RAND3 === 1 ) {
label( [3.3, -2.6],
- "\\color{blue}{\\angle{AKJ}} = <var>Tri_Y</var>&deg;",
+ "\\color{blue}{\\angle{AKJ}} = " + Tri_Y + "&deg;",
"above" );
} else {
label( [-5.5, -3.5],
- "\\color{blue}{\\angle{BAC}} = <var>Tri_X</var>&deg;",
+ "\\color{blue}{\\angle{BAC}} = " + Tri_X + "&deg;",
"above right" );
}
</span>
@@ -617,11 +617,11 @@
"\\color{blue}{\\angle{IAK}} = {?}", "above left" );
arc( [0, 2], 1, 90, 135, {stroke:"blue"} );
- label( [4.75, -2], "\\color{green}{<var>Tri_Y</var>&deg;}",
+ label( [4.75, -2], "\\color{green}{" + Tri_Y + "&deg;}",
"below right" );
arc( [4, -2], .75, 315, 360, {stroke: "green"} );
} else {
- label( [0, 3], "\\color{green}{<var>Tri_Y</var>&deg;}", "above left" );
+ label( [0, 3], "\\color{green}{" + Tri_Y + "&deg;}", "above left" );
arc( [0, 2], 1, 90, 135, {stroke:"green"} );
ORIGINAL_LABEL = label( [4.75, -2],
@@ -643,18 +643,18 @@
because they are alternate exterior angles, formed by 2 parallel lines
and a transversal line, they are congruent (equal).
<span class="graphie" data-update="alternate-exterior-and-complementary">
- label( [-.80, 2], "\\color{orange}{<var>Tri_Y</var>&deg;}",
+ label( [-.80, 2], "\\color{orange}{" + Tri_Y + "&deg;}",
"above left" );
arc( [0, 2], 1, 135, 180, {stroke: "orange"} );
</span>
Alternatively, you can pair up using opposite angles and alternate interior
angles to achieve the same result (as seen using
<code>\color{pink}{pink}</code>).
<span class="graphie" data-update="alternate-exterior-and-complementary">
- label( [1, 2], "\\color{pink}{<var>Tri_Y</var>&deg;}",
+ label( [1, 2], "\\color{pink}{" + Tri_Y + "&deg;}",
"below right" );
arc( [0, 2], 1, 315, 360, {stroke: "pink"} );
- label( [3, -2], "\\color{pink}{<var>Tri_Y</var>&deg;}",
+ label( [3, -2], "\\color{pink}{" + Tri_Y + "&deg;}",
"above left" );
arc( [4, -2], 1, 135, 180, {stroke: "pink"} );
</span>
@@ -678,7 +678,7 @@
<span class="graphie" data-update="alternate-exterior-and-complementary">
ORIGINAL_LABEL.remove();
label( [0, 3.5],
- "\\color{blue}{\\angle{IAK}} = <var>90 - Tri_Y</var>&deg;",
+ "\\color{blue}{\\angle{IAK}} = " + (90 - Tri_Y) + "&deg;",
"above left" );
</span>
</p>
@@ -690,7 +690,7 @@
and <code>\color{orange}{\angle{DAI}}</code>, make up angle
<code>\color{purple}{\angle{DAK}}</code>.
<span class="graphie" data-update="alternate-exterior-and-complementary">
- label( [-.80, 2], "\\color{orange}{<var>90-Tri_Y</var>&deg;}",
+ label( [-.80, 2], "\\color{orange}{" + (90-Tri_Y) + "&deg;}",
"above left" );
arc( [0, 2], 1, 135, 180, {stroke: "orange"} );
</span>
@@ -706,16 +706,16 @@
angles to achieve the same result (as seen using
<code>\color{pink}{pink}</code>).
<span class="graphie" data-update="alternate-exterior-and-complementary">
- label( [1, 2], "\\color{pink}{<var>90-Tri_Y</var>&deg;}",
+ label( [1, 2], "\\color{pink}{" + (90-Tri_Y) + "&deg;}",
"below right" );
arc( [0, 2], 1, 315, 360, {stroke: "pink"} );
- label( [3, -2], "\\color{pink}{<var>90-Tri_Y</var>&deg;}",
+ label( [3, -2], "\\color{pink}{" + (90-Tri_Y) + "&deg;}",
"above left" );
arc( [4, -2], 1, 135, 180, {stroke: "pink"} );
ORIGINAL_LABEL.remove();
label( [4.75, -2],
- "\\color{blue}{\\angle{GCJ} = <var>90-Tri_Y</var>&deg;}",
+ "\\color{blue}{\\angle{GCJ} = " + (90-Tri_Y) + "&deg;}",
"below right" );
</span>
</p>
View
56 exercises/angles_2.html
@@ -74,12 +74,12 @@
// label angle ABC
arc([-4,3], .75, 312, 360, { stroke: "green" });
- label([-3.2, 3], "\\color{green}{<var>Tri_Y</var>&deg;}",
+ label([-3.2, 3], "\\color{green}{" + Tri_Y + "&deg;}",
"below right", {color: "green"});
// label angle BAC
arc([-1.3,0], .75, 38, 125, { stroke: "purple" });
- label([-1.3, .7], "\\color{purple}{<var>Tri_Z</var>&deg;}",
+ label([-1.3, .7], "\\color{purple}{" + Tri_Z + "&deg;}",
"above", {color: "purple"});
// Label X according to problem variation
@@ -112,7 +112,7 @@
<span class="graphie" data-update="tri-and-parallel">
// label angle BAC
arc([2.5, 3], .75, 180, 220, { stroke: "orange" });
- label([1.8, 3], "\\color{orange}{<var>Tri_X</var>&deg;}",
+ label([1.8, 3], "\\color{orange}{" + Tri_X + "&deg;}",
"below left", {color: "orange"});
</span>
</p>
@@ -124,7 +124,7 @@
<span class="graphie" data-update="tri-and-parallel">
LABEL.remove();
LABEL = label([-3.3, 0],
- "\\color{blue}{\\angle{DAF}}=<var>Tri_X</var>&deg;",
+ "\\color{blue}{\\angle{DAF}}=" + Tri_X + "&deg;",
"below");
</span>
</span>
@@ -134,7 +134,7 @@
<span class="graphie" data-update="tri-and-parallel">
LABEL.remove();
LABEL = label([1, 0],
- "\\color{blue}{&ang;CAE} = <var>Tri_X</var>&deg;",
+ "\\color{blue}{&ang;CAE} = " + Tri_X + "&deg;",
"above", { color: "blue"});
</span>
</span>
@@ -223,15 +223,15 @@
// label angle Y
if(RAND_SWITCH3 == 0) {
arc([1.2, 2], 1.5, 0, 50, { stroke: "purple" });
- label([3.1, 2], "\\color{purple}{\\angle{EGB}}=<var>X</var>&deg;",
+ label([3.1, 2], "\\color{purple}{\\angle{EGB}}=" + X + "&deg;",
"above right");
} else if (RAND_SWITCH3 == 1) {
arc([1.2, 2], 1.5, 180, 220, { stroke: "purple" });
- label([-1, 2], "\\color{purple}{\\angle{AGH}}=<var>X</var>&deg;",
+ label([-1, 2], "\\color{purple}{\\angle{AGH}}=" + X + "&deg;",
"below left");
} else {
arc([1.2, 2], 1, 220, 0, { stroke: "purple" });
- label([1.5, 1.2], "\\color{purple}{\\angle{BGH}}=<var>180 - X</var>&deg;",
+ label([1.5, 1.2], "\\color{purple}{\\angle{BGH}}=" + (180 - X) + "&deg;",
"below right");
}
</div>
@@ -254,7 +254,7 @@
because opposite angles are equal.
<span class="graphie" data-update="opposite-parallel">
arc([1,2], .88, 180, 225, {stroke:"orange"});
- label([0,2], "\\color{orange}{<var>X</var>&deg;}", "below left");
+ label([0,2], "\\color{orange}{" + X + "&deg;}", "below left");
</span>
</p>
<p data-else-if="RAND_COMBO === 10">
@@ -275,7 +275,7 @@
because angles along a line plane add up to 180&deg;.
<span class="graphie" data-update="opposite-parallel">
arc([1,2], .88, 180, 225, {stroke:"orange"});
- label([0,2], "\\color{orange}{<var>X</var>&deg;}", "below left");
+ label([0,2], "\\color{orange}{" + X + "&deg;}", "below left");
</span>
</p>
<p data-if="RAND_COMBO == 20">
@@ -294,15 +294,15 @@
<code>\angle{GHD} = <var>X</var>&deg;</code>
<span class="graphie" data-update="opposite-parallel">
LABEL.remove();
- label([-2, -2], "\\color{blue}{\\angle{GHD}}=<var>X</var>&deg;",
+ label([-2, -2], "\\color{blue}{\\angle{GHD}}=" + X + "&deg;",
"above right");
</span>
</span>
<span data-else>
<code>\angle{CHF} = <var>X</var>&deg;</code>
<span class="graphie" data-update="opposite-parallel">
LABEL.remove();
- label([-4, -2.5], "\\color{blue}{\\angle{CHF}}=<var>X</var>&deg;",
+ label([-4, -2.5], "\\color{blue}{\\angle{CHF}}=" + X + "&deg;",
"below left");
</span>
</span>.
@@ -363,10 +363,10 @@
label([-3.2, 1.3], "J", "below left");
// Label the given angles
- label([-5.5, -5.2], "\\color{green}{<var>Tri1_Y</var>&deg;}",
+ label([-5.5, -5.2], "\\color{green}{" + Tri1_Y + "&deg;}",
"above right");
arc([-6, -6], 1.3, 40, 71, { stroke: "green" });
- label([0, 7.4], "\\color{orange}{<var>Tri1_X</var>&deg;}",
+ label([0, 7.4], "\\color{orange}{" + Tri1_X + "&deg;}",
"below");
arc([0, 9], 1.3, 245, 290, { stroke: "orange" });
@@ -403,7 +403,7 @@
<span class="graphie" data-update="star1">
// label angle BHD
arc([3.2, 1.3], .75, 118, 220, { stroke: "purple" });
- label([2.6, 2], "\\color{purple}{<var>Tri1_Z</var>^\\circ}",
+ label([2.6, 2], "\\color{purple}{" + Tri1_Z + "^\\circ}",
"below left");
</span>
</p>
@@ -416,7 +416,7 @@
<span class="graphie" data-update="star1">
LABEL.remove();
label([4.8, 1.0],
- "\\color{blue}{\\angle{CHE}}=<var>Tri1_Z</var>^\\circ",
+ "\\color{blue}{\\angle{CHE}}=" + Tri1_Z + "^\\circ",
"right");
</span>
</div>
@@ -438,7 +438,7 @@
<span class="graphie" data-update="star1">
LABEL.remove();
label([4, 2.5],
- "\\color{blue}{\\angle{GHC}}=<var>180 - Tri1_Z</var>^\\circ",
+ "\\color{blue}{\\angle{GHC}}=" + (180 - Tri1_Z) + "^\\circ",
"above");
</span>
</span>
@@ -447,7 +447,7 @@
<span class="graphie" data-update="star1">
LABEL.remove();
label([2.5, -0.5],
- "\\color{blue}{\\angle{DHE}}=<var>180 - Tri1_Z</var>^\\circ",
+ "\\color{blue}{\\angle{DHE}}=" + (180 - Tri1_Z) + "^\\circ",
"below");
</span>
</span>
@@ -509,10 +509,10 @@
// Label Angles and X according to variation
if( RAND_SWITCH2 == 0) {
// Label the given angles
- label([-5.5, -5.2], "\\color{green}{<var>Tri2_Y</var>&deg;}",
+ label([-5.5, -5.2], "\\color{green}{" + Tri2_Y + "&deg;}",
"above right");
arc([-6, -6], 1.3, 40, 71, { stroke: "green" });
- label([0, -.2], "\\color{orange}{<var>180 - Tri2_Z</var>&deg;}",
+ label([0, -.2], "\\color{orange}{" + (180 - Tri2_Z) + "&deg;}",
"above");
arc([0, -1], 1, 28, 152, { stroke: "orange" });
@@ -521,10 +521,10 @@
arc([-3.2, 1.3], 1, 65, 142, { stroke: "blue" });
} else {
// Label the given angles
- label([6.5, 5], "\\color{green}{<var>Tri2_Y</var>&deg;}",
+ label([6.5, 5], "\\color{green}{" + Tri2_Y + "&deg;}",
"below left");
arc([8, 5], 1.3, 180, 220, { stroke: "green" });
- label([1.3, 4.5], "\\color{orange}{<var>180 - Tri2_Z</var>&deg;}",
+ label([1.3, 4.5], "\\color{orange}{" + (180 - Tri2_Z) + "&deg;}",
"below left");
arc([1.6, 5], 0.75, 180, 289, { stroke: "orange" });
@@ -549,7 +549,7 @@
<span class="graphie" data-update="star2">
// label angle JID
arc([0, -1.2], .75, 143, 220, { stroke: "purple" });
- label([-.75, -1.2], "\\color{purple}{<var>Tri2_Z</var>&deg;}",
+ label([-.75, -1.2], "\\color{purple}{" + Tri2_Z + "&deg;}",
"left");
</span>
</p>
@@ -559,7 +559,7 @@
<span class="graphie" data-update="star2">
// label angle HGC
arc([1.8, 5], 1, 280, 0, { stroke: "purple" });
- label([2.5, 4.3], "\\color{purple}{<var>Tri2_Z</var>&deg;}",
+ label([2.5, 4.3], "\\color{purple}{" + Tri2_Z + "&deg;}",
"below right");
</span>
</p>
@@ -571,7 +571,7 @@
<span class="graphie" data-update="star2">
// label angle JID
arc([-3.2, 1.3], .75, 260, 320, { stroke: "teal" });
- label([-3.2, 0.50], "\\color{teal}{<var>Tri2_X</var>&deg;}",
+ label([-3.2, 0.50], "\\color{teal}{" + Tri2_X + "&deg;}",
"below right");
</span>
</p>
@@ -582,7 +582,7 @@
<span class="graphie" data-update="star2">
// label angle CHG
arc([3.2, 1.3], .75, 38, 120, { stroke: "teal" });
- label([3.4, 1.78], "\\color{teal}{<var>Tri2_X</var>&deg;}",
+ label([3.4, 1.78], "\\color{teal}{" + Tri2_X + "&deg;}",
"above");
</span>
</p>
@@ -604,15 +604,15 @@
<span class="graphie" data-update="star2">
LABEL.remove();
label([-3.7, 2.5],
- "\\color{blue}{\\angle{AJF}}=<var>Tri2_X</var>&deg;", "above");
+ "\\color{blue}{\\angle{AJF}}=" + Tri2_X + "&deg;", "above");
</span>
</span>
<span data-else>
<code>\angle{IHE} = <var>Tri2_X</var>&deg;</code>
<span class="graphie" data-update="star2">
LABEL.remove();
label([4.0, -0.3],
- "\\color{blue}{\\angle{IHE}}=<var>Tri2_X</var>&deg;",
+ "\\color{blue}{\\angle{IHE}}=" + Tri2_X + "&deg;",
"below left");
</span>
</span>.
View
2 exercises/circumradius.html
@@ -15,7 +15,7 @@
<div class="vars">
<var id="ANGLES" data-ensure="ANGLES[ 0 ] % 2 == 0">randomTriangleAngles.triangle()</var>
<var id="CIRCUMLENGTH"></var>
- <var id="BD"</var>
+ <var id="BD"></var>
<var id="AC"></var>
<var id="CD"></var>
</div>
View
4 exercises/comparing_fractions_1.html
@@ -21,7 +21,7 @@
<var id="DEN_2">randRange( NUM_2 + 1, 15 )</var>
<var id="SOLUTION">(function() {
- if ( DEN_1 < DEN_2 ) {
+ if ( DEN_1 &lt; DEN_2 ) {
return "&gt;";
} else {
return "&lt;";
@@ -75,7 +75,7 @@
<var id="NUM_2">randRange( 1, DEN_2 - 1 )</var>
<var id="SOLUTION">(function() {
- if ( NUM_1 < NUM_2 ) {
+ if ( NUM_1 &lt; NUM_2 ) {
return "&lt;";
} else {
return "&gt;";
View
2 exercises/comparing_fractions_2.html
@@ -30,7 +30,7 @@
<var id="SOLUTION">(function() {
var f1 = NUM_1 / DEN_1;
var f2 = NUM_2 / DEN_2;
- if ( f1 < f2 ) {
+ if ( f1 &lt; f2 ) {
return "&lt;";
} else if ( f1 > f2 ) {
return "&gt;";
View
6 exercises/compound_inequalities.html
@@ -57,7 +57,7 @@
<var id="LESS_THAN">tabulate( function(i) {
return COMP_SOLUTION[i] === "&le;" || COMP_SOLUTION[i] === "&lt;";
}, 2 )</var>
- <var id="ALL_NUMBERS">( LESS_THAN[0] && !LESS_THAN[1] && SOLUTION[0] >= SOLUTION [1] ) || ( !LESS_THAN[0] && LESS_THAN[1] && SOLUTION[0] <= SOLUTION [1] )</var>
+ <var id="ALL_NUMBERS">( LESS_THAN[0] && !LESS_THAN[1] && SOLUTION[0] >= SOLUTION [1] ) || ( !LESS_THAN[0] && LESS_THAN[1] && SOLUTION[0] &lt;= SOLUTION [1] )</var>
<var id="NO_SOLUTION">( LESS_THAN[0] && !LESS_THAN[1] && SOLUTION[1] > SOLUTION[0] ) || ( !LESS_THAN[0] && LESS_THAN[1] && SOLUTION[0] > SOLUTION[1] ) || ( LESS_THAN[0] !== LESS_THAN[1] && SOLUTION[0] === SOLUTION[1] && ( !INCLUSIVE[0] || !INCLUSIVE[1] ) )</var>
<var id="OR">randFromArray([ "or", "and" ])</var>
<var id="IS_OR">OR === "or"</var>
@@ -74,7 +74,7 @@
if ( SOLUTION[0] === SOLUTION[1] ) {
return INCLUSIVE[0] ? 1 : 2;
}
- return SOLUTION[0] < SOLUTION[1] ? 1 : 2;
+ return SOLUTION[0] &lt; SOLUTION[1] ? 1 : 2;
}
return 0;
@@ -144,7 +144,7 @@
// Draw both inequalities
var y_placement = [ 0.05, -0.05 ];
- for ( var i = 0; i < 2; i++ ) {
+ for ( var i = 0; i &lt; 2; i++ ) {
style({ stroke: COLOR[i], fill: COLOR[i], strokeWidth: 3.5, arrows: "->" });
path([ [ SOLUTION[i] + 0.15 * ( LESS_THAN[i] ? -1 : 1 ), y_placement[i] ], [ LESS_THAN[i] ? start : end, y_placement[i] ] ]);
style({ stroke: COLOR[i], fill: INCLUSIVE[i] ? COLOR[i] : null });
View
8 exercises/converting_mixed_numbers_and_improper_fractions.html
@@ -35,7 +35,7 @@
<div class="graphie">
init({ range: [ [0, 1], [0, WHOLE] ], scale: [250, 25] });
- for ( var y = 0; y < WHOLE; y++ ) {
+ for ( var y = 0; y &lt; WHOLE; y++ ) {
rectchart( [M_REDUCED_DENOM, 0], ["#28AE7B", "#999"], y );
}
</div>
@@ -54,7 +54,7 @@
<div class="graphie">
init({ range: [ [0, 1], [0, WHOLE + 1] ], scale: [250, 25] });
- for ( var y = 1; y <= WHOLE; y++ ) {
+ for ( var y = 1; y &lt;= WHOLE; y++ ) {
rectchart( [M_REDUCED_DENOM, 0], ["#28AE7B", "#999"], y );
}
@@ -79,7 +79,7 @@
<div class="graphie">
init({ range: [ [0, 1], [0, WHOLE] ], scale: [250, 25] });
- for ( var y = 0; y < WHOLE; y++ ) {
+ for ( var y = 0; y &lt; WHOLE; y++ ) {
rectchart( [M_REDUCED_DENOM, 0], ["#FFA500", "#999"], y );
}
</div>
@@ -89,7 +89,7 @@
<div class="graphie">
init({ range: [ [0, 1], [0, WHOLE + 1] ], scale: [250, 25] });
- for ( var y = 1; y <= WHOLE; y++ ) {
+ for ( var y = 1; y &lt;= WHOLE; y++ ) {
rectchart( [M_REDUCED_DENOM, 0], ["#FFA500", "#999"], y );
}
View
6 exercises/corresponding_angles_2.html
@@ -8,12 +8,12 @@
<body>
<div class="exercise">
<div class="vars">
- <var data-ensure="A * SOLUTION + B > 30 && A * SOLUTION + B < 150 && C !== A && abs( A - C ) < 6 && abs( A - C ) > 1 && A * SOLUTION + B - C * SOLUTION !== 0">
- <var id="SOLUTION" data-ensure="abs(SOLUTION) > 5">randRangeNonZero( -20, 20 )</var>
+ <div data-ensure="A * SOLUTION + B &gt; 30 && A * SOLUTION + B &lt; 150 && C !== A && abs( A - C ) &lt; 6 && abs( A - C ) &gt; 1 && A * SOLUTION + B - C * SOLUTION !== 0">
+ <var id="SOLUTION" data-ensure="abs(SOLUTION) &gt; 5">randRangeNonZero( -20, 20 )</var>
<var id="A">randRange( 2, 8 )</var>
<var id="B">randRangeNonZero( -200, 200 )</var>
<var id="C">randRange( 2, 9 )</var>
- </var>
+ </div>
<var id="D">A * SOLUTION + B - C * SOLUTION</var>
<var id="ANCHOR">(A*D-B*C) / (A-C)</var>
View
6 exercises/decimals_on_the_number_line.html
@@ -12,19 +12,19 @@
<var id="NUMBER">( randRange( -300, 300 ) / 100 )</var>
<var id="WRONGS">( function() {
var pos = rand( 5 );
- while( NUMBER - (0.47 * pos) < -3 ){
+ while( NUMBER - (0.47 * pos) &lt; -3 ){
pos--;
}
while( NUMBER + 0.47 * (5 - pos) > 3 ){
pos++;
}
arr = [];
- for ( i = 0; i < pos; i++){
+ for ( i = 0; i &lt; pos; i++){
arr.push( NUMBER - ((pos - i) * 0.47))
}
arr.push( NUMBER );
- for ( i = pos + 1; i < 5; i++ ){
+ for ( i = pos + 1; i &lt; 5; i++ ){
arr.push( NUMBER + (( i - pos) * 0.47))
}
return arr;
View
6 exercises/dependent_probability.html
@@ -51,7 +51,7 @@
<var id="UNFAIR_HEADS_DECIMAL_FORMULA">
(function() {
var uhdf = DECIMAL_CHANCE_UNFAIR_HEADS.toString()
- for (var i = 0; i < NUM_FLIPS - 1; i++) {
+ for (var i = 0; i &lt; NUM_FLIPS - 1; i++) {
uhdf += " \\times " + DECIMAL_CHANCE_UNFAIR_HEADS;
}
return uhdf;
@@ -60,7 +60,7 @@
<var id="UNFAIR_HEADS_PERCENT_FORMULA">
(function() {
var uhpf = PERCENT_CHANCE_UNFAIR_HEADS + "\\%";
- for (var i = 0; i < NUM_FLIPS - 1; i++) {
+ for (var i = 0; i &lt; NUM_FLIPS - 1; i++) {
uhpf += " \\times " + PERCENT_CHANCE_UNFAIR_HEADS + "\\%";
}
return uhpf;
@@ -70,7 +70,7 @@
<var id="FAIR_HEADS_DECIMAL_FORMULA">
(function() {
var fhdf = DECIMAL_CHANCE_FAIR_HEADS.toString();
- for (var i = 0; i < NUM_FLIPS - 1; i++) {
+ for (var i = 0; i &lt; NUM_FLIPS - 1; i++) {
fhdf += " \\times " + DECIMAL_CHANCE_FAIR_HEADS;
}
return fhdf;
View
2 exercises/division_0.5.html
@@ -23,7 +23,7 @@
});
KhanUtil.currentGraph.labelHolder = label( [ 0, A ],
- "\\Huge{\\color{#6495ED}{ <var>C</var> } \\div \\color{#FFA500}{ <var>B</var> } = {?}}", "right" );
+ "\\Huge{\\color{#6495ED}{" + C + "} \\div \\color{#FFA500}{" + B + "} = {?}}", "right" );
</div>
<div class="solution" data-forms="integer"><var>A</var></div>
</div>
View
2 exercises/division_1.html
@@ -23,7 +23,7 @@
});
KhanUtil.currentGraph.labelHolder = label( [ 0, A ],
- "\\Huge{\\color{#6495ED}{ <var>C</var> } \\div \\color{#FFA500}{ <var>B</var> } = {?}}", "right" );
+ "\\Huge{\\color{#6495ED}{" + C + "} \\div \\color{#FFA500}{" + B + "} = {?}}", "right" );
</div>
<div class="solution" data-forms="integer"><var>A</var></div>
</div>
View
8 exercises/domain_and_range_0.5.html
@@ -23,16 +23,16 @@
push([ DOMAIN[0], randRange( -5, 5 ) ]);
for( var i = DOMAIN[0]+1; i &lt;= DOMAIN[1]; i++ ) {
- if ( abs( randRangeNonZero( -10, 10 ) < 2 ) && prev[1] < 8 ) {
+ if ( abs( randRangeNonZero( -10, 10 ) &lt; 2 ) && prev[1] &lt; 8 ) {
push([i, prev[1]+1]);
- } else if ( abs( randRangeNonZero( -10, 10 ) < 2 ) && prev[1] > -8 ) {
+ } else if ( abs( randRangeNonZero( -10, 10 ) &lt; 2 ) && prev[1] > -8 ) {
push([i, prev[1]-1]);
- } else if ( abs( randRangeNonZero( -10, 10 ) < 2 ) && prev[1] < 7 ) {
+ } else if ( abs( randRangeNonZero( -10, 10 ) &lt; 2 ) && prev[1] &lt; 7 ) {
push([i, prev[1]+2]);
- } else if ( abs( randRangeNonZero( -10, 10 ) < 3 ) && prev[1] > -7 ) {
+ } else if ( abs( randRangeNonZero( -10, 10 ) &lt; 3 ) && prev[1] > -7 ) {
push([i, prev[1]-2]);
} else {
View
6 exercises/equation_of_a_line.html
@@ -42,7 +42,7 @@
if( x !== X1 && x !== X2 ) {
var denom = X1 - X2,
num = x * ( Y1 - Y2 ) + B * denom,
- negative = ( num * denom < 0 ? -1 : 1 );
+ negative = ( num * denom &lt; 0 ? -1 : 1 );
num = round( abs( num ) * negative );
denom = round( abs( denom ) );
@@ -96,7 +96,7 @@
<p>The equation for the slope is <code>m = \dfrac{y_2 - y_1}{x_2 - x_1}</code>.</p>
<div>
<p>Substitute both points.</p>
- <p><code>m = \dfrac{<var>Y2</var> - <var>negParens(Y1)</var>}{<var>X2</var> - <var>negParens(X1)</var>} = <var><var>fractionReduce( Y2 - Y1, X2 - X1 )</var></var></code></p>
+ <p><code>m = \dfrac{<var>Y2</var> - <var>negParens(Y1)</var>}{<var>X2</var> - <var>negParens(X1)</var>} = <var>fractionReduce( Y2 - Y1, X2 - X1 )</var></code></p>
</div>
<p>
Writing the equation of the line, we have <code>y = <var>( M == -1 ? "-" : ( M == 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + b</code>
@@ -169,7 +169,7 @@
<p>The equation for the slope is <code>m = \dfrac{y_2 - y_1}{x_2 - x_1}</code>.</p>
<div>
<p>Substitute both points.</p>
- <p><code>m = \dfrac{<var>Y2</var> - <var>negParens(Y1)</var>}{<var>X2</var> - <var>negParens(X1)</var>} = <var><var>fractionReduce( Y2 - Y1, X2 - X1 )</var></var></code></p>
+ <p><code>m = \dfrac{<var>Y2</var> - <var>negParens(Y1)</var>}{<var>X2</var> - <var>negParens(X1)</var>} = <var>fractionReduce( Y2 - Y1, X2 - X1 )</var></code></p>
</div>
<p>
Writing the equation of the line, we have <code>y = <var>( M == -1 ? "-" : ( M == 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + b</code>
View
6 exercises/even_and_odd_functions.html
@@ -99,8 +99,8 @@
jQuery.grep( [1,2,3,4,5,6,7,8,9,10],
function( i ) {
return ( abs( valAt( WIDES, i ) ) > 1 || abs( valAt( WIDES, -i ) ) > 1 )
- && abs( valAt( WIDES, i ) ) < 10
- && abs( valAt( WIDES, -i ) ) < 10;
+ && abs( valAt( WIDES, i ) ) &lt; 10
+ && abs( valAt( WIDES, -i ) ) &lt; 10;
}
)
</var>
@@ -111,7 +111,7 @@
jQuery.grep( PTS,
function( i ) {
return abs( abs( valAt( WIDES, i ) ) - abs( valAt( WIDES, -i ) ) ) > 0.5
- && abs( i ) < 10;
+ && abs( i ) &lt; 10;
}
)
)</var>
View
4 exercises/even_and_odd_integers.html
@@ -147,9 +147,7 @@
</div>
<div data-each="HINTS as I, HINT">
<div class="graphie" data-update="expression">
- // hack to get around graphie script not working with data-each
- // (graphie script executes after the data-each templating's done)
- HINTS[<var>I</var>].graph( KhanUtil.currentGraph );
+ HINTS[I].graph( KhanUtil.currentGraph );
</div>
<p><var>HINT.text</var></p>
</div>
View
2 exercises/exponents_2.html
@@ -51,7 +51,7 @@
<var id="BASE_N">VALS.base_n</var>
<var id="BASE_D">VALS.base_d</var>
- <var id="EXP_NEG">VALS.exp < 0</var>
+ <var id="EXP_NEG">VALS.exp &lt; 0</var>
<var id="EXP_SIGN">EXP_NEG ? "-" : ""</var>
<var id="EXP">abs( VALS.exp )</var>
View
2 exercises/exponents_3.html
@@ -17,7 +17,7 @@
<var id="BASE_N">VALS.base_1</var>
<var id="BASE_D">VALS.base_2</var>
- <var id="EXP_NEG">random() < .75</var>
+ <var id="EXP_NEG">random() &lt; .75</var>
<var id="EXP_D">VALS.root</var>
<!-- base, flipped if the exponent is negative. -->
View
4 exercises/exponents_4.html
@@ -15,10 +15,10 @@
<div class="vars">
<var id="VALS">twoBasesOneRoot()</var>
- <var id="EXP_NEG">random() < .75</var>
+ <var id="EXP_NEG">random() &lt; .75</var>
<var id="EXP_D_ORIG">VALS.root</var>
- <var id="BASE_NEG">isOdd( EXP_D ) && ( random() < .75 )</var>
+ <var id="BASE_NEG">isOdd( EXP_D ) && ( random() &lt; .75 )</var>
<var id="BASE_N">VALS.base_1</var>
<var id="BASE_D">VALS.base_2</var>
View
2 exercises/fractions_on_the_number_line.html
@@ -117,7 +117,7 @@
style({ stroke: "#FFA500", fill: "#FFA500", strokeWidth: 3.5 });
var already = [];
for( i = 0; i != WRONGS.length; i++ ){
- if( WRONGS[ i ] >= start && WRONGS[ i ] <= end ){
+ if( WRONGS[ i ] >= start && WRONGS[ i ] &lt;= end ){
ellipse( [ WRONGS[ i ] - start, 0 ], [ 0.01, 0.12 ] );
label( [WRONGS[ i ] - start, 0 ], POSS_ANSWER[ i ] , "above", { labelDistance: 5 } );
}
View
2 exercises/fractions_on_the_number_line_2.html
@@ -18,7 +18,7 @@
<var id="M_NUMERATOR">NUMERATOR % DENOMINATOR</var>
<var id="M_WHOLE">(NUMERATOR - M_NUMERATOR) / DENOMINATOR</var>
- <var id="M_NUMBER">(abs(SOLUTION) > 1 ? M_WHOLE + (SOLUTION < 0 ? fraction(M_NUMERATOR, -DENOMINATOR) : fraction(M_NUMERATOR, DENOMINATOR)) : fraction(NUMERATOR, DENOMINATOR))</var>
+ <var id="M_NUMBER">(abs(SOLUTION) > 1 ? M_WHOLE + (SOLUTION &lt; 0 ? fraction(M_NUMERATOR, -DENOMINATOR) : fraction(M_NUMERATOR, DENOMINATOR)) : fraction(NUMERATOR, DENOMINATOR))</var>
<var id="IS_MIXED">0</var>
<var id="NUMBER">IS_MIXED === 1 && abs(SOLUTION) > 1 ? M_NUMBER : fraction(NUMERATOR, DENOMINATOR)</var>
View
2 exercises/fractions_on_the_number_line_3.html
@@ -18,7 +18,7 @@
<var id="M_NUMERATOR">NUMERATOR % DENOMINATOR</var>
<var id="M_WHOLE">(NUMERATOR - M_NUMERATOR) / DENOMINATOR</var>
- <var id="M_NUMBER">(abs(SOLUTION) > 1 ? M_WHOLE + (SOLUTION < 0 ? fraction(M_NUMERATOR, -DENOMINATOR) : fraction(M_NUMERATOR, DENOMINATOR)) : fraction(NUMERATOR, DENOMINATOR))</var>
+ <var id="M_NUMBER">(abs(SOLUTION) > 1 ? M_WHOLE + (SOLUTION &lt; 0 ? fraction(M_NUMERATOR, -DENOMINATOR) : fraction(M_NUMERATOR, DENOMINATOR)) : fraction(NUMERATOR, DENOMINATOR))</var>
<var id="IS_MIXED">0</var>
<var id="NUMBER">IS_MIXED === 1 && abs(SOLUTION) > 1 ? M_NUMBER : fraction(NUMERATOR, DENOMINATOR)</var>
</div>
View
10 exercises/functions_1.html
@@ -13,17 +13,17 @@
var functionPath = new Array();
functionPath.push([ -11, randRange( -5, 5 ) ]);
- for( var i = -10; i < 11; i++ ) {
- if ( abs( randRangeNonZero( -10, 10 ) < 2 ) && functionPath[i+10][1] < 8 ) {
+ for( var i = -10; i &lt; 11; i++ ) {
+ if ( abs( randRangeNonZero( -10, 10 ) &lt; 2 ) && functionPath[i+10][1] &lt; 8 ) {
functionPath.push([i, functionPath[i+10][1]+1]);
- } else if ( abs( randRangeNonZero( -10, 10 ) < 2 ) && functionPath[i+10][1] > -8 ) {
+ } else if ( abs( randRangeNonZero( -10, 10 ) &lt; 2 ) && functionPath[i+10][1] > -8 ) {
functionPath.push([i, functionPath[i+10][1]-1]);
- } else if ( abs( randRangeNonZero( -10, 10 ) < 2 ) && functionPath[i+10][1] < 7 ) {
+ } else if ( abs( randRangeNonZero( -10, 10 ) &lt; 2 ) && functionPath[i+10][1] &lt; 7 ) {
functionPath.push([i, functionPath[i+10][1]+2]);
- } else if ( abs( randRangeNonZero( -10, 10 ) < 3 ) && functionPath[i+10][1] > -7 ) {
+ } else if ( abs( randRangeNonZero( -10, 10 ) &lt; 3 ) && functionPath[i+10][1] > -7 ) {
functionPath.push([i, functionPath[i+10][1]-2]);
} else {
View
2 exercises/graphs_of_sine_and_cosine.html
@@ -24,7 +24,7 @@
<var id="FN">randFromArray( [ "cos", "sin" ] )</var>
<var id="FNS">{ "cos": "cosine", "sin": "sine"}[FN]</var>
<var id="VSCALE">randRange( 1, 5 ) / 2</var>
- <var id="HSCALE">random() < .5 ? randRange( 1, 4 ) : 1 / randRange( 1, 4 )</var>
+ <var id="HSCALE">random() &lt; .5 ? randRange( 1, 4 ) : 1 / randRange( 1, 4 )</var>
<var id="PERIOD">2 * PI * HSCALE</var>
<var id="VRANGE">3.5</var>
View
8 exercises/inverse_trig_functions.html
@@ -12,10 +12,10 @@
<div class="vars">
<!-- whether we present the question as arcsin(x) = ? or sin^-1(x) = ? -->
- <var id="ARC">random() < 0.5</var>
+ <var id="ARC">random() &lt; 0.5</var>
<!-- whether we expect the answer in terms of degrees or radians -->
- <var id="DEG">random() < 0.5</var>
+ <var id="DEG">random() &lt; 0.5</var>
<var id="FN">randFromArray([ "sin", "cos", "tan" ])</var>
<var id="FN_INV">"\\" + FN + "^{-1}"</var>
@@ -27,7 +27,7 @@
<var id="SIN_RANGE">[ 0, 1/2, sqrt(2)/2, sqrt(3)/2 ]</var>
<var id="TAN_RANGE">[ 0, sqrt(3)/3, 1, sqrt(3) ]</var>
- <var id="X">( random() < 0.5 ? -1 : 1 ) * {
+ <var id="X">( random() &lt; 0.5 ? -1 : 1 ) * {
sin: randFromArray( SIN_RANGE ),
cos: randFromArray( SIN_RANGE ),
tan: randFromArray( TAN_RANGE )
@@ -47,7 +47,7 @@
<var id="PRETTY">function( n ) {
- var sign = n < 0 ? "-" : "";
+ var sign = n &lt; 0 ? "-" : "";
n = abs( n );
var o = {};
View
10 exercises/kinematic_equations.html
@@ -20,10 +20,10 @@
<var id="NO_SOLUTION">
/* negative under radical */
- (OMITTED=='v_i' && UNKNOWN == 't' && (V_FINAL * V_FINAL - 2 * ACCEL * DISP < 0.1)) ||
- (OMITTED=='v_f' && UNKNOWN == 't' && (V_INIT * V_INIT + 2 * ACCEL * DISP < 0.1)) ||
- (OMITTED=='t' && UNKNOWN == 'v_i' && (V_FINAL * V_FINAL - 2 * ACCEL * DISP < 0.1)) ||
- (OMITTED=='t' && UNKNOWN == 'v_f' && (V_INIT * V_INIT + 2 * ACCEL * DISP < 0.1)) ||
+ (OMITTED=='v_i' && UNKNOWN == 't' && (V_FINAL * V_FINAL - 2 * ACCEL * DISP &lt; 0.1)) ||
+ (OMITTED=='v_f' && UNKNOWN == 't' && (V_INIT * V_INIT + 2 * ACCEL * DISP &lt; 0.1)) ||
+ (OMITTED=='t' && UNKNOWN == 'v_i' && (V_FINAL * V_FINAL - 2 * ACCEL * DISP &lt; 0.1)) ||
+ (OMITTED=='t' && UNKNOWN == 'v_f' && (V_INIT * V_INIT + 2 * ACCEL * DISP &lt; 0.1)) ||
/* division by 0 */
(OMITTED=='d' && UNKNOWN == 'a' && TIME == 0) ||
@@ -36,7 +36,7 @@
(OMITTED=='v_f' && UNKNOWN == 't' && ACCEL == 0) ||
(OMITTED=='a' && UNKNOWN == 'v_i' && TIME == 0) ||
(OMITTED=='a' && UNKNOWN == 'v_f' && TIME == 0) ||
- (OMITTED=='a' && UNKNOWN == 't' && (-0.1 < V_INIT + V_FINAL) && (V_INIT + V_FINAL < 0.1)) ||
+ (OMITTED=='a' && UNKNOWN == 't' && (-0.1 &lt; V_INIT + V_FINAL) && (V_INIT + V_FINAL &lt; 0.1)) ||
(OMITTED=='t' && UNKNOWN == 'd' && ACCEL == 0) ||
(OMITTED=='t' && UNKNOWN == 'a' && DISP == 0)
</var>
View
4 exercises/limits_2.html
@@ -88,8 +88,8 @@
<div class="hints">
<p>Look at the leading terms <code><var>expr(NUM.expr()[1])</var></code> and <code><var>expr(DEN.expr()[1])</var></code>.</p>
- <p>As <code>x \to \infty</code>, the numerator approaches <code><var>NUM.getCoefAndDegreeForTerm(0).coef < 0 ? "-" : ""</var>\infty</code> because the coefficient <code><var>NUM.getCoefAndDegreeForTerm(0).coef</var></code> is <var>NUM.getCoefAndDegreeForTerm(0).coef < 0 ? "negative" : "positive"</var>.</p>
- <p>As <code>x \to \infty</code>, the denominator <var>NUM.getCoefAndDegreeForTerm(0).coef * DEN.getCoefAndDegreeForTerm(0).coef > 0 ? "also " : ""</var>approaches <code><var>DEN.getCoefAndDegreeForTerm(0).coef < 0 ? "-" : ""</var>\infty</code> because the coefficient <code><var>DEN.getCoefAndDegreeForTerm(0).coef</var></code> is <var>DEN.getCoefAndDegreeForTerm(0).coef < 0 ? "negative" : "positive"</var>.</p>
+ <p>As <code>x \to \infty</code>, the numerator approaches <code><var>NUM.getCoefAndDegreeForTerm(0).coef &lt; 0 ? "-" : ""</var>\infty</code> because the coefficient <code><var>NUM.getCoefAndDegreeForTerm(0).coef</var></code> is <var>NUM.getCoefAndDegreeForTerm(0).coef &lt; 0 ? "negative" : "positive"</var>.</p>
+ <p>As <code>x \to \infty</code>, the denominator <var>NUM.getCoefAndDegreeForTerm(0).coef * DEN.getCoefAndDegreeForTerm(0).coef > 0 ? "also " : ""</var>approaches <code><var>DEN.getCoefAndDegreeForTerm(0).coef &lt; 0 ? "-" : ""</var>\infty</code> because the coefficient <code><var>DEN.getCoefAndDegreeForTerm(0).coef</var></code> is <var>DEN.getCoefAndDegreeForTerm(0).coef &lt; 0 ? "negative" : "positive"</var>.</p>
<p>Because the numerator's degree <code><var>NUM.getCoefAndDegreeForTerm(0).degree</var></code> is greater than the denominator's degree <code><var>DEN.getCoefAndDegreeForTerm(0).degree</var></code>, the limit diverges.</p>
<p data-if="NUM.getCoefAndDegreeForTerm(0).coef * DEN.getCoefAndDegreeForTerm(0).coef > 0">The numerator and denominator have the same sign as <code>x</code> gets large, so the limit is <code>+\infty</code>.</p>
<p data-else>The numerator and denominator have differing signs as <code>x</code> gets large, so the limit is <code>-\infty</code>.</p>
View
6 exercises/line_relationships.html
@@ -42,7 +42,7 @@
plot(function( x ) {
return ( M * x + B );
}, [-10, 10], {
- stroke: "<var>BLUE</var>"
+ stroke: BLUE
});
circle( [X, Y], 1/4, {
@@ -77,7 +77,7 @@
plot(function( x ) {
return ( -1 / M * x + ( Y - ( -1 / M * X ) ) );
}, [-10, 10], {
- stroke: "<var>GREEN</var>"
+ stroke: GREEN
});
</div>
</div>
@@ -113,7 +113,7 @@
plot(function( x ) {
return ( M * x + ( Y - M * X ) );
}, [-10, 10], {
- stroke: "<var>GREEN</var>"
+ stroke: GREEN
});
</div>
</div>
View
6 exercises/linear_equations_4.html
@@ -32,7 +32,7 @@
<p><code>\qquad <var>A * C</var>x + <var>A * D</var> = <var>B</var></code></p>
</div>
<div>
- <p>Now <var>A * D < 0 ? "add" : "subtract"</var> <code><var>abs( A * D )</var></code> <var>A * D < 0 ? "to" : "from"</var> both sides:</p>
+ <p>Now <var>A * D &lt; 0 ? "add" : "subtract"</var> <code><var>abs( A * D )</var></code> <var>A * D &lt; 0 ? "to" : "from"</var> both sides:</p>
<p><code>\qquad (<var>A * C</var>x + <var>A * D</var>) + <var>-A * D</var> = <var>B</var> + <var>- A * D</var></code></p>
<p><code>\qquad <var>A * C</var>x = <var>B - A * D</var></code></p>
</div>
@@ -64,12 +64,12 @@
<p><code>\qquad <var>expr(["*", A, "x"])</var> + <var>B</var> = <var>expr(["*", E * C, "x"])</var> + <var>E * D</var></code></p>
</div>
<div>
- <p>Now <var>E * C < 0 ? "add" : "subtract"</var> <code><var>abs( E * C )</var>x</code> <var>E * C < 0 ? "to" : "from"</var> both sides:</p>
+ <p>Now <var>E * C &lt; 0 ? "add" : "subtract"</var> <code><var>abs( E * C )</var>x</code> <var>E * C &lt; 0 ? "to" : "from"</var> both sides:</p>
<p><code>\qquad (<var>expr(["*", A, "x"])</var> + <var>B</var>) + <var>-E * C</var>x = (<var>expr(["*", E * C, "x"])</var> + <var>E * D</var>) + <var>-E * C</var>x</code></p>
<p><code>\qquad <var>A - E * C</var>x + <var>B</var> = <var>E * D</var></code></p>
</div>
<div>
- <p>Now <var>B < 0 ? "add" : "subtract"</var> <code><var>abs( B )</var></code>:</p>
+ <p>Now <var>B &lt; 0 ? "add" : "subtract"</var> <code><var>abs( B )</var></code>:</p>
<p><code>\qquad (<var>A - E * C</var>x + <var>B</var>) + <var>-B</var> = <var>E * D</var> + <var>-B</var></code></p>
<p><code>\qquad <var>A - E * C</var>x = <var>E * D - B</var></code></p>
</div>
View
2 exercises/mean_median_and_mode.html
@@ -166,7 +166,7 @@
});
for ( var num in freq ) {
- for ( var i = 0, l = freq[ num ]; i < l; i++ ) {
+ for ( var i = 0, l = freq[ num ]; i &lt; l; i++ ) {
circle( [num, ( i + 1.5 ) / 2], 5/40, { stroke: "none", fill: "#6495ed" } );
}
}
View
2 exercises/multiplication_0.5.html
@@ -20,7 +20,7 @@
scale: [ 50, 50 ]
});
KhanUtil.currentGraph.labelHolder = label( [ 0, B ],
- "\\Huge{\\color{#6495ED}{ <var>A</var> } \\times \\color{#28AE7B}{ <var>B</var> } = {?}}", "right" );
+ "\\Huge{\\color{#6495ED}{" + A + "} \\times \\color{#28AE7B}{" + B + "} = {?}}", "right" );
</div>
<div class="solution" data-forms="integer"><var>A * B</var></div>
</div>
View
2 exercises/multiplication_1.html
@@ -20,7 +20,7 @@
scale: [ 50, 50 ]
});
KhanUtil.currentGraph.labelHolder = label( [ 0, B ],
- "\\Huge{\\color{#6495ED}{ <var>A</var> } \\times \\color{#28AE7B}{ <var>B</var> } = {?}}", "right" );
+ "\\Huge{\\color{#6495ED}{" + A + "} \\times \\color{#28AE7B}{" + B + "} = {?}}", "right" );
</div>
<div class="solution"><var>A * B</var></div>
</div>
View
2 exercises/multiplying_expressions_1.html
@@ -25,7 +25,7 @@
<div class="vars">
<!-- 1/4 of questions will be squares -->
- <var id="SQUARE">random() < 0.25</var>
+ <var id="SQUARE">random() &lt; 0.25</var>
<var id="A">randRangeNonZero( -10, 10 )</var>
<var id="B">randRangeNonZero( -10, 10 )</var>
View
2 exercises/multiplying_fractions_1.html
@@ -466,7 +466,7 @@
<var id="B">randRange( 2, 5 )</var>
<var id="BOXES">( function() {
var a = [];
- for ( var i = 1; i <= B; i++ ) { a.push( i ); }
+ for ( var i = 1; i &lt;= B; i++ ) { a.push( i ); }
return a;
} )()</var>
</div>
View
2 exercises/multiplying_fractions_word_problems.html
@@ -419,7 +419,7 @@
</div>
</div>
-->
- <p><strong><var>person(1)</var> needed <var>plural(<var>SOLUTION</var>,"cup")</var> of chocolate chips to make enough cookies for the bake sale.</strong></p>
+ <p><strong><var>person(1)</var> needed <var>plural(SOLUTION, "cup")</var> of chocolate chips to make enough cookies for the bake sale.</strong></p>
</div>
</div>
</div>
View
18 exercises/multiplying_polynomials.html
@@ -16,9 +16,9 @@
}, 2 )</var>
<var id="POL_1, POL_2">tabulate( function(n) {
var coefs = [];
- for ( var i = 0; i <= MAX_DEGREE; i++ ) {
+ for ( var i = 0; i &lt;= MAX_DEGREE; i++ ) {
var value = 0;
- for ( var j = 0; j < NON_ZERO_INDICES[ n ].length; j++ ) {
+ for ( var j = 0; j &lt; NON_ZERO_INDICES[ n ].length; j++ ) {
if ( i === NON_ZERO_INDICES[ n ][ j ] ) {
value = randRangeNonZero( -7, 7 );
break;
@@ -34,11 +34,11 @@
var counter = 0;
var areLikeTerms = false;
- for ( var i = POL_1.minDegree; i <= POL_1.maxDegree; i++ ) {
+ for ( var i = POL_1.minDegree; i &lt;= POL_1.maxDegree; i++ ) {
if ( POL_1.coefs[ i ] === 0 ) {
continue;
}
- for ( var j = POL_2.minDegree; j <= POL_2.maxDegree; j++ ) {
+ for ( var j = POL_2.minDegree; j &lt;= POL_2.maxDegree; j++ ) {
if ( POL_2.coefs[ j ] === 0 ) {
continue;
}
@@ -59,7 +59,7 @@
var counter = 0;
var coefs = [];
- for ( var i = 0; i < SOLUTION.coefs.length; i++ )
+ for ( var i = 0; i &lt; SOLUTION.coefs.length; i++ )
{
if ( SOLUTION.coefs[ i ] === 0 ) {
continue;
@@ -88,11 +88,11 @@
<div class="hints">
<div>
<p>First use the distributive property.</p>
- <code><span data-each="NON_ZERO_INDICES[ 0 ] as n1, index1"><span data-each="NON_ZERO_INDICES[ 1 ] as n2, index2"><var>( POL_1.coefs[ index1 ] < 0 ) ? "-" : ( n1 === 0 && n2 === 0 ) ? "" : "+"</var><var>abs( POL_1.coefs[ index1 ] ) === 1 ? "" : abs( POL_1.coefs[ index1 ] )</var><var>X</var>^<var>index1</var>(<var>( POL_2.coefs[ index2 ] === 1 ) ? "" : ( POL_2.coefs[ index2 ] === -1 ) ? "-" : POL_2.coefs[ index2 ]</var><var>X</var>^<var>index2</var>)</span></span></code>
+ <code><span data-each="NON_ZERO_INDICES[ 0 ] as n1, index1"><span data-each="NON_ZERO_INDICES[ 1 ] as n2, index2"><var>( POL_1.coefs[ index1 ] &lt; 0 ) ? "-" : ( n1 === 0 && n2 === 0 ) ? "" : "+"</var><var>abs( POL_1.coefs[ index1 ] ) === 1 ? "" : abs( POL_1.coefs[ index1 ] )</var><var>X</var>^<var>index1</var>(<var>( POL_2.coefs[ index2 ] === 1 ) ? "" : ( POL_2.coefs[ index2 ] === -1 ) ? "-" : POL_2.coefs[ index2 ]</var><var>X</var>^<var>index2</var>)</span></span></code>
</div>
<div>
<p>Simplify.</p>
- <code data-if="LIKE_TERMS"><span data-each="NON_ZERO_INDICES[ 0 ] as n1, index1"><span data-each="NON_ZERO_INDICES[ 1 ] as n2, index2"><var>( POL_1.coefs[ index1 ] * POL_2.coefs[ index2 ] < 0 ) ? "-" : ( n1 === 0 && n2 === 0 ) ? "" : "+"</var><var>abs( POL_1.coefs[ index1 ] * POL_2.coefs[ index2 ] )</var><var>X</var>^{<var>index1 + index2</var>}</span></span></code>
+ <code data-if="LIKE_TERMS"><span data-each="NON_ZERO_INDICES[ 0 ] as n1, index1"><span data-each="NON_ZERO_INDICES[ 1 ] as n2, index2"><var>( POL_1.coefs[ index1 ] * POL_2.coefs[ index2 ] &lt; 0 ) ? "-" : ( n1 === 0 && n2 === 0 ) ? "" : "+"</var><var>abs( POL_1.coefs[ index1 ] * POL_2.coefs[ index2 ] )</var><var>X</var>^{<var>index1 + index2</var>}</span></span></code>
<div data-else>
<code><var>SOLUTION</var></code>
<p>You're done!</p>
@@ -101,11 +101,11 @@
<div data-if="LIKE_TERMS">
<div>
<p>Identify like terms.</p>
- <code><span data-each="NON_ZERO_INDICES[ 0 ] as n1, index1"><span data-each="NON_ZERO_INDICES[ 1 ] as n2, index2">\color{<var>LIKE_TERMS[ index1 + index2 ]</var>}{<var>( POL_1.coefs[ index1 ] * POL_2.coefs[ index2 ] < 0 ) ? "-" : ( n1 === 0 && n2 === 0 ) ? "" : "+"</var><var>abs( POL_1.coefs[ index1 ] * POL_2.coefs[ index2 ] )</var><var>X</var>^{<var>index1 + index2</var>}}</span></span></code>
+ <code><span data-each="NON_ZERO_INDICES[ 0 ] as n1, index1"><span data-each="NON_ZERO_INDICES[ 1 ] as n2, index2">\color{<var>LIKE_TERMS[ index1 + index2 ]</var>}{<var>( POL_1.coefs[ index1 ] * POL_2.coefs[ index2 ] &lt; 0 ) ? "-" : ( n1 === 0 && n2 === 0 ) ? "" : "+"</var><var>abs( POL_1.coefs[ index1 ] * POL_2.coefs[ index2 ] )</var><var>X</var>^{<var>index1 + index2</var>}}</span></span></code>
</div>
<div>
<p>Add the coefficients.</p>
- <p><code><span data-each="new Array( SOLUTION.getNumberOfTerms() ) as n, index">\color{<var>LIKE_TERMS[ SOLUTION.getCoefAndDegreeForTerm( n ).degree ]</var>}{<var>( SOLUTION.getCoefAndDegreeForTerm( n ).coef < 0 || n === 0 ) ? "" : "+"</var><var>expr( SOLUTION.expr()[ n + 1 ] )</var>}</span></code></p>
+ <p><code><span data-each="new Array( SOLUTION.getNumberOfTerms() ) as n, index">\color{<var>LIKE_TERMS[ SOLUTION.getCoefAndDegreeForTerm( n ).degree ]</var>}{<var>( SOLUTION.getCoefAndDegreeForTerm( n ).coef &lt; 0 || n === 0 ) ? "" : "+"</var><var>expr( SOLUTION.expr()[ n + 1 ] )</var>}</span></code></p>
<p>You're done!</p>
</div>
</div>
View
4 exercises/quadratic_equation.html
@@ -24,7 +24,7 @@
<var id="WRONGS">
(function() {
var wrongs = [];
- for ( var i = 0; i < 5; i++ ) {
+ for ( var i = 0; i &lt; 5; i++ ) {
var bad_a = randRangeNonZero(-10, 10);
var bad_b = randRangeNonZero(-10, 10);
var bad_c = randRangeNonZero(-10, 10);
@@ -36,7 +36,7 @@
abs(B*bad_gcd)== abs(bad_b*good_gcd) &&
abs(C*bad_gcd)== abs(bad_c*good_gcd) ) ||
- (( (bad_b * bad_b) - (4 * bad_a * bad_c) ) < 0))
+ (( (bad_b * bad_b) - (4 * bad_a * bad_c) ) &lt; 0))
{
bad_a = randRangeNonZero(-10, 10);
bad_b = randRangeNonZero(-10, 10);
View
18 exercises/quadratic_inequalities_1.html
@@ -36,25 +36,25 @@
<div class="question">
<p>For what values of <code>x</code> does
- <p style="text-align:center"><code><var>plus(XX, (A+B)+X)</var> < <var>-C</var></code></p>
+ <p style="text-align:center"><code><var>plus(XX, (A+B)+X)</var> &lt; <var>-C</var></code></p>
</div>
<div class="solution" data-type="multiple">
<p><span class="sol"><var>R1</var></span>
- <code> < x < </code>
+ <code> &lt; x &lt; </code>
<span class="sol"><var>R2</var></span> </p>
</div>
</div>
</div>
<div class="hints">
- <p>First, move the term over to the other side of the inequality<br><code><var>plus(XX, (A+B)+X, C)</var> < 0</code></p>
- <p>Now, let's factor the quadratic equation<br><code><var>mult(LEFT, RIGHT)</var> < 0</code></p>
- <p>either <code> <var>LEFT</var> < 0</code> and <code><var>RIGHT</var> > 0</code> or <br>
- <code><var>LEFT</var> > 0</code> and <code><var>RIGHT</var> < 0</code> </p>
- <p>either <code> <var>X</var> < <var>-A</var></code> and <code><var>X</var> > <var>-B</var></code> or <br>
- <code><var>X</var> > <var>-A</var></code> and <code><var>X</var> < <var>-B</var></code> </p>
+ <p>First, move the term over to the other side of the inequality<br><code><var>plus(XX, (A+B)+X, C)</var> &lt; 0</code></p>
+ <p>Now, let's factor the quadratic equation<br><code><var>mult(LEFT, RIGHT)</var> &lt; 0</code></p>
+ <p>either <code> <var>LEFT</var> &lt; 0</code> and <code><var>RIGHT</var> > 0</code> or <br>
+ <code><var>LEFT</var> > 0</code> and <code><var>RIGHT</var> &lt; 0</code> </p>
+ <p>either <code> <var>X</var> &lt; <var>-A</var></code> and <code><var>X</var> > <var>-B</var></code> or <br>
+ <code><var>X</var> > <var>-A</var></code> and <code><var>X</var> &lt; <var>-B</var></code> </p>
<div>
<p>which we can graph, like so:</p>
<div class="graphie">
@@ -76,7 +76,7 @@
strokeWidth:5
}, function() {
line([12+R1,1], [12+R2,1]);
- label([12+(R1+R2)/2,.5], R1 + " < x < "+R2, "above");
+ label([12+(R1+R2)/2,.5], R1 + " &lt; x &lt; "+R2, "above");
});
style({
View
2 exercises/rate_problems_1.html
@@ -27,7 +27,7 @@
<var id="SPEED1">REASONABLESPEED(VEHC1)</var>
<var id="SPEED2" data-ensure="SPEED2 !== SPEED1">REASONABLESPEED(VEHC2)</var>
- <var id="AVG">SPEED1 < SPEED2 ? randRange(SPEED1 + 1, SPEED2 - 1) : randRange(SPEED2 + 1, SPEED1 - 1)</var>
+ <var id="AVG">SPEED1 &lt; SPEED2 ? randRange(SPEED1 + 1, SPEED2 - 1) : randRange(SPEED2 + 1, SPEED1 - 1)</var>
<var id="TIME">randRange(1, 9)</var>
<var id="DIST">AVG * TIME</var>
<var id="DIST2">(SPEED1 * SPEED2 * TIME - DIST * SPEED2) / (SPEED1 - SPEED2)</var>
View
12 exercises/representing_numbers.html
@@ -33,7 +33,7 @@
stroke: "#4e74ba"
});
- for ( var i = 0; i < C; i++ ) {
+ for ( var i = 0; i &lt; C; i++ ) {
path([ [1.5 * i, 0], [1.5 * i, 1], [1.5 * i + 1, 1], [1.5 * i + 1, 0], true ]);
}
</div>
@@ -51,7 +51,7 @@
stroke: "#4e74ba"
});
- for ( var i = 0; i < B; i++ ) {
+ for ( var i = 0; i &lt; B; i++ ) {
path([ [0, -1.5 * i], [10, -1.5 * i], [10, -1.5 * i - 1], [0, -1.5 * i - 1], true ]);
grid( [0, 10], [-1.5 * i, -1.5 * i - 1], { strokeWidth: 1 } ).translate( -0.5, 0 );
}
@@ -70,7 +70,7 @@
stroke: "#4e74ba"
});
- for ( var i = 0; i < A; i++ ) {
+ for ( var i = 0; i &lt; A; i++ ) {
path([ [10.5 * i + 0, 0], [10.5 * i + 0, 10], [10.5 * i + 10, 10], [10.5 * i + 10, 0], true ]);
grid( [0, 10], [0, 10], { strokeWidth: 1 } ).translate( 28 * 10.5 * i - 0.5, 0 );
}
@@ -84,7 +84,7 @@
<div data-if="A !== 0">
<p>By counting the number of hundreds blocks, we see that the hundreds digit of the number is <code><var>A</var></code>.</p>
<div class="graphie" data-update="hundreds-graph">
- for ( var i = 0; i < A; i++ ) {
+ for ( var i = 0; i &lt; A; i++ ) {
label( [10.5 * i + 5, 5], "\\large{\\mathbf{100}}", { color: "black", background: "#a2bff4" } );
}
</div>
@@ -94,7 +94,7 @@
<div data-else>
<p>By counting the number of tens blocks, we see that the tens digit of the number is <code><var>B</var></code>.</p>
<div class="graphie" data-update="tens-graph">
- for ( var i = 0; i < B; i++ ) {
+ for ( var i = 0; i &lt; B; i++ ) {
label( [5, -1.5 * i - 0.6], "\\large{\\mathbf{1\\:0}}", { color: "black" } );
}
</div>
@@ -104,7 +104,7 @@
<div data-else>
<p>By counting the number of single unit blocks, we see that the units digit of the number is <code><var>C</var></code>.</p>
<div class="graphie" data-update="ones-graph">
- for ( var i = 0; i < C; i++ ) {
+ for ( var i = 0; i &lt; C; i++ ) {
label( [1.5 * i + 0.5, 0.5], "\\mathbf{1}", { color: "black" } );
}
</div>
View
24 exercises/scaling_vectors.html
@@ -17,7 +17,7 @@
} else {
var t = cross( qx - px, qy - py, sx, sy ) / cross( rx, ry, sx, sy );
var u = cross( qx - px, qy - py, rx, ry ) / cross( rx, ry, sx, sy );
- return 0 <= t && t <= 1 && 0 <= u && u <= 1;
+ return 0 &lt;= t && t &lt;= 1 && 0 &lt;= u && u &lt;= 1;
}
}
</script>
@@ -27,7 +27,7 @@
<div class="vars" data-ensure="( BX !== CX || BY !== CY ) && ( BX !== DX || BY !== DY ) && ( BX !== EX || BY !== EY ) && ( CX !== DX || CY !== DY ) && ( CX !== EX || CY !== EY ) && ( DX !== EX || DY !== EY ) && !vectorsIntersect( 0, 0, AX, AY, BOX, BOY, BX, BY ) && !vectorsIntersect( 0, 0, AX, AY, COX, COY, CX, CY ) && !vectorsIntersect( 0, 0, AX, AY, DOX, DOY, DX, DY ) && !vectorsIntersect( 0, 0, AX, AY, EOX, EOY, EX, EY ) && !vectorsIntersect( BOX, BOY, BX, BY, COX, COY, CX, CY ) && !vectorsIntersect( BOX, BOY, BX, BY, DOX, DOY, DX, DY ) && !vectorsIntersect( BOX, BOY, BX, BY, EOX, EOY, EX, EY ) && !vectorsIntersect( COX, COY, CX, CY, DOX, DOY, DX, DY ) && !vectorsIntersect( COX, COY, CX, CY, EOX, EOY, EX, EY ) && !vectorsIntersect( DOX, DOY, DX, DY, EOX, EOY, EX, EY )">
<var id="AX">randRangeNonZero( -3, 3 )</var>
<var id="AY">randRangeNonZero( -3, 3 )</var>
- <var id="SA" data-ensure="abs( SA * AX ) < 8 && abs( SA * AY ) < 8">randRangeNonZero( -1, 1 ) * randRange( 2, 3 )</var>
+ <var id="SA" data-ensure="abs( SA * AX ) &lt; 8 && abs( SA * AY ) &lt; 8">randRangeNonZero( -1, 1 ) * randRange( 2, 3 )</var>
<var id="BX">randRangeNonZero( -7, 7 )</var>
<var id="BY">randRangeNonZero( -7, 7 )</var>
@@ -52,14 +52,14 @@
<var id="DX, DY">SHUF[2]</var>
<var id="EX, EY">SHUF[3]</var>
- <var id="BOX" data-ensure="abs( BX + BOX ) < 9">randRangeNonZero( -9, 9 )</var>
- <var id="BOY" data-ensure="abs( BY + BOY ) < 9">randRangeNonZero( -9, 9 )</var>
- <var id="COX" data-ensure="abs( CX + COX ) < 9">randRangeNonZero( -9, 9 )</var>
- <var id="COY" data-ensure="abs( CY + COY ) < 9">randRangeNonZero( -9, 9 )</var>
- <var id="DOX" data-ensure="abs( DX + DOX ) < 9">randRangeNonZero( -9, 9 )</var>
- <var id="DOY" data-ensure="abs( DY + DOY ) < 9">randRangeNonZero( -9, 9 )</var>
- <var id="EOX" data-ensure="abs( EX + EOX ) < 9">randRangeNonZero( -9, 9 )</var>
- <var id="EOY" data-ensure="abs( EY + EOY ) < 9">randRangeNonZero( -9, 9 )</var>
+ <var id="BOX" data-ensure="abs( BX + BOX ) &lt; 9">randRangeNonZero( -9, 9 )</var>
+ <var id="BOY" data-ensure="abs( BY + BOY ) &lt; 9">randRangeNonZero( -9, 9 )</var>
+ <var id="COX" data-ensure="abs( CX + COX ) &lt; 9">randRangeNonZero( -9, 9 )</var>
+ <var id="COY" data-ensure="abs( CY + COY ) &lt; 9">randRangeNonZero( -9, 9 )</var>
+ <var id="DOX" data-ensure="abs( DX + DOX ) &lt; 9">randRangeNonZero( -9, 9 )</var>
+ <var id="DOY" data-ensure="abs( DY + DOY ) &lt; 9">randRangeNonZero( -9, 9 )</var>
+ <var id="EOX" data-ensure="abs( EX + EOX ) &lt; 9">randRangeNonZero( -9, 9 )</var>
+ <var id="EOY" data-ensure="abs( EY + EOY ) &lt; 9">randRangeNonZero( -9, 9 )</var>
</div>
<div class="problems">
@@ -72,7 +72,7 @@
range: 10,
scale: 20,
tickStep: 1,
- axisArrows: "<->"
+ axisArrows: "&lt;->"
});
style({
@@ -84,7 +84,7 @@
do {
var AOX = randRange( -9, 9 );
var AOY = randRange( -9, 9 );
- } while ( 0 < abs( AOX + AX ) && abs( AOX + AX ) < 9 );
+ } while ( 0 &lt; abs( AOX + AX ) && abs( AOX + AX ) &lt; 9 );
line( [0, 0], [AX, AY], { arrows: "->" } );
label( [AF * AX, AF * AY], "\\vec a" );
View
12 exercises/signs_of_a_parabola.html
@@ -6,7 +6,7 @@
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="( A != 0 ) && -10 < C && C < 10 ">
+ <div class="vars" data-ensure="( A != 0 ) && -10 &lt; C && C &lt; 10 ">
<!-- Pick a random top point and coefficient A -->
<!-- This makes it easy to spot whether B is zero or not. -->
<var id="A"> randRange( -5, 5 ) </var>
@@ -44,8 +44,8 @@
<div class="solution" data-type="multiple">
<p><code>a</code> is <span class="sol" data-type="list" data-choices="['positive', 'zero', 'negative']"><var>(A > 0) ? 'positive' : 'negative' </var></span></p>
- <p><code>b</code> is <span class="sol" data-type="list" data-choices="['positive', 'zero', 'negative']"><var>(B > 0) ? 'positive' : ( (B < 0) ? 'negative' : 'zero' )</var></span></p>
- <p><code>c</code> is <span class="sol" data-type="list" data-choices="['positive', 'zero', 'negative']"><var>(C > 0) ? 'positive' : ( (C < 0) ? 'negative' : 'zero' )</var></span></p>
+ <p><code>b</code> is <span class="sol" data-type="list" data-choices="['positive', 'zero', 'negative']"><var>(B > 0) ? 'positive' : ( (B &lt; 0) ? 'negative' : 'zero' )</var></span></p>
+ <p><code>c</code> is <span class="sol" data-type="list" data-choices="['positive', 'zero', 'negative']"><var>(C > 0) ? 'positive' : ( (C &lt; 0) ? 'negative' : 'zero' )</var></span></p>
</div>
<div class="hints">
@@ -54,15 +54,15 @@
<p>The parabola is <var>( A > 0) ? "smiling" : "frowning"</var> thus <code>a</code> is <var>( A > 0 ) ? "positive" : "negative"</var>.</p>
<p>The number <code>c</code> determines where the parabola intersects the <code>y</code>-axis. Is the positive or negative part?</p>
<p>If the parabola intersected the positive part of the <code>y</code>-axis, then <code>c</code> would be positive.</p>
- <p>The parabola intersects the <code>y</code>-axis in the point <code>(0,c) = (0,<var>C</var>)</code>, thus <code>c</code> is <var>( C > 0 ) ? 'positive' : ( (C<0) ? 'negative' : 'zero' )</var>.</p>
+ <p>The parabola intersects the <code>y</code>-axis in the point <code>(0,c) = (0,<var>C</var>)</code>, thus <code>c</code> is <var>( C > 0 ) ? 'positive' : ( (C &lt; 0) ? 'negative' : 'zero' )</var>.</p>
<p>The number <code>b</code> determines how the parabola intersects the <code>y</code>-axis. Imagine the tangent at the intersection. What is the slope?</p>
<div class="graphie" data-update="grid">
style({ stroke: "#FF8800", strokeWidth: 2});
line( [ -10, F( -10 )], [ 10, F( 10 )]);
</div>
<p>The tangent where the parabola intersects the <code>y</code>-axis was drawn in orange. The number <code>b</code> is the slope.</p>
- <p>The tangent has a <var>(B > 0) ? 'positive' : ( (B < 0) ? 'negative' : 'zero' )</var> slope, so <code>b</code> is <var>(B > 0) ? 'positive' : ( (B < 0) ? 'negative' : 'zero' )</var>.</p>
- <p><code>a</code> is <var>( A > 0 ) ? "positive" : "negative"</var>, <code>b</code> is <var>(B > 0) ? 'positive' : ( (B < 0) ? 'negative' : 'zero' )</var>, and <code>c</code> is <var>(C > 0) ? 'positive' : ( (C < 0) ? 'negative' : 'zero' )</var>.</p>
+ <p>The tangent has a <var>(B > 0) ? 'positive' : ( (B &lt; 0) ? 'negative' : 'zero' )</var> slope, so <code>b</code> is <var>(B > 0) ? 'positive' : ( (B &lt; 0) ? 'negative' : 'zero' )</var>.</p>
+ <p><code>a</code> is <var>( A > 0 ) ? "positive" : "negative"</var>, <code>b</code> is <var>(B > 0) ? 'positive' : ( (B &lt; 0) ? 'negative' : 'zero' )</var>, and <code>c</code> is <var>(C > 0) ? 'positive' : ( (C &lt; 0) ? 'negative' : 'zero' )</var>.</p>
</div>
</div>
</div>
View
6 exercises/slope_of_a_line.html
@@ -63,7 +63,7 @@
});
style({ fill: BLUE, stroke: BLUE });
line( [ -1,-1 ], [ 1,4 ] );
- label([0,-4], "\\color{<var>BLUE</var>}{\\text{Airplane Taking Off}}", "below");
+ label([0,-4], "\\color{" + BLUE + "}{\\text{Airplane Taking Off}}", "below");
</div>
<div class="graphie" style="float: left; margin: 8px;">
graphInit({
@@ -74,7 +74,7 @@
});
style({ fill: GREEN, stroke: GREEN });
line( [ 0, 2 ], [ 2, -1 ] );
- label([0,-4], "\\color{<var>GREEN</var>}{\\text{Airplane Landing}}", "below");
+ label([0,-4], "\\color{" + GREEN + "}{\\text{Airplane Landing}}", "below");
</div>
</div>
</div>
@@ -146,7 +146,7 @@
});
style({ stroke: COLORS[index].hex });
- label([0,-6], "\\color{<var>" + COLORS[index].hex + "</var>}" +
+ label([0,-6], "\\color{" + COLORS[index].hex + "}" +
"{\\text{" + COLORS[index].name + "}}", "below");
plot(function( x ) {
return ( x - 1 ) * SLOPES[index].value + B;
View
2 exercises/subtraction_1.html
@@ -21,7 +21,7 @@
});
label( [0, 0],
- "\\Huge{\\color{#6495ED}{ <var>A</var> } - \\color{#FFA500}{ <var>B</var> } = {?}}",
+ "\\Huge{\\color{#6495ED}{" + A + "} - \\color{#28AE7B}{" + B + "} = {?}}",
"right" );
</div>
</div>

0 comments on commit f065d79

Please sign in to comment.