Permalink
Browse files

HTML5 ampersands are fine as long as they are not ambiguous

  • Loading branch information...
1 parent 7762690 commit e7642f840b7176d2e7ba7c0ff27b92b2ab53be27 @spicyj spicyj committed Jun 24, 2011
View
16 exercises/adding_decimals.html
@@ -36,16 +36,16 @@
<!-- third addition -->
<p data-if="ADDITION_TABLE[2]"><code><var>A_ARRAY[2]</var> + <var>B_ARRAY[2]</var> + <var>ADDITION_TABLE[2]</var> = <var>A_ARRAY[2] + B_ARRAY[2] + ADDITION_TABLE[2]</var></code></p>
<p data-else><code><var>A_ARRAY[2]</var> + <var>B_ARRAY[2]</var> = <var>A_ARRAY[2] + B_ARRAY[2]</var></code></p>
- <p data-if="ADDITION_TABLE[3] &amp;&amp; ( A_ARRAY[3] || B_ARRAY[3] )">carry <code><var>ADDITION_TABLE[3]</var></code></p>
+ <p data-if="ADDITION_TABLE[3] && ( A_ARRAY[3] || B_ARRAY[3] )">carry <code><var>ADDITION_TABLE[3]</var></code></p>
<!-- fourth addition -->
- <p data-if="ADDITION_TABLE[3] &amp;&amp; A_ARRAY[3] &amp;&amp; B_ARRAY[3]"><code><var>A_ARRAY[3]</var> + <var>B_ARRAY[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>A_ARRAY[3] + B_ARRAY[3] + ADDITION_TABLE[3]</var></code></p>
- <p data-if="!ADDITION_TABLE[3] &amp;&amp; A_ARRAY[3] &amp;&amp; B_ARRAY[3]"><code><var>A_ARRAY[3]</var> + <var>B_ARRAY[3]</var> = <var>A_ARRAY[3] + B_ARRAY[3]</var></code></p>
- <p data-if="ADDITION_TABLE[3] &amp;&amp; A_ARRAY[3] &amp;&amp; !B_ARRAY[3]"><code><var>A_ARRAY[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>A_ARRAY[3] + ADDITION_TABLE[3]</var></code></p>
- <p data-if="ADDITION_TABLE[3] &amp;&amp; !A_ARRAY[3] &amp;&amp; B_ARRAY[3]"><code><var>B_ARRAY[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>B_ARRAY[3] + ADDITION_TABLE[3]</var></code></p>
- <p data-if="ADDITION_TABLE[4] &amp;&amp; ( A_ARRAY[4] || B_ARRAY[4] )">carry <code><var>ADDITION_TABLE[4]</var></code></p>
+ <p data-if="ADDITION_TABLE[3] && _ARRAY[3] && _ARRAY[3]"><code><var>A_ARRAY[3]</var> + <var>B_ARRAY[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>A_ARRAY[3] + B_ARRAY[3] + ADDITION_TABLE[3]</var></code></p>
+ <p data-if="!ADDITION_TABLE[3] && _ARRAY[3] && _ARRAY[3]"><code><var>A_ARRAY[3]</var> + <var>B_ARRAY[3]</var> = <var>A_ARRAY[3] + B_ARRAY[3]</var></code></p>
+ <p data-if="ADDITION_TABLE[3] && _ARRAY[3] && !B_ARRAY[3]"><code><var>A_ARRAY[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>A_ARRAY[3] + ADDITION_TABLE[3]</var></code></p>
+ <p data-if="ADDITION_TABLE[3] && !A_ARRAY[3] && _ARRAY[3]"><code><var>B_ARRAY[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>B_ARRAY[3] + ADDITION_TABLE[3]</var></code></p>
+ <p data-if="ADDITION_TABLE[4] && ( A_ARRAY[4] || B_ARRAY[4] )">carry <code><var>ADDITION_TABLE[4]</var></code></p>
<!-- fourth addition -->
- <p data-if="ADDITION_TABLE[3] &amp;&amp; A_ARRAY[4] &amp;&amp; B_ARRAY[4]"><code><var>A_ARRAY[4]</var> + <var>B_ARRAY[4]</var> + <var>ADDITION_TABLE[4]</var> = <var>A_ARRAY[4] + B_ARRAY[4] + ADDITION_TABLE[4]</var></code></p>
- <p data-if="!ADDITION_TABLE[3] &amp;&amp; A_ARRAY[4] &amp;&amp; B_ARRAY[4]"><code><var>A_ARRAY[4]</var> + <var>B_ARRAY[4]</var> = <var>A_ARRAY[4] + B_ARRAY[4]</var></code></p>
+ <p data-if="ADDITION_TABLE[3] && _ARRAY[4] && _ARRAY[4]"><code><var>A_ARRAY[4]</var> + <var>B_ARRAY[4]</var> + <var>ADDITION_TABLE[4]</var> = <var>A_ARRAY[4] + B_ARRAY[4] + ADDITION_TABLE[4]</var></code></p>
+ <p data-if="!ADDITION_TABLE[3] && _ARRAY[4] && _ARRAY[4]"><code><var>A_ARRAY[4]</var> + <var>B_ARRAY[4]</var> = <var>A_ARRAY[4] + B_ARRAY[4]</var></code></p>
<p>Pull down the rest</p>
<p>The final result is <code><var>A+B</var></code></p>
</div>
View
2 exercises/age_word_problems.html
@@ -162,7 +162,7 @@
</div>
<div id="solve-single-5" data-weight="2">
- <div class="vars" data-ensure="A <= 80 &amp;&amp; B >= 2">
+ <div class="vars" data-ensure="A <= 80 && >= 2">
<var id="C">randRange(3, 5)</var>
<var id="B">randRange(1, 10) * (C - 1)</var>
<var id="A">randRange(C * B + 1, 15) * (C - 1)</var>
View
2 exercises/arithmetic_word_problems.html
@@ -101,7 +101,7 @@
<div>
- <div class="vars" data-ensure="!isPrime( TOTAL_ITEMS ) &amp;&amp; NEW_ITEMS !== ITEMS">
+ <div class="vars" data-ensure="!isPrime( TOTAL_ITEMS ) && EW_ITEMS !== ITEMS">
<var id="TOTAL_ITEMS">randRange( 10, 99 )</var>
<var id="ITEMS">getNontrivialFactor( TOTAL_ITEMS )</var>
<var id="GROUPS">TOTAL_ITEMS / ITEMS</var>
View
2 exercises/comparing_fractions_2.html
@@ -12,7 +12,7 @@
-->
<div class="problems">
<div id="original">
- <div class="vars" data-ensure="NUM_1 !== NUM_2 &amp;&amp; DEN_1 !== DEN_2">
+ <div class="vars" data-ensure="NUM_1 !== NUM_2 && EN_1 !== DEN_2">
<var id="FACTOR">randRange( 2, 3 )</var>
<var id="NUM_1">randRange( 1, 14 )</var>
<var id="NUM_2">randRange( 1, 14 )</var>
View
20 exercises/determinants_1.html
@@ -17,34 +17,34 @@
<div>
<div class="question">
<p>If <code>A = \begin{bmatrix}
- <var>A</var> &amp; <var>B</var> \\
- <var>C</var> &amp; <var>D</var>
+ <var>A</var> & <var>B</var> \\
+ <var>C</var> & <var>D</var>
\end{bmatrix}</code>, find <code>\det(A)</code>.</p>
</div>
<div class="solution"><var>A * D - B * C</var></div>
</div>
<div>
<div class="question">
<p>Find <code>\begin{vmatrix}
- <var>A</var> &amp; <var>B</var> \\
- <var>C</var> &amp; <var>D</var>
+ <var>A</var> & <var>B</var> \\
+ <var>C</var> & <var>D</var>
\end{vmatrix}</code>.</p>
</div>
<div class="solution"><var>A * D - B * C</var></div>
</div>
</div>
<div class="hints">
<p><code>\begin{vmatrix}
- \color{red}{<var>A</var>} &amp; \color{purple}{<var>B</var>} \\
- \color{blue}{<var>C</var>} &amp; \color{green}{<var>D</var>}
+ \color{red}{<var>A</var>} & \color{purple}{<var>B</var>} \\
+ \color{blue}{<var>C</var>} & \color{green}{<var>D</var>}
\end{vmatrix} = \color{red}{<var>negParens(A)</var>} \cdot \color{green}{<var>negParens(D)</var>} - \color{blue}{<var>negParens(C)</var>} \cdot \color{purple}{<var>negParens(B)</var>}</code></p>
<p><code>\hphantom{\begin{vmatrix}
- <var>A</var> &amp; <var>B</var> \\
- <var>C</var> &amp; <var>D</var>
+ <var>A</var> & <var>B</var> \\
+ <var>C</var> & <var>D</var>
\end{vmatrix}} = <var>A * D</var> - <var>negParens(B * C)</var></code></p>
<p><code>\hphantom{\begin{vmatrix}
- <var>A</var> &amp; <var>B</var> \\
- <var>C</var> &amp; <var>D</var>
+ <var>A</var> & <var>B</var> \\
+ <var>C</var> & <var>D</var>
\end{vmatrix}} = <var>A * D - B * C</var></code></p>
</div>
</div>
View
2 exercises/dividing_fractions.html
@@ -6,7 +6,7 @@
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="getGCD(A, B) === 1 &amp;&amp; getGCD(C, D) === 1">
+ <div class="vars" data-ensure="getGCD(A, B) === 1 && etGCD(C, D) === 1">
<var id="NEG1">randFromArray([1, -1])</var>
<var id="NEG1S">NEG1 === -1 ? "-" : ""</var>
<var id="A">randRange(1, 9)</var>
View
2 exercises/divisibility_intro.html
@@ -18,7 +18,7 @@
num_factors = round( factorization.length / 2 ),
answer = 1;
- for (var i = 0; i &lt; num_factors &amp;&amp; factorization.length; i++) {
+ for (var i = 0; i &lt; num_factors && actorization.length; i++) {
var index = floor( random() * factorization.length );
answer *= factorization[index];
factorization = jQuery.merge( factorization.slice(0, index), factorization.slice(index + 1) );
View
2 exercises/equation_of_a_line.html
@@ -6,7 +6,7 @@
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="Math.pow(Y1 - Y2, 2) + Math.pow(X1 - X2, 2) < 36 &amp;&amp; X1 < X2 &amp;&amp; -10 <= B &amp;&amp; B <= 10">
+ <div class="vars" data-ensure="Math.pow(Y1 - Y2, 2) + Math.pow(X1 - X2, 2) < 36 && 1 < X2 && -10 <= B && <= 10">
<var id="X1">randRange(-9, 9)</var>
<var id="Y1">randRange(-9, 9)</var>
View
6 exercises/exponents_1.html
@@ -61,9 +61,9 @@
<var id="NEG_ONE_HINT">BASE > 0 ? "" : ( isEven( EXP ) ? "even" : "odd" )</var>
<var id="HINT1">EXP === 0</var>
- <var id="HINT2">!HINT1 &amp;&amp; EXP === 1</var>
- <var id="HINT3">!HINT1 &amp;&amp; !HINT2 &amp;&amp; ( BASE === 0 || BASE === 1 || BASE === -1 )</var>
- <var id="HINT4">!HINT1 &amp;&amp; !HINT2 &amp;&amp; !HINT3</var>
+ <var id="HINT2">!HINT1 && XP === 1</var>
+ <var id="HINT3">!HINT1 && !HINT2 && ( BASE === 0 || BASE === 1 || BASE === -1 )</var>
+ <var id="HINT4">!HINT1 && !HINT2 && !HINT3</var>
</div>
<p class="question"><code><var>negParens( BASE )</var>^{<var>EXP</var>}</code></p>
View
2 exercises/exponents_2.html
@@ -67,7 +67,7 @@
<div class="hints">
<!-- FIXME: could be made nicer with ifs that unwrap -->
- <p data-if="abs( EXP ) > 1 &amp;&amp; EXP_NEG"><code>= <var>fracParens( BASEF_N, BASEF_D )</var>^{<var>EXP</var>}</code></p>
+ <p data-if="abs( EXP ) > 1 && XP_NEG"><code>= <var>fracParens( BASEF_N, BASEF_D )</var>^{<var>EXP</var>}</code></p>
<p data-if="abs( EXP ) > 1" data-each="expandFractionExponent( BASEF_N, BASEF_D, EXP ) as v"><code>= <var>v</var></code></p>
<p data-else><code>= <var>frac( SOL_N, SOL_D )</var></code></p>
</div>
View
6 exercises/exponents_4.html
@@ -17,7 +17,7 @@
<var id="EXP_NEG">random() < .75</var>
<var id="EXP_D_ORIG">VALS.root</var>
- <var id="BASE_NEG">isOdd( EXP_D ) &amp;&amp; ( random() < .75 )</var>
+ <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>
@@ -46,7 +46,7 @@
<var id="ROOT_N">round( pow( EXP_NEG ? BASE_D : BASE_N, 1 / EXP_D ) )</var>
<var id="ROOT_D">round( pow( EXP_NEG ? BASE_N : BASE_D, 1 / EXP_D ) )</var>
- <var id="SOL_NEG">ROOT_NEG &amp;&amp; isOdd( EXP_N )</var>
+ <var id="SOL_NEG">ROOT_NEG && sOdd( EXP_N )</var>
<var id="SOL_N">round( pow( ROOT_N, EXP_N ) )</var>
<var id="SOL_D">round( pow( ROOT_D, EXP_N ) )</var>
</div>
@@ -75,7 +75,7 @@
<!-- "So (4/9)^(3/2)=((4/9)^(1/2))^3=(2/3)^3" -->
<p 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></p>
- <p data-if="EXP_N > 1 &amp;&amp; reduces( ROOT_N, ROOT_D )"><code>= <var>fraction( ROOT_N, ROOT_D, true, true, false, true )</var>^{<var>EXP_N</var>}</code></p>
+ <p data-if="EXP_N > 1 && educes( ROOT_N, ROOT_D )"><code>= <var>fraction( ROOT_N, ROOT_D, true, true, false, true )</var>^{<var>EXP_N</var>}</code></p>
<!-- "=(2/3)(2/3)(2/3)" -->
<p data-if="EXP_N > 1" data-each="expandFractionExponent( ROOT_N, ROOT_D, EXP_N ) as v"><code>= <var>v</var></code></p>
View
8 exercises/functions_1.html
@@ -18,16 +18,16 @@
functionPath.push([ -11, randRange( -5, 5 ) ]);
for( var i = -10; i < 11; i++ ) {
- if ( abs( randRangeNonZero( -10, 10 ) < 2 ) &amp;&amp; functionPath[i+10][1] < 8 ) {
+ if ( abs( randRangeNonZero( -10, 10 ) < 2 ) && unctionPath[i+10][1] < 8 ) {
functionPath.push([i, functionPath[i+10][1]+1]);
- } else if ( abs( randRangeNonZero( -10, 10 ) < 2 ) &amp;&amp; functionPath[i+10][1] > -8 ) {
+ } else if ( abs( randRangeNonZero( -10, 10 ) < 2 ) && unctionPath[i+10][1] > -8 ) {
functionPath.push([i, functionPath[i+10][1]-1]);
- } else if ( abs( randRangeNonZero( -10, 10 ) < 2 ) &amp;&amp; functionPath[i+10][1] < 7 ) {
+ } else if ( abs( randRangeNonZero( -10, 10 ) < 2 ) && unctionPath[i+10][1] < 7 ) {
functionPath.push([i, functionPath[i+10][1]+2]);
- } else if ( abs( randRangeNonZero( -10, 10 ) < 3 ) &amp;&amp; functionPath[i+10][1] > -7 ) {
+ } else if ( abs( randRangeNonZero( -10, 10 ) < 3 ) && unctionPath[i+10][1] > -7 ) {
functionPath.push([i, functionPath[i+10][1]-2]);
} else {
View
16 exercises/functions_2.html
@@ -24,16 +24,16 @@
functionPath.push([-11, currentY]);
for( var i = -10; i < 11; i++ ) {
- if (Math.abs( randRangeNonZero( -10, 10 ) < 2 ) &amp;&amp; functionPath[i+10][1] < 8 ) {
+ if (Math.abs( randRangeNonZero( -10, 10 ) < 2 ) && unctionPath[i+10][1] < 8 ) {
functionPath.push([ i, functionPath[i+10][1]+1 ]);
- } else if (Math.abs( randRangeNonZero( -10, 10 ) < 2 ) &amp;&amp; functionPath[i+10][1] > -8 ) {
+ } else if (Math.abs( randRangeNonZero( -10, 10 ) < 2 ) && unctionPath[i+10][1] > -8 ) {
functionPath.push([ i, functionPath[i+10][1]-1 ]);
- } else if (Math.abs( randRangeNonZero( -10, 10 ) < 2 ) &amp;&amp; functionPath[i+10][1] < 7 ) {
+ } else if (Math.abs( randRangeNonZero( -10, 10 ) < 2 ) && unctionPath[i+10][1] < 7 ) {
functionPath.push([ i, functionPath[i+10][1]+2 ]);
- } else if (Math.abs( randRangeNonZero( -10, 10 ) < 3 ) &amp;&amp; functionPath[i+10][1] > -7 ) {
+ } else if (Math.abs( randRangeNonZero( -10, 10 ) < 3 ) && unctionPath[i+10][1] > -7 ) {
functionPath.push([ i, functionPath[i+10][1]-2 ]);
} else {
@@ -51,16 +51,16 @@
gPath.push([-11, gY]);
for( var i = -10; i < 11; i++ ) {
- if (Math.abs( randRangeNonZero( -10, 10 ) < 2 ) &amp;&amp; gPath[i+10][1] < 8 ) {
+ if (Math.abs( randRangeNonZero( -10, 10 ) < 2 ) && Path[i+10][1] < 8 ) {
gPath.push([i, gPath[i+10][1]+1]);
- } else if (Math.abs( randRangeNonZero( -10, 10 ) < 3 ) &amp;&amp; gPath[i+10][1] > -8 ) {
+ } else if (Math.abs( randRangeNonZero( -10, 10 ) < 3 ) && Path[i+10][1] > -8 ) {
gPath.push([i, gPath[i+10][1]-1]);
- } else if (Math.abs( randRangeNonZero( -10, 10 ) < 2 ) &amp;&amp; gPath[i+10][1] < 7 ) {
+ } else if (Math.abs( randRangeNonZero( -10, 10 ) < 2 ) && Path[i+10][1] < 7 ) {
gPath.push([i, gPath[i+10][1]+2]);
- } else if (Math.abs( randRangeNonZero( -10, 10 ) < 3 ) &amp;&amp; gPath[i+10][1] > -7 ) {
+ } else if (Math.abs( randRangeNonZero( -10, 10 ) < 3 ) && Path[i+10][1] > -7 ) {
gPath.push([i, gPath[i+10][1]-2]);
} else {
View
4 exercises/functions_3.html
@@ -6,7 +6,7 @@
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="INNER.name !== OUTER.name &amp;&amp; INNER.minDegree <= INNER.maxDegree &amp;&amp; OUTER.minDegree <= OUTER.maxDegree">
+ <div class="vars" data-ensure="INNER.name !== OUTER.name && NNER.minDegree <= INNER.maxDegree && UTER.minDegree <= OUTER.maxDegree">
<var id="FUNC_NAMES">["f", "g", "h"]</var>
<var id="FUNC_VARIABLES">["x", "n", "t"]</var>
@@ -42,7 +42,7 @@
</div>
<div>
- <div class="vars" data-ensure="OUTER2.name !== INNER.name &amp;&amp; OUTER2.name !== OUTER.name &amp;&amp; OUTER2.minDegree <= OUTER2.maxDegree">
+ <div class="vars" data-ensure="OUTER2.name !== INNER.name && UTER2.name !== OUTER.name && UTER2.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>
View
2 exercises/graphing_points.html
@@ -15,7 +15,7 @@
var point = [ randRange( -9, 9 ), randRange( -9, 9 ) ];
var isUnique = true;
jQuery.each( points, function( index, pt ) {
- if ( point[0] === pt[0] &amp;&amp; point[1] === pt[1] ) {
+ if ( point[0] === pt[0] && oint[1] === pt[1] ) {
isUnique = false;
return false;
}
View
10 exercises/kinematic_equations.html
@@ -15,11 +15,11 @@
<div class="problems">
<div>
<div class="problem">
- <p data-if="'d' !== OMITTED &amp;&amp; 'd' !== UNKNOWN"><code>d = <var>u(MOTION, "d")</var></code></p>
- <p data-if="'v_i' !== OMITTED &amp;&amp; 'v_i' !== UNKNOWN"><code>v_i = <var>u(MOTION, "v_i")</var></code></p>
- <p data-if="'v_f' !== OMITTED &amp;&amp; 'v_f' !== UNKNOWN"><code>v_f = <var>u(MOTION, "v_f")</var></code></p>
- <p data-if="'a' !== OMITTED &amp;&amp; 'a' !== UNKNOWN"><code>a = <var>u(MOTION, "a")</var></code></p>
- <p data-if="'t' !== OMITTED &amp;&amp; 't' !== UNKNOWN"><code>t = <var>u(MOTION, "t")</var></code></p>
+ <p data-if="'d' !== OMITTED && 'd' !== UNKNOWN"><code>d = <var>u(MOTION, "d")</var></code></p>
+ <p data-if="'v_i' !== OMITTED && 'v_i' !== UNKNOWN"><code>v_i = <var>u(MOTION, "v_i")</var></code></p>
+ <p data-if="'v_f' !== OMITTED && 'v_f' !== UNKNOWN"><code>v_f = <var>u(MOTION, "v_f")</var></code></p>
+ <p data-if="'a' !== OMITTED && 'a' !== UNKNOWN"><code>a = <var>u(MOTION, "a")</var></code></p>
+ <p data-if="'t' !== OMITTED && 't' !== UNKNOWN"><code>t = <var>u(MOTION, "t")</var></code></p>
<p><code><var>OMITTED</var> = ?</code></p>
<p><code><var>UNKNOWN</var> = ?</code></p>
View
8 exercises/limits_1.html
@@ -96,11 +96,11 @@
</div>
<p><code>\begin{align*}
- \lim_{x\to<var>a</var>} f(x) &amp; \\
- \text{where} \quad f(x) &amp; = \left \{
+ \lim_{x\to<var>a</var>} f(x) & \\
+ \text{where} \quad f(x) & = \left \{
\begin{array}{1 1}
- <var>d_line</var> &amp;\quad \text{if} \quad x \neq <var>a</var>\\
- <var>d_cons</var> &amp;\quad \text{if} \quad x = <var>a</var>\\
+ <var>d_line</var> & \quad \text{if} \quad x \neq <var>a</var>\\
+ <var>d_cons</var> & \quad \text{if} \quad x = <var>a</var>\\
\end{array} \right.
\end{align*}</code></p>
<div class="graph" style="width: 400px; height: 400px;" data-style="font-size: 15px; font-family: sans-serif; font-style: bold; stroke: blue;" data-graph-type="plane">
View
2 exercises/line_graph_intuition.html
@@ -50,7 +50,7 @@
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="X1 !== X2 &amp;&amp; !(M === 1 &amp;&amp; B === 0)">
+ <div class="vars" data-ensure="X1 !== X2 && !(M === 1 && === 0)">
<var id="X1">randRange( -8, 8 )</var>
<var id="X2">randRange( -8, 8 )</var>
<var id="Y1">randRange( -8, 8 )</var>
View
2 exercises/line_relationships.html
@@ -8,7 +8,7 @@
<div class="exercise">
<div class="problems">
<div id="different-lines">
- <div class="vars" data-ensure="A1 / B1 !== A2 / B2 &amp;&amp; A1 / B1 !== -A2 / B2">
+ <div class="vars" data-ensure="A1 / B1 !== A2 / B2 && 1 / B1 !== -A2 / B2">
<var id="A1">randRangeNonZero( -5, 5 )</var>
<var id="A2">randRangeNonZero( -5, 5 )</var>
<var id="B1">randRangeNonZero( -5, 5 )</var>
View
2 exercises/midpoint_formula.html
@@ -20,7 +20,7 @@
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="X1 != Y1 &amp;&amp; X2 != Y2">
+ <div class="vars" data-ensure="X1 != Y1 && 2 != Y2">
<var id="X1">randRange( -9, 7 )</var>
<var id="X2">randRange( -9, 7 )</var>
<var id="Y1">randRange( -9, 8 )</var>
View
14 exercises/multiplication_4.html
@@ -67,15 +67,15 @@
<p data-if="ADDITION_TABLE[3]">carry <var>ADDITION_TABLE[3]</var></p>
<!-- fourth addition -->
<!-- there is a fourth digit in DIGITS-->
- <p data-if="DIGITS[3] &amp;&amp; ADDITION_TABLE[3]"><var>DIGITS[3]</var> + <var>EX_DIGITS2[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>DIGITS[3] + EX_DIGITS2[3] + ADDITION_TABLE[3]</var></p>
+ <p data-if="DIGITS[3] && DDITION_TABLE[3]"><var>DIGITS[3]</var> + <var>EX_DIGITS2[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>DIGITS[3] + EX_DIGITS2[3] + ADDITION_TABLE[3]</var></p>
<p data-else data-if="DIGITS[3]"><var>DIGITS[3]</var> + <var>EX_DIGITS2[3]</var> = <var>DIGITS[3] + EX_DIGITS2[3]</var></p>
- <p data-if="DIGITS[3] &amp;&amp; ADDITION_TABLE[4] &amp;&amp; EX_DIGITS2[4]">carry <var>ADDITION_TABLE[4]</var></p>
- <p data-if="DIGITS[3] &amp;&amp; ADDITION_TABLE[4] &amp;&amp; EX_DIGITS2[4]"><var>ADDITION_TABLE[4]</var> + <var>EX_DIGITS2[4]</var> = <var>EX_DIGITS2[4] + ADDITION_TABLE[4]</var></p>
- <p data-if="DIGITS[3] &amp;&amp; !ADDITION_TABLE[4] &amp;&amp; EX_DIGITS2[4]">pull down <var>EX_DIGITS2[4]</var></p>
+ <p data-if="DIGITS[3] && DDITION_TABLE[4] && X_DIGITS2[4]">carry <var>ADDITION_TABLE[4]</var></p>
+ <p data-if="DIGITS[3] && DDITION_TABLE[4] && X_DIGITS2[4]"><var>ADDITION_TABLE[4]</var> + <var>EX_DIGITS2[4]</var> = <var>EX_DIGITS2[4] + ADDITION_TABLE[4]</var></p>
+ <p data-if="DIGITS[3] && !ADDITION_TABLE[4] && X_DIGITS2[4]">pull down <var>EX_DIGITS2[4]</var></p>
<!-- there is no fourth digit in DIGITS-->
- <p data-if="!DIGITS[3] &amp;&amp; ADDITION_TABLE[3]"><var>EX_DIGITS2[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>EX_DIGITS2[3] + ADDITION_TABLE[3]</var></p>
- <p data-if="!DIGITS[3] &amp;&amp; !ADDITION_TABLE[3]">pull down <var>EX_DIGITS2[4]</var><var>EX_DIGITS2[3]</var></p>
- <p data-if="!DIGITS[3] &amp;&amp; ADDITION_TABLE[3] &amp;&amp; EX_DIGITS2[4]">pull down <var>EX_DIGITS2[4]</var></p>
+ <p data-if="!DIGITS[3] && DDITION_TABLE[3]"><var>EX_DIGITS2[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>EX_DIGITS2[3] + ADDITION_TABLE[3]</var></p>
+ <p data-if="!DIGITS[3] && !ADDITION_TABLE[3]">pull down <var>EX_DIGITS2[4]</var><var>EX_DIGITS2[3]</var></p>
+ <p data-if="!DIGITS[3] && DDITION_TABLE[3] && X_DIGITS2[4]">pull down <var>EX_DIGITS2[4]</var></p>
<p>The final result is <var>A*B</var></p>
</div>
</div>
View
6 exercises/multiplying_and_dividing_negative_numbers.html
@@ -6,7 +6,7 @@
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="(A < 0 || B < 0) &amp;&amp; B != 0">
+ <div class="vars" data-ensure="(A < 0 || B < 0) && != 0">
<var id="A">rand( 18 ) - 9</var>
<var id="B">rand( 18 ) - 9</var>
<var id="C">A * B</var>
@@ -17,7 +17,7 @@
<p class="question"><code><var>A</var> \times <var>B</var> = </code> ?</p>
<div class="solution"><var>C</var></div>
<div class="hints">
- <p data-if="A < 0 &amp;&amp; B < 0">A negative times a negative is a positive.</p>
+ <p data-if="A < 0 && < 0">A negative times a negative is a positive.</p>
<p data-else data-if="A < 0">A negative times a positive is a negative.</p>
<p data-else>A positive times a negative is a negative.</p>
<p><code><var>A</var> \times <var>B</var> = <var>C</var></code></p>
@@ -28,7 +28,7 @@
<p class="question"><code><var>C</var> \div <var>B</var> = </code> ?</p>
<div class="solution"><var>A</var></div>
<div class="hints">
- <p data-if="C < 0 &amp;&amp; B < 0">A negative divided by a negative is a positive.</p>
+ <p data-if="C < 0 && < 0">A negative divided by a negative is a positive.</p>
<p data-else data-if="C < 0">A negative divided by a positive is a negative.</p>
<p data-else>A positive divided by a negative is a negative.</p>
<p><code><var>C</var> \div <var>B</var> = <var>A</var></code></p>
View
26 exercises/multiplying_decimals.html
@@ -87,24 +87,24 @@
<p data-if="ADDITION_TABLE[3]">carry <var>ADDITION_TABLE[3]</var></p>
<!-- fourth addition -->
<!-- there is a fourth digit in DIGITS-->
- <p data-if="DIGITS[3] &amp;&amp; ADDITION_TABLE[3]"><var>DIGITS[3]</var> + <var>EX_DIGITS2[3]</var> + <var>EX_DIGITS3[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>DIGITS[3] + EX_DIGITS2[3] + EX_DIGITS3[3] + ADDITION_TABLE[3]</var></p>
- <p data-if="DIGITS[3] &amp;&amp; !ADDITION_TABLE[3]"><var>DIGITS[3]</var> + <var>EX_DIGITS2[3]</var> + <var>EX_DIGITS3[3]</var> = <var>DIGITS[3] + EX_DIGITS2[3] + EX_DIGITS3[3]</var></p>
- <p data-if="DIGITS[3] &amp;&amp; ADDITION_TABLE[4]">carry <var>ADDITION_TABLE[4]</var></p>
+ <p data-if="DIGITS[3] && DDITION_TABLE[3]"><var>DIGITS[3]</var> + <var>EX_DIGITS2[3]</var> + <var>EX_DIGITS3[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>DIGITS[3] + EX_DIGITS2[3] + EX_DIGITS3[3] + ADDITION_TABLE[3]</var></p>
+ <p data-if="DIGITS[3] && !ADDITION_TABLE[3]"><var>DIGITS[3]</var> + <var>EX_DIGITS2[3]</var> + <var>EX_DIGITS3[3]</var> = <var>DIGITS[3] + EX_DIGITS2[3] + EX_DIGITS3[3]</var></p>
+ <p data-if="DIGITS[3] && DDITION_TABLE[4]">carry <var>ADDITION_TABLE[4]</var></p>
<!-- there is no fourth digit in DIGITS-->
- <p data-if="!DIGITS[3] &amp;&amp; ADDITION_TABLE[3]"><var>EX_DIGITS2[3]</var> + <var>EX_DIGITS3[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>EX_DIGITS2[3] + EX_DIGITS3[3] + ADDITION_TABLE[3]</var></p>
- <p data-if="!DIGITS[3] &amp;&amp; !ADDITION_TABLE[3]"><var>EX_DIGITS2[3]</var> + <var>EX_DIGITS3[3]</var> = <var>EX_DIGITS2[3] + EX_DIGITS3[3]</var></p>
- <p data-if="!DIGITS[3] &amp;&amp; ADDITION_TABLE[4]">carry <var>ADDITION_TABLE[4]</var></p>
+ <p data-if="!DIGITS[3] && DDITION_TABLE[3]"><var>EX_DIGITS2[3]</var> + <var>EX_DIGITS3[3]</var> + <var>ADDITION_TABLE[3]</var> = <var>EX_DIGITS2[3] + EX_DIGITS3[3] + ADDITION_TABLE[3]</var></p>
+ <p data-if="!DIGITS[3] && !ADDITION_TABLE[3]"><var>EX_DIGITS2[3]</var> + <var>EX_DIGITS3[3]</var> = <var>EX_DIGITS2[3] + EX_DIGITS3[3]</var></p>
+ <p data-if="!DIGITS[3] && DDITION_TABLE[4]">carry <var>ADDITION_TABLE[4]</var></p>
<!-- fifth addition -->
<!-- there is a fifth digit in EX_DIGITS2-->
- <p data-if="EX_DIGITS2[4] &amp;&amp; ADDITION_TABLE[4]"><var>EX_DIGITS2[4]</var> + <var>EX_DIGITS3[4]</var> + <var>ADDITION_TABLE[4]</var> = <var>EX_DIGITS2[4] + EX_DIGITS3[4] + ADDITION_TABLE[4]</var></p>
+ <p data-if="EX_DIGITS2[4] && DDITION_TABLE[4]"><var>EX_DIGITS2[4]</var> + <var>EX_DIGITS3[4]</var> + <var>ADDITION_TABLE[4]</var> = <var>EX_DIGITS2[4] + EX_DIGITS3[4] + ADDITION_TABLE[4]</var></p>
<p data-else data-if="EX_DIGITS2[4]"><var>EX_DIGITS2[4]</var> + <var>EX_DIGITS3[4]</var> = <var>EX_DIGITS2[4] + EX_DIGITS3[4]</var></p>
- <p data-if="EX_DIGITS2[4] &amp;&amp; ADDITION_TABLE[5] &amp;&amp; EX_DIGITS3[5]">carry <var>ADDITION_TABLE[5]</var></p>
- <p data-if="EX_DIGITS2[4] &amp;&amp; ADDITION_TABLE[5] &amp;&amp; EX_DIGITS3[5]"><var>ADDITION_TABLE[5]</var> + <var>EX_DIGITS3[5]</var> = <var>EX_DIGITS3[5] + ADDITION_TABLE[5]</var></p>
- <p data-if="EX_DIGITS2[4] &amp;&amp; !ADDITION_TABLE[5] &amp;&amp; EX_DIGITS3[5]">pull down <var>EX_DIGITS3[5]</var></p>
+ <p data-if="EX_DIGITS2[4] && DDITION_TABLE[5] && X_DIGITS3[5]">carry <var>ADDITION_TABLE[5]</var></p>
+ <p data-if="EX_DIGITS2[4] && DDITION_TABLE[5] && X_DIGITS3[5]"><var>ADDITION_TABLE[5]</var> + <var>EX_DIGITS3[5]</var> = <var>EX_DIGITS3[5] + ADDITION_TABLE[5]</var></p>
+ <p data-if="EX_DIGITS2[4] && !ADDITION_TABLE[5] && X_DIGITS3[5]">pull down <var>EX_DIGITS3[5]</var></p>
<!-- there is no fifth digit in EX_DIGITS2-->
- <p data-if="!EX_DIGITS2[4] &amp;&amp; ADDITION_TABLE[4]"><var>EX_DIGITS3[4]</var> + <var>ADDITION_TABLE[4]</var> = <var>EX_DIGITS3[4] + ADDITION_TABLE[4]</var></p>
- <p data-if="!EX_DIGITS2[4] &amp;&amp; !ADDITION_TABLE[4]">pull down <var>EX_DIGITS3[5]</var><var>EX_DIGITS3[4]</var></p>
- <p data-if="!EX_DIGITS2[4] &amp;&amp; ADDITION_TABLE[4] &amp;&amp; EX_DIGITS3[5]">pull down <var>EX_DIGITS3[5]</var></p>
+ <p data-if="!EX_DIGITS2[4] && DDITION_TABLE[4]"><var>EX_DIGITS3[4]</var> + <var>ADDITION_TABLE[4]</var> = <var>EX_DIGITS3[4] + ADDITION_TABLE[4]</var></p>
+ <p data-if="!EX_DIGITS2[4] && !ADDITION_TABLE[4]">pull down <var>EX_DIGITS3[5]</var><var>EX_DIGITS3[4]</var></p>
+ <p data-if="!EX_DIGITS2[4] && DDITION_TABLE[4] && X_DIGITS3[5]">pull down <var>EX_DIGITS3[5]</var></p>
<p>The sum is <var>RESULT*pow(10, A_SHIFT+B_SHIFT)</var></p>
<p>The first multiplicand has <var>A_SHIFT</var> digits after the decimal.</p>
<p>The second multiplicand has <var>B_SHIFT</var> digits after the decimal.</p>
View
2 exercises/multiplying_fractions.html
@@ -6,7 +6,7 @@
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="getGCD(A, B) === 1 &amp;&amp; getGCD(C, D) === 1">
+ <div class="vars" data-ensure="getGCD(A, B) === 1 && etGCD(C, D) === 1">
<var id="NEG1">randFromArray([1, -1])</var>
<var id="NEG1S">NEG1 === -1 ? "-" : ""</var>
<var id="A">randRange(1, 9)</var>
View
6 exercises/quadratic_formula.html
@@ -27,8 +27,8 @@
var good_gcd = getGCD( A, B, C );
var bad_gcd = getGCD( bad_a, bad_b, bad_c );
- while (( (A*bad_gcd)==(bad_a*good_gcd) &amp;&amp;
- (B*bad_gcd)==(bad_b*good_gcd) &amp;&amp;
+ while (( (A*bad_gcd)==(bad_a*good_gcd) &&
+ (B*bad_gcd)==(bad_b*good_gcd) &&
(C*bad_gcd)==(bad_c*good_gcd) ) ||
(( (bad_b * bad_b) - (4 * bad_a * bad_c) ) < 0))
@@ -88,7 +88,7 @@
</div>
<div>
- <div data-if="DISC_FACTOR[0] > 1 &amp;&amp; abs(DISC_FACTOR[1]) != 1">
+ <div data-if="DISC_FACTOR[0] > 1 && bs(DISC_FACTOR[1]) != 1">
<!-- The number under the radical can be factored as a perfect square and a number (other than 1) times a perfect square -->
<p><code>x = <var>expr(["frac", ["+-", -1 * B, ["sqrt", ["*", DISC_FACTOR[1], DISC_FACTOR[0] ] ]],
2 * A])</var></code></p>
View
2 exercises/slope_of_a_line.html
@@ -6,7 +6,7 @@
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="Math.pow(Y1 - Y2, 2) + Math.pow(X1 - X2, 2) < 36 &amp;&amp; X1 < X2">
+ <div class="vars" data-ensure="Math.pow(Y1 - Y2, 2) + Math.pow(X1 - X2, 2) < 36 && 1 < X2">
<var id="X1">randRange(-9, 9)</var>
<var id="Y1">randRange(-9, 9)</var>
View
2 exercises/solving_for_the_y-intercept.html
@@ -46,7 +46,7 @@
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="X2 !== X1 &amp;&amp; Y2 !== Y1 &amp;&amp; X_MAX >= 0 &amp;&amp; X_MIN <= 0 &amp;&amp; Y_MAX >= 0 &amp;&amp; Y_MIN <= 0">
+ <div class="vars" data-ensure="X2 !== X1 && Y2 !== Y1 && X_MAX >= 0 && X_MIN <= 0 && Y_MAX >= 0 && Y_MIN <= 0">
<var id="X1">randRangeNonZero(-10, 10)</var>
<var id="X2">randRangeNonZero(-10, 10)</var>
<var id="Y1">randRangeNonZero(-10, 10)</var>

0 comments on commit e7642f8

Please sign in to comment.