Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Run JSHint

... for questionable benefit.
  • Loading branch information...
commit fab2c19c08e0a95c1d1f9c3db6d67dbac3562d77 1 parent 9ce709a
Ben Alpert spicyj authored

Showing 76 changed files with 361 additions and 349 deletions. Show diff stats Hide diff stats

  1. +29 6 build/pack.rb
  2. +1 1  exercises/absolute_value.html
  3. +1 1  exercises/adding_decimals.html
  4. +2 2 exercises/addition_4.html
  5. +30 30 exercises/addition_rule_of_probability.html
  6. +1 1  exercises/angle_bisector_theorem.html
  7. +2 2 exercises/angles_1.html
  8. +7 7 exercises/angles_2.html
  9. +2 2 exercises/chain_rule_1.html
  10. +1 1  exercises/changing_percents_to_fractions.html
  11. +1 1  exercises/circumradius.html
  12. +1 1  exercises/comparing_absolute_values.html
  13. +1 1  exercises/compound_inequalities.html
  14. +2 2 exercises/congruent_triangles_1.html
  15. +4 4 exercises/congruent_triangles_2.html
  16. +1 1  exercises/converting_repeating_decimals_to_fractions_1.html
  17. +1 1  exercises/converting_repeating_decimals_to_fractions_2.html
  18. +2 2 exercises/creating_bar_charts_1.html
  19. +3 3 exercises/decimals_on_the_number_line.html
  20. +2 2 exercises/dependent_probability.html
  21. +10 10 exercises/derivative_intuition.html
  22. +24 24 exercises/derivatives_1.html
  23. +3 3 exercises/distance_formula.html
  24. +1 1  exercises/distributive_property.html
  25. +8 8 exercises/distributive_property_with_variables.html
  26. +2 2 exercises/domain_and_range_0.5.html
  27. +2 2 exercises/domain_of_a_function.html
  28. +3 3 exercises/equation_of_a_hyperbola.html
  29. +6 6 exercises/equation_of_a_line.html
  30. +2 2 exercises/equation_of_a_parabola.html
  31. +2 2 exercises/equation_of_an_ellipse.html
  32. +12 10 exercises/estimation_with_decimals.html
  33. +1 1  exercises/exponents_3.html
  34. +2 2 exercises/exponents_4.html
  35. +2 2 exercises/fractions_on_the_number_line.html
  36. +1 1  exercises/functions_1.html
  37. +2 2 exercises/functions_2.html
  38. +2 2 exercises/graphing_inequalities.html
  39. +10 10 exercises/graphing_inequalities_2.html
  40. +4 4 exercises/graphing_systems_of_inequalities.html
  41. +20 20 exercises/graphing_systems_of_inequalities_2.html
  42. +2 2 exercises/graphs_of_sine_and_cosine.html
  43. +3 3 exercises/inequalities_on_a_number_line.html
  44. +50 50 exercises/kinematic_equations.html
  45. +3 3 exercises/lhopitals_rule.html
  46. +1 1  exercises/multiplying_and_dividing_negative_numbers.html
  47. +9 23 exercises/multiplying_fractions_1.html
  48. +1 1  exercises/multiplying_polynomials.html
  49. +1 1  exercises/negative_number_word_problems.html
  50. +2 2 exercises/new_definitions_1.html
  51. +3 3 exercises/new_definitions_2.html
  52. +7 7 exercises/ordering_numbers.html
  53. +3 3 exercises/percentage_word_problems_1.html
  54. +3 2 exercises/place_value.html
  55. +1 1  exercises/power_rule.html
  56. +5 5 exercises/probability_1.html
  57. +3 3 exercises/quadratic_equation.html
  58. +4 4 exercises/quadrilateral_angles.html
  59. +6 8 exercises/rate_problems_2.html
  60. +1 1  exercises/reading_bar_charts_2.html
  61. +4 4 exercises/reading_bar_charts_3.html
  62. +3 3 exercises/reading_pictographs_2.html
  63. +3 3 exercises/reading_stem_and_leaf_plots.html
  64. +1 1  exercises/rounding_whole_numbers.html
  65. +1 1  exercises/scaling_vectors.html
  66. +2 2 exercises/shifting_and_reflecting_functions.html
  67. +1 1  exercises/signs_of_a_parabola.html
  68. +1 1  exercises/simplifying_fractions.html
  69. +3 1 exercises/solving_for_a_variable.html
  70. +2 2 exercises/subtraction_4.html
  71. +6 6 exercises/systems_of_equations.html
  72. +1 1  exercises/telling_time_0.5.html
  73. +4 4 exercises/trigonometry_1.html
  74. +5 5 exercises/trigonometry_2.html
  75. +2 2 exercises/units.html
  76. +1 1  exercises/writing_proportions.html
35 build/pack.rb
... ... @@ -1,6 +1,7 @@
1 1 begin
2 2 require 'rubygems'
3 3 require 'nokogiri'
  4 + require 'execjs'
4 5 require 'uglifier'
5 6 require 'fileutils'
6 7 rescue LoadError
@@ -8,10 +9,6 @@
8 9 puts "-" * 78
9 10 puts "Oops! Some gems are missing; please run:"
10 11 puts " sudo gem install nokogiri uglifier therubyracer"
11   - puts
12   - puts "If you prefer another JS runtime (https://github.com/sstephenson/execjs),"
13   - puts "be aware that this script is much faster (around 50x speedup) using"
14   - puts "therubyracer, which is based on Chrome's V8 engine."
15 12 puts "-" * 78
16 13 puts
17 14 exit 1
@@ -24,15 +21,39 @@
24 21 puts "-" * 78
25 22 puts "Warning! You don't have therubyracer installed, packing might be slow. Try:"
26 23 puts " sudo gem install therubyracer"
  24 + puts
  25 + puts "If you prefer another JS runtime (https://github.com/sstephenson/execjs),"
  26 + puts "be aware that this script is much faster (around 50x speedup) using"
  27 + puts "therubyracer, which is based on Chrome's V8 engine."
27 28 puts "-" * 78
28 29 puts
29 30 end
30 31
  32 +JSHINT_ENABLED = false
  33 +JSHINT_OPTIONS = {
  34 + :laxbreak => true,
  35 + :eqeqeq => true,
  36 + :loopfunc => true,
  37 +}
  38 +
  39 +def jshint(js)
  40 + return unless JSHINT_ENABLED
  41 + if !@jshint.call("JSHINT", js, JSHINT_OPTIONS)
  42 + @jshint.eval("JSHINT.errors").each do |err|
  43 + break if err["reason"] == "Expected ')' to match '(' from line 1 and instead saw ','."
  44 + # puts "-- #{js}"
  45 + puts "-- #{err["reason"]} (#{err["line"]}:#{err["character"]})"
  46 + puts "-- > #{(err["evidence"] || "").strip}"
  47 + puts "--"
  48 + end
  49 + end
  50 +end
  51 +
31 52 # All paths are relative to khan-exercises/ root
32 53 Dir.chdir(File.join(File.dirname(__FILE__), ".."))
33 54
34   -# Discard all comments
35   -@uglifier = Uglifier.new(:copyright => false)
  55 +@uglifier = Uglifier.new(:copyright => false) # Discard all comments
  56 +@jshint = ExecJS.compile(File.read("build/jshint.js"))
36 57
37 58 FileUtils.mkdir_p("exercises-packed")
38 59
@@ -53,6 +74,7 @@
53 74
54 75 next if var.content !~ /\S/ # only whitespace
55 76
  77 + jshint("return (#{var.content});")
56 78 exp = "(#{var.content})"
57 79 var.content = @uglifier.compile(exp)
58 80 end
@@ -83,6 +105,7 @@
83 105
84 106 %w[data-ensure data-if data-else-if].each do |data_attr|
85 107 doc.css("[#{data_attr}]").each do |el|
  108 + jshint("return (#{el[data_attr]});")
86 109 js = el[data_attr]
87 110 el[data_attr] = @uglifier.compile(js)
88 111 end
2  exercises/absolute_value.html
@@ -7,7 +7,7 @@
7 7 </head>
8 8 <body>
9 9 <div class="exercise">
10   - <div class="vars" data-ensure="SIGN == &quot;&quot; || INT != 0 || FRAC != 0">
  10 + <div class="vars" data-ensure="SIGN === &quot;&quot; || INT !== 0 || FRAC !== 0">
11 11 <var id="INT">rand(5) > 0 ? randRange( 1, 9 ) : 0</var>
12 12 <var id="FRAC">rand(3) > 0 ? "." + randRange(1, 9) : ""</var>
13 13 <var id="SIGN">randFromArray(["", "-"])</var>
2  exercises/adding_decimals.html
@@ -11,7 +11,7 @@
11 11 <var id="A">randRange( 100, 999 )</var>
12 12 <var id="B">randRange( 100, 999 )</var>
13 13 <div data-ensure="B_DECIMAL !== A_DECIMAL">
14   - <var id="A_DECIMAL">randRangeWeighted( 0, 3, 0, .1 )</var>
  14 + <var id="A_DECIMAL">randRangeWeighted( 0, 3, 0, 0.1 )</var>
15 15 <var id="B_DECIMAL">randRange( 1, 3 )</var>
16 16 </div>
17 17 <var id="NEW_A">A * ( B_DECIMAL &gt; A_DECIMAL ? pow( 10, B_DECIMAL - A_DECIMAL ) : 1)</var>
4 exercises/addition_4.html
@@ -8,11 +8,11 @@
8 8 <body>
9 9 <div class="exercise">
10 10 <div class="vars">
11   - <var id="A_1000">randRangeWeighted( 0, 9, 0, .25 )*1000</var>
  11 + <var id="A_1000">randRangeWeighted( 0, 9, 0, 0.25 )*1000</var>
12 12 <var id="A_100">randRange( 0, 9 )*100</var>
13 13 <var id="A_10">randRange( 0, 9 )*10</var>
14 14 <var id="A_1">randRange ( 0, 9 )*1</var>
15   - <var id="B_1000" data-ensure="B_1000<=A_1000">randRangeWeighted( 0, 9, 0, .25 )*1000</var>
  15 + <var id="B_1000" data-ensure="B_1000<=A_1000">randRangeWeighted( 0, 9, 0, 0.25 )*1000</var>
16 16 <var id="B_100">randRange( 0, 9 )*100</var>
17 17 <var id="B_10">randRange( 0, 9 )*10</var>
18 18 <var id="B_1">randRange ( 0, 9 )*1</var>
60 exercises/addition_rule_of_probability.html
@@ -6,10 +6,10 @@
6 6 <script src="../khan-exercise.js"></script>
7 7 <script type="text/javascript">
8 8 function enFunc(innerString, usePercentages) {
9   - if (usePercentages)
10   - return "<code>P(</code>" + innerString + "<code>)</code>";
  9 + if (usePercentages)
  10 + return "<code>P(</code>" + innerString + "<code>)</code>";
11 11 else
12   - return "<code>\\lvert</code>" + innerString + "<code>\\rvert</code>";
  12 + return "<code>\\lvert</code>" + innerString + "<code>\\rvert</code>";
13 13 }
14 14 </script>
15 15 </head>
@@ -35,39 +35,39 @@
35 35 ["In a sample of patients, ", CHOOSE_ATTRIBUTES( ["male", "female"], ["colorblind", "overweight", "underweight", "over sixty", "healthy", "under eighteen", "healthy"] ), "What percentage of the patients are ", "?", true],
36 36 ["Of the houses in a town, ", CHOOSE_ATTRIBUTES( ["white", "blue", "light green", "solar powered", "near a park"], ["air conditioned", "wooden", "stucco"] ), "What percentage of the houses are ", "?", true],
37 37 ["A census was recently taken in a certain community, and the results include the following facts about the residents: ", CHOOSE_ATTRIBUTES( ["Hispanic", "Asian", "White", "Black"], ["male", "female", "under 18", "over 65"] ), "What percentage of the residents are ", "?", true],
38   - ["A car dealer advertises statistics desribing her inventory. Of the cars on her lot, the advertisement states ", CHOOSE_ATTRIBUTES( ["white", "blue", "light green", "red", "grey", "black"], ["trucks", "minivans", "SUVs", "sports cars", "sedans"] ), "What percentage of the cars are ", "?", true],
  38 + ["A car dealer advertises statistics desribing her inventory. Of the cars on her lot, the advertisement states ", CHOOSE_ATTRIBUTES( ["white", "blue", "light green", "red", "grey", "black"], ["trucks", "minivans", "SUVs", "sports cars", "sedans"] ), "What percentage of the cars are ", "?", true]
39 39 ])
40 40 </var>
41   - <!-- Randomize the order the variables (X, Y, X_OR_Y, X_AND_Y) are written in the question -->
42   - <var id="ORDER">shuffle( [0, 1, 2, 3] )</var>
43   - <!-- Assign values to each variable, subject to constraints so all counts are > 1 and no counts are negative -->
44   - <var id="VARVALS">
45   - ( function( usePercentages ) {
46   - var rangemin = usePercentages ? 1 : 2;
47   - var rangemax = usePercentages ? 100 : 10;
48   - var vals = [0, 0, 0, 0];
49   - vals[VARINDX_X] = randRange( rangemin, rangemax );
50   - vals[VARINDX_Y] = randRange( rangemin, rangemax );
51   - vals[VARINDX_X_AND_Y] = randRange( max( rangemin, vals[VARINDX_X]+vals[VARINDX_Y]-100 ), min( vals[VARINDX_X], vals[VARINDX_Y] ) );
52   - vals[VARINDX_X_OR_Y] = vals[VARINDX_X] + vals[VARINDX_Y] - vals[VARINDX_X_AND_Y];
53   - return vals;
54   - } )( USEPERCENTAGES )
55   - </var>
56   - <var id="QUESTIONTEXT">
57   - ( function() {
  41 + <!-- Randomize the order the variables (X, Y, X_OR_Y, X_AND_Y) are written in the question -->
  42 + <var id="ORDER">shuffle( [0, 1, 2, 3] )</var>
  43 + <!-- Assign values to each variable, subject to constraints so all counts are > 1 and no counts are negative -->
  44 + <var id="VARVALS">
  45 + ( function( usePercentages ) {
  46 + var rangemin = usePercentages ? 1 : 2;
  47 + var rangemax = usePercentages ? 100 : 10;
  48 + var vals = [0, 0, 0, 0];
  49 + vals[VARINDX_X] = randRange( rangemin, rangemax );
  50 + vals[VARINDX_Y] = randRange( rangemin, rangemax );
  51 + vals[VARINDX_X_AND_Y] = randRange( max( rangemin, vals[VARINDX_X]+vals[VARINDX_Y]-100 ), min( vals[VARINDX_X], vals[VARINDX_Y] ) );
  52 + vals[VARINDX_X_OR_Y] = vals[VARINDX_X] + vals[VARINDX_Y] - vals[VARINDX_X_AND_Y];
  53 + return vals;
  54 + } )( USEPERCENTAGES )
  55 + </var>
  56 + <var id="QUESTIONTEXT">
  57 + ( function() {
58 58 var optionalPercentage = USEPERCENTAGES ? "% are " : " ";
59   - var qstn = INTRO;
60   - for (var i=0; i &lt; ORDER.length-1; i++) {
  59 + var qstn = INTRO;
  60 + for (var i=0; i &lt; ORDER.length-1; i++) {
61 61 qstn += (i===ORDER.length-2) ? " and " : "";
62 62 qstn += VARVALS[ORDER[i]] + optionalPercentage + VARDESC[ORDER[i]];
63 63 qstn += (i &lt; ORDER.length-2) ? ", " : ". ";
64   - }
65   - qstn += QSTNPRETEXT + VARDESC[ORDER[ORDER.length-1]] + QSTNPOSTTEXT;
66   - return qstn;
67   - } )()
68   - </var>
69   - <!-- this just passes the call to plain JS to avoid problems with unescaped HTML in the function body, while still giving access to vars -->
70   - <var id="ENFUNC"> function (innerString) { return enFunc(innerString, USEPERCENTAGES); } </var>
  64 + }
  65 + qstn += QSTNPRETEXT + VARDESC[ORDER[ORDER.length-1]] + QSTNPOSTTEXT;
  66 + return qstn;
  67 + } )()
  68 + </var>
  69 + <!-- this just passes the call to plain JS to avoid problems with unescaped HTML in the function body, while still giving access to vars -->
  70 + <var id="ENFUNC"> function (innerString) { return enFunc(innerString, USEPERCENTAGES); } </var>
71 71
72 72 </div>
73 73 <div class="question"><p><var>QUESTIONTEXT</var></p></div>
2  exercises/angle_bisector_theorem.html
@@ -8,7 +8,7 @@
8 8 <body>
9 9 <div class="exercise">
10 10 <div class="vars">
11   - <var id="ANGLES" data-ensure="ANGLES[ 0 ] % 2 == 0">randomTriangleAngles.triangle()</var>
  11 + <var id="ANGLES" data-ensure="ANGLES[ 0 ] % 2 === 0">randomTriangleAngles.triangle()</var>
12 12 <var id="SIDES_B">[ [ 0, 1 ], [] ]</var>
13 13 <var id="SIDES_C">[ [ 1 ], [ 2] ]</var>
14 14 <var id="TR_A">
4 exercises/angles_1.html
@@ -377,14 +377,14 @@
377 377 <ul>
378 378 <li><code>\overline{HI} \parallel \overline{JK}</code>,
379 379 lines HI and JK are parallel.</li>
380   - <li data-if="RAND3 == 0 || RAND3 == 1">
  380 + <li data-if="RAND3 === 0 || RAND3 === 1">
381 381 <code>\color{purple}{\angle{BAC}} = <var>Tri_X</var>&deg;</code>
382 382 </li>
383 383 <li data-else>
384 384 <code>\color{purple}{\angle{AKJ}} = <var>Tri_Y</var>&deg;</code>
385 385 </li>
386 386
387   - <li data-if="RAND3 == 0">
  387 + <li data-if="RAND3 === 0">
388 388 <code>\color{green}{\angle{AJK}} = <var>Tri_Z</var>&deg;</code>
389 389 </li>
390 390 <li data-else>
14 exercises/angles_2.html
@@ -278,19 +278,19 @@
278 278 label([0,2], "\\color{orange}{" + X + "&deg;}", "below left");
279 279 </span>
280 280 </p>
281   - <p data-if="RAND_COMBO == 20">
  281 + <p data-if="RAND_COMBO === 20">
282 282 <code>\color{blue}{\angle{GHD}} = \color{orange}{\angle{AGH}}</code>.
283 283 We know those 2 angles are equal because they are alternate interior angles
284 284 of 2 parallel lines.
285 285 </p>
286   - <p data-else-if="RAND_COMBO == 21 || RAND_COMBO == 1">
  286 + <p data-else-if="RAND_COMBO === 21 || RAND_COMBO === 1">
287 287 <code>\color{blue}{\angle{CHF}} = \color{orange}{\angle{AGH}}</code>.
288 288 We know those 2 angles are equal because they are corresponding angles
289 289 formed by parallel lines, and a single bisecting lines.
290 290 </p>
291 291 <p>
292 292 Therefore,
293   - <span data-if="RAND_SWITCH2 == 0">
  293 + <span data-if="RAND_SWITCH2 === 0">
294 294 <code>\angle{GHD} = <var>X</var>&deg;</code>
295 295 <span class="graphie" data-update="opposite-parallel">
296 296 LABEL.remove();
@@ -543,7 +543,7 @@
543 543 <div class="solution"><var>Tri2_X</var></div>
544 544
545 545 <div class="hints">
546   - <p data-if="RAND_SWITCH2==0">
  546 + <p data-if="RAND_SWITCH2 === 0">
547 547 <code>\color{purple}{\angle{DIJ}} = 180&deg; - \color{orange}{\angle{AIC}}</code>.
548 548 This is because angles along a line total 180&deg;.
549 549 <span class="graphie" data-update="star2">
@@ -564,7 +564,7 @@
564 564 </span>
565 565 </p>
566 566
567   - <p data-if="RAND_SWITCH2==0">
  567 + <p data-if="RAND_SWITCH2 === 0">
568 568 <code>\color{teal}{\angle{DJI}} = 180&deg; - \color{green}{\angle{BDC}} -
569 569 \color{purple}{\angle{DIJ}}</code>.
570 570 We know this because the sum of angles inside a triangle add up to 180&deg;.
@@ -588,7 +588,7 @@
588 588 </p>
589 589
590 590
591   - <p data-if="RAND_SWITCH2==0">
  591 + <p data-if="RAND_SWITCH2 === 0">
592 592 <code>\color{blue}{\angle{AJF}} = \color{teal}{\angle{DJI}}</code>.
593 593 We know they are equal because they are opposite angles.
594 594 </p>
@@ -599,7 +599,7 @@
599 599
600 600 <p>
601 601 Therefore,
602   - <span data-if="RAND_SWITCH2 == 0">
  602 + <span data-if="RAND_SWITCH2 === 0">
603 603 <code>\angle{AJF} = <var>Tri2_X</var>&deg;</code>
604 604 <span class="graphie" data-update="star2">
605 605 LABEL.remove();
4 exercises/chain_rule_1.html
@@ -13,7 +13,7 @@
13 13
14 14 <var id="PRE_SIMPLIFICATION">
15 15 ( ( OUTER.f[0] === '^' &amp;&amp; OUTER.f[1] === 'e' &amp;&amp; INNER.f[0] === 'ln' )
16   - || ( OUTER.f[0] === 'ln' &amp;&amp; INNER.f[0] === '^' &amp;&amp; INNER.f[1] == 'e' ) )
  16 + || ( OUTER.f[0] === 'ln' &amp;&amp; INNER.f[0] === '^' &amp;&amp; INNER.f[1] === 'e' ) )
17 17 ? 'x'
18 18 : null
19 19 </var>
@@ -32,7 +32,7 @@
32 32
33 33 <var id="DERIVATIVE_SIMPLIFICATIONS">
34 34 ( ( OUTER.f[0] === '^' &amp;&amp; OUTER.f[1] === 'e' &amp;&amp; INNER.f[0] === 'ln' )
35   - || ( OUTER.f[0] === 'ln' &amp;&amp; INNER.f[0] === '^' &amp;&amp; INNER.f[1] == 'e' ) )
  35 + || ( OUTER.f[0] === 'ln' &amp;&amp; INNER.f[0] === '^' &amp;&amp; INNER.f[1] === 'e' ) )
36 36 ? [['frac', 'x', 'x'], '1']
37 37 : []
38 38 </var>
2  exercises/changing_percents_to_fractions.html
@@ -31,7 +31,7 @@
31 31 <div class="hints">
32 32 <p><code><var>A</var>\%</code> literally means <code><var>A</var></code> per 100</p>
33 33 <p>Putting this in fraction form: <code><var>fraction( A , 100 )</var></code></p>
34   - <p data-if="( A * 10 ) % 10 != 0">Multiplying top and bottom by 10 to get rid of the decimal: <code><var>fraction( A * 10 , 1000 )</var></code></p>
  34 + <p data-if="( A * 10 ) % 10 !== 0">Multiplying top and bottom by 10 to get rid of the decimal: <code><var>fraction( A * 10 , 1000 )</var></code></p>
35 35 <p data-if="getGCD( A * 10 , 1000 ) > 1">Both numerator and denominator are divisible by <code><var>getGCD( A * 10 , 1000 )</var></code>.</p>
36 36 <p data-if="getGCD( A * 10 , 1000 ) > 1">Reducing to lowest terms, <code><var>fractionReduce( A * 10 , 1000 )</var></code>.</p>
37 37 <p data-if="A > 100">Optionally, the improper fraction <code><var>fractionReduce( A * 10 , 1000 )</var></code> can be converted to the mixed number <code><var>( A * 10 - A * 10 % 1000 ) / 1000 + fractionReduce( round ( A * 10 % 1000 ), 1000 )</var></code>.</p>
2  exercises/circumradius.html
@@ -13,7 +13,7 @@
13 13 <div class="problems">
14 14 <div id="equi">
15 15 <div class="vars">
16   - <var id="ANGLES" data-ensure="ANGLES[ 0 ] % 2 == 0">randomTriangleAngles.triangle()</var>
  16 + <var id="ANGLES" data-ensure="ANGLES[ 0 ] % 2 === 0">randomTriangleAngles.triangle()</var>
17 17 <var id="CIRCUMLENGTH"></var>
18 18 <var id="BD"></var>
19 19 <var id="AC"></var>
2  exercises/comparing_absolute_values.html
@@ -38,7 +38,7 @@
38 38 <div class="problems">
39 39 <div>
40 40 <div class="vars">
41   - <var id="ABS_1, ABS_2">randFromArray([[ "|", "|", ], [ "|", "", ], [ "", "|", ]])</var>
  41 + <var id="ABS_1, ABS_2">randFromArray([[ "|", "|" ], [ "|", "" ], [ "", "|" ]])</var>
42 42 <var id="NUM_1">randRange(-10, 10)</var>
43 43 <var id="NUM_2">( NUM_1 &lt; 0 ) ? randRange(0, 10) : randRange(-10, -1)</var>
44 44 <var id="NUM_1_VALUE">ABS_1 ? abs( NUM_1 ) : NUM_1</var>
2  exercises/compound_inequalities.html
@@ -62,7 +62,7 @@
62 62 <var id="OR">randFromArray([ "or", "and" ])</var>
63 63 <var id="IS_OR">OR === "or"</var>
64 64 <var id="FAKE_ANSWER">tabulate( function() {
65   - return randRange( 2, 9 ) * ( rand( 3 ) > 0 ? 1 : -1 )
  65 + return randRange( 2, 9 ) * ( rand( 3 ) > 0 ? 1 : -1 );
66 66 }, 2 )</var>
67 67 <var id="CONTAINS">(function() {
68 68 if ( LESS_THAN[0] && LESS_THAN[1] ) {
4 exercises/congruent_triangles_1.html
@@ -2,7 +2,7 @@
2 2 <html data-require="math graphie graphie-helpers graphie-geometry math-format">
3 3 <head>
4 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5   - <title>Congruent Triangles 1</title>
  5 + <title>Congruent triangles 1</title>
6 6 <script src="../khan-exercise.js"></script>
7 7 </head>
8 8 <body>
@@ -30,7 +30,7 @@
30 30 <var id="TR_B">
31 31 function(){
32 32 var t = new Triangle( [ 7, -6 ], B, B_SIZE, {} );
33   - t.labels = { "name": "B", "angles" : clearArray( t.niceAngles, B_ANGLES ), "sides" : clearArray( t.niceSideLengths, B_SIDES ) }
  33 + t.labels = { "name": "B", "angles" : clearArray( t.niceAngles, B_ANGLES ), "sides" : clearArray( t.niceSideLengths, B_SIDES ) };
34 34 return t;
35 35 }()
36 36 </var>
8 exercises/congruent_triangles_2.html
@@ -102,10 +102,10 @@
102 102 <var id="NEW_ANG">
103 103 function(){
104 104 var newAng = RAND_ANG;
105   - if ( RAND_ANG == 0 ){
  105 + if ( RAND_ANG === 0 ){
106 106 newAng = 1;
107 107 }
108   - else if ( RAND_ANG == 1 ){
  108 + else if ( RAND_ANG === 1 ){
109 109 newAng = 0;
110 110 }
111 111 return newAng;
@@ -116,10 +116,10 @@
116 116 <var id="ANG_LEFT">randRange( 0, 2 )</var>
117 117 <var id="SHOW_ANGLE">
118 118 function(){
119   - if ( ANG_LEFT == 1 ){
  119 + if ( ANG_LEFT === 1 ){
120 120 return 0;
121 121 }
122   - if ( ANG_LEFT == 0 ){
  122 + if ( ANG_LEFT === 0 ){
123 123 return 1;
124 124 }
125 125 return 2;
2  exercises/converting_repeating_decimals_to_fractions_1.html
@@ -38,7 +38,7 @@
38 38 <p>Subtracting the two equations, we have:</p>
39 39 <p><code>\large{<var>(MULT1 - MULT2)</var>x = <var>DIFF</var>}</code></p>
40 40 </div>
41   - <p><code>\large{x = <var>fraction( DIFF, MULT1 - MULT2 )</var>}\quad<span data-if="getGCD( DIFF, MULT1 - MULT2 ) == 1 && DIFF > ( MULT1 - MULT2 )"> \text{or} \quad\large{<var>mixedFractionFromImproper( DIFF, MULT1 - MULT2 )</var>}</span></code></p>
  41 + <p><code>\large{x = <var>fraction( DIFF, MULT1 - MULT2 )</var>}\quad<span data-if="getGCD( DIFF, MULT1 - MULT2 ) === 1 && DIFF > ( MULT1 - MULT2 )"> \text{or} \quad\large{<var>mixedFractionFromImproper( DIFF, MULT1 - MULT2 )</var>}</span></code></p>
42 42 <p data-if="getGCD( DIFF, MULT1 - MULT2 ) !== 1"><code>\large{x = <var>fraction( toFraction( N4 )[ 0 ], toFraction( N4 )[ 1 ])</var>}\quad<span data-if="DIFF > ( MULT1 - MULT2 )"> \text{or} \quad\large{<var>mixedFractionFromImproper( toFraction( N4 )[ 0 ], toFraction( N4 )[ 1 ] )</var>}</span></code></p>
43 43 </div>
44 44 </div>
2  exercises/converting_repeating_decimals_to_fractions_2.html
@@ -81,7 +81,7 @@
81 81 <p>Subtracting the two equations, we have:</p>
82 82 <p><code>\large{<var>(MULT1 - MULT2)</var>x = <var>DIFF</var>}</code></p>
83 83 </div>
84   - <p><code>\large{x = <var>fraction( DIFF, MULT1 - MULT2 )</var>}\quad<span data-if="getGCD( DIFF, MULT1 - MULT2 ) == 1 && DIFF > ( MULT1 - MULT2 )"> \text{or} \quad\large{<var>mixedFractionFromImproper( DIFF, MULT1 - MULT2 )</var>}</span></code></p>
  84 + <p><code>\large{x = <var>fraction( DIFF, MULT1 - MULT2 )</var>}\quad<span data-if="getGCD( DIFF, MULT1 - MULT2 ) === 1 && DIFF > ( MULT1 - MULT2 )"> \text{or} \quad\large{<var>mixedFractionFromImproper( DIFF, MULT1 - MULT2 )</var>}</span></code></p>
85 85 <p data-if="getGCD( DIFF, MULT1 - MULT2 ) !== 1"><code>\large{x = <var>fraction( toFraction( N4 )[ 0 ], toFraction( N4 )[ 1 ])</var>}\quad<span data-if="DIFF > ( MULT1 - MULT2 )"> \text{or} \quad\large{<var>mixedFractionFromImproper( toFraction( N4 )[ 0 ], toFraction( N4 )[ 1 ] )</var>}</span></code></p>
86 86 </div>
87 87 </div>
4 exercises/creating_bar_charts_1.html
... ... @@ -1,5 +1,5 @@
1 1 <!DOCTYPE html>
2   -<html data-require="math math-format expressions graphie interactive word-problems">
  2 +<html data-require="math math-format expressions graphie interactive word-problems stat">
3 3 <head>
4 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 5 <title>Creating bar charts 1</title>
@@ -25,7 +25,7 @@
25 25 <var id="SUBJECT">randFromArray([ "animal", "color", "fruit", "course" ])</var>
26 26 <var id="CATEGORIES">jQuery.map( _.range(5), function( n ) { return ( KhanUtil[ SUBJECT ] )( n + 1 ); } )</var>
27 27 <var id="DATA">jQuery.map( _.range(5), function() { return randRange( 0, 10 ); } )</var>
28   - <var id="TOTAL">eval( DATA.join( "+" ) )</var>
  28 + <var id="TOTAL">sum( DATA )</var>
29 29 <var id="RESPONDENT">randFromArray([ "student", "teacher", "person" ])</var>
30 30 </div>
31 31
6 exercises/decimals_on_the_number_line.html
@@ -21,14 +21,14 @@
21 21
22 22 arr = [];
23 23 for ( i = 0; i &lt; pos; i++){
24   - arr.push( NUMBER - ((pos - i) * 0.47))
  24 + arr.push( NUMBER - ((pos - i) * 0.47));
25 25 }
26 26 arr.push( NUMBER );
27 27 for ( i = pos + 1; i &lt; 5; i++ ){
28   - arr.push( NUMBER + (( i - pos) * 0.47))
  28 + arr.push( NUMBER + (( i - pos) * 0.47));
29 29 }
30 30 return arr;
31   - })()</var>
  31 + })()</var>
32 32 <var id="POSS_ANSWER">[ "A", "B", "C", "D", "E" ]</var>
33 33 <var id="ANSWER" >POSS_ANSWER[ WRONGS.indexOf( NUMBER ) ] </var>
34 34 </div>
4 exercises/dependent_probability.html
@@ -50,7 +50,7 @@
50 50 <var id="DECIMAL_CHANCE_UNFAIR_HEADS">PERCENT_CHANCE_UNFAIR_HEADS / 100</var>
51 51 <var id="UNFAIR_HEADS_DECIMAL_FORMULA">
52 52 (function() {
53   - var uhdf = DECIMAL_CHANCE_UNFAIR_HEADS.toString()
  53 + var uhdf = DECIMAL_CHANCE_UNFAIR_HEADS.toString();
54 54 for (var i = 0; i &lt; NUM_FLIPS - 1; i++) {
55 55 uhdf += " \\times " + DECIMAL_CHANCE_UNFAIR_HEADS;
56 56 }
@@ -82,7 +82,7 @@
82 82 <var id="CHANCE_FAIR_PICKED">1 - CHANCE_UNFAIR_PICKED</var>
83 83
84 84 <var id="ANSWER">round(10000 * (CHANCE_UNFAIR_PICKED * pow((PERCENT_CHANCE_UNFAIR_HEADS / 100), NUM_FLIPS) +
85   - CHANCE_FAIR_PICKED * pow(.5,NUM_FLIPS))) / 100</var>
  85 + CHANCE_FAIR_PICKED * pow(0.5,NUM_FLIPS))) / 100</var>
86 86
87 87 </div>
88 88
20 exercises/derivative_intuition.html
@@ -91,8 +91,8 @@
91 91 {
92 92 text: "sin(x)",
93 93 ddxtext: "cos(x)",
94   - fnx: function(x) { return Math.sin(x) },
95   - ddx: function(x) { return Math.cos(x) },
  94 + fnx: function(x) { return Math.sin(x); },
  95 + ddx: function(x) { return Math.cos(x); },
96 96 xrange: [-1.25*Math.PI, 1.25*Math.PI],
97 97 yrange: [ -1.25, 1.25 ],
98 98 points: [ -1*Math.PI, -3*Math.PI/4, -Math.PI/2, -Math.PI/4, 0, Math.PI/4, Math.PI/2, 3*Math.PI/4, Math.PI ],
@@ -100,8 +100,8 @@
100 100 }, {
101 101 text: "cos(x)",
102 102 ddxtext: "-sin(x)",
103   - fnx: function(x) { return Math.cos(x) },
104   - ddx: function(x) { return -Math.sin(x) },
  103 + fnx: function(x) { return Math.cos(x); },
  104 + ddx: function(x) { return -Math.sin(x); },
105 105 xrange: [-1.25*Math.PI, 1.25*Math.PI],
106 106 yrange: [ -1.25, 1.25 ],
107 107 points: [ -1*Math.PI, -3*Math.PI/4, -Math.PI/2, -Math.PI/4, 0, Math.PI/4, Math.PI/2, 3*Math.PI/4, Math.PI ],
@@ -109,8 +109,8 @@
109 109 }, {
110 110 text: "e^x",
111 111 ddxtext: "e^x",
112   - fnx: function(x) { return Math.exp(x, Math.E) },
113   - ddx: function(x) { return Math.exp(x, Math.E) },
  112 + fnx: function(x) { return Math.exp(x, Math.E); },
  113 + ddx: function(x) { return Math.exp(x, Math.E); },
114 114 xrange: [-5, 5],
115 115 yrange: [ -5, 15 ],
116 116 points: [ -2, -1, 0, 1, 2 ],
@@ -118,11 +118,11 @@
118 118 }, {
119 119 text: "ln(x)",
120 120 ddxtext: "\\frac{1}{x}",
121   - fnx: function(x) { return Math.log(x) },
122   - ddx: function(x) { return 1/x },
123   - xrange: [.001, 5],
  121 + fnx: function(x) { return Math.log(x); },
  122 + ddx: function(x) { return 1/x; },
  123 + xrange: [ 0.001, 5 ],
124 124 yrange: [ -5, 5 ],
125   - points: [ .25, .5, 1, 2, 3, 4 ],
  125 + points: [ 0.25, 0.5, 1, 2, 3, 4 ],
126 126 options: { range: [ [ -0.25, 4.75 ], [ -5, 5 ] ] }
127 127 }
128 128 ])
48 exercises/derivatives_1.html
@@ -71,52 +71,52 @@
71 71 </div>
72 72 <p><code>\qquad = \displaystyle \lim_{<var>H</var> \to 0} \frac{(<var>expr(
73 73 ["+", ["*", A, ["^", ["+", "x", H], 2]],
74   - ["*", B, ["+", "x", H]],
75   - C]
  74 + ["*", B, ["+", "x", H]],
  75 + C]
76 76 )</var>) - (<var>expr(
77 77 ["+", ["*", A, ["^", "x", 2]],
78   - ["*", B, "x"],
79   - C]
  78 + ["*", B, "x"],
  79 + C]
80 80 )</var>)}{<var>H</var>}</code></p>
81 81 <p><code>\qquad = \displaystyle \lim_{<var>H</var> \to 0} \frac{(<var>expr(
82 82 ["+", ["*", A, ["+", ["^", "x", 2],
83   - "2x " + H,
84   - ["^", H, 2]]],
85   - ["*", B, ["+", "x", H]],
86   - C]
  83 + "2x " + H,
  84 + ["^", H, 2]]],
  85 + ["*", B, ["+", "x", H]],
  86 + C]
87 87 )</var>) - (<var>expr(
88 88 ["+", ["*", A, ["^", "x", 2]],
89   - ["*", B, "x"],
90   - C]
  89 + ["*", B, "x"],
  90 + C]
91 91 )</var>)}{<var>H</var>}</code></p>
92 92 <p><code>\qquad = \displaystyle \lim_{<var>H</var> \to 0} \frac{<var>expr(
93 93 ["+", ["*", A, ["^", "x", 2]],
94   - ["*", 2 * A, "x " + H],
95   - ["*", A, ["^", H, 2]],
96   - ["*", B, "x"],
97   - ["*", B, H],
98   - C,
99   - ["*", -A, ["^", "x", 2]],
100   - ["*", -B, "x"],
101   - -C]
  94 + ["*", 2 * A, "x " + H],
  95 + ["*", A, ["^", H, 2]],
  96 + ["*", B, "x"],
  97 + ["*", B, H],
  98 + C,
  99 + ["*", -A, ["^", "x", 2]],
  100 + ["*", -B, "x"],
  101 + -C]
102 102 )</var>}{<var>H</var>}</code></p>
103 103 <p><code>\qquad = \displaystyle \lim_{<var>H</var> \to 0} \frac{<var>expr(
104 104 ["+", ["*", 2 * A, "x " + H],
105   - ["*", A, ["^", H, 2]],
106   - ["*", B, H]]
  105 + ["*", A, ["^", H, 2]],
  106 + ["*", B, H]]
107 107 )</var>}{<var>H</var>}</code></p>
108 108 <p><code>\qquad = \displaystyle \lim_{<var>H</var> \to 0} <var>expr(
109 109 ["+", ["*", 2 * A, "x"],
110   - ["*", A, H],
111   - B]
  110 + ["*", A, H],
  111 + B]
112 112 )</var></code></p>
113 113 <p><code>\qquad = \displaystyle <var>expr(
114 114 ["+", ["*", 2 * A, "x"],
115   - B]
  115 + B]
116 116 )</var></code></p>
117 117 <p><code>\qquad = \displaystyle <var>expr(
118 118 ["+", ["*", 2 * A, X],
119   - B]
  119 + B]
120 120 )</var></code></p>
121 121 <p><code>\qquad = <var>2 * A * X + B</var></code></p>
122 122 </div>
6 exercises/distance_formula.html
@@ -64,7 +64,7 @@
64 64 = <span style="color: #679B00"><var>X_DIST</var></span>
65 65 </p>
66 66
67   - <div data-if=" X2 - X1 != 0" class="graphie" data-update="graph">
  67 + <div data-if="X2 - X1 !== 0" class="graphie" data-update="graph">
68 68 style({
69 69 color: "#679b00",
70 70 stroke: "#679b00"
@@ -87,7 +87,7 @@
87 87 = <span style="color: #A66000"><var>Y_DIST</var></span>
88 88 </p>
89 89
90   - <div data-if="Y2-Y1 != 0" class="graphie" data-update="graph">
  90 + <div data-if="Y2-Y1 !== 0" class="graphie" data-update="graph">
91 91 style({
92 92 color: "#a66000",
93 93 stroke: "#a66000"
@@ -98,7 +98,7 @@
98 98 </div>
99 99 </div>
100 100
101   - <div data-if="Y2 - Y1 !== 0 && X1 - X2 !== 0 " >
  101 + <div data-if="Y2 - Y1 !== 0 && X1 - X2 !== 0">
102 102 <p>The distance is the <span style="color: #FF4900">length of the hypotenuse</span> of this right triangle.</p>
103 103
104 104 <div class="graphie" data-update="graph">
2  exercises/distributive_property.html
@@ -54,7 +54,7 @@
54 54 <var id="SYM_A, SYM_B, SYM_C">
55 55 (function() {
56 56 return jQuery.map( NUMS, function( el, i ) {
57   - if ( i == SWAP_INDEX ) {
  57 + if ( i === SWAP_INDEX ) {
58 58 return SYMBOL;
59 59 } else {
60 60 return el;
16 exercises/distributive_property_with_variables.html
@@ -97,13 +97,13 @@
97 97
98 98 <p class="solution"><code><var>plus( B+X, A+(B*C)+D )</var></code></p>
99 99 <ul class="choices" data-show="4" data-none="true">
100   - <li data-if="C != (A+D)"><code><var>X</var> - <var>A+(-1*C)+D</var></code></li>
101   - <li data-if="(A+C+D) != 0"><code><var>plus( B+X )</var> + <var>A+C+D</var></code></li>
102   - <li data-if="C != (A+D)"><code><var>X</var> + <var>A+(-1*C)+D</var></code></li>
103   - <li data-if="(A+C+D) != 0"><code><var>X</var> - <var>A+C+D</var></code></li>
104   - <li data-if="(A+C+D) != 0"><code><var>X</var> + <var>A+C+D</var></code></li>
105   - <li data-if="(C+D) != 0"><code><var>plus( A, B+X, C+D )</var></code></li>
106   - <li data-if="C != D"><code><var>plus( A, B+X, (-1*C)+D )</var></code></li>
  100 + <li data-if="C !== (A+D)"><code><var>X</var> - <var>A+(-1*C)+D</var></code></li>
  101 + <li data-if="(A+C+D) !== 0"><code><var>plus( B+X )</var> + <var>A+C+D</var></code></li>
  102 + <li data-if="C !== (A+D)"><code><var>X</var> + <var>A+(-1*C)+D</var></code></li>
  103 + <li data-if="(A+C+D) !== 0"><code><var>X</var> - <var>A+C+D</var></code></li>
  104 + <li data-if="(A+C+D) !== 0"><code><var>X</var> + <var>A+C+D</var></code></li>
  105 + <li data-if="(C+D) !== 0"><code><var>plus( A, B+X, C+D )</var></code></li>
  106 + <li data-if="C !== D"><code><var>plus( A, B+X, (-1*C)+D )</var></code></li>
107 107 </ul>
108 108
109 109 <div class="hints">
@@ -171,7 +171,7 @@
171 171 <p><code><var>plus( A+X, A*B )</var> + <var>plus( color( C, true )+color( PLUSPARENS( D, X ), false ) )</var></code></p>
172 172 </div>
173 173 <div data-if="C === -1">
174   - <p data-if="A != -1">A negative sign before an expression is the same as -1 times that expression.</p>
  174 + <p data-if="A !== -1">A negative sign before an expression is the same as -1 times that expression.</p>
175 175 <p><code><var>plus( A+X, A*B )</var> + \color{ blue }{ -1 }*<var>plus( color( PLUSPARENS( D, X ), false ) )</var></code></p>
176 176 </div>
177 177 <p><code><var>plus( A+X, A*B )</var> + <var>color( plus( C*D, C+X ) )</var></code></p>
4 exercises/domain_and_range_0.5.html
@@ -12,13 +12,13 @@
12 12 <var id="DOMAIN">[ randRange( -9, -1 ), randRange( 1, 9 ) ]</var>
13 13 <var id="FUNCTION_PATH">
14 14 (function() {
15   - var functionPath = new Array();
  15 + var functionPath = [];
16 16 var prev;
17 17
18 18 var push = function( val ) {
19 19 prev = val;
20 20 functionPath.push( prev );
21   - }
  21 + };
22 22
23 23 push([ DOMAIN[0], randRange( -5, 5 ) ]);
24 24
4 exercises/domain_of_a_function.html
@@ -95,7 +95,7 @@
95 95
96 96 <p class="problem"><code>f(x) = \sqrt{ x - <var>A</var> }</code></p>
97 97
98   - <p class="solution"><code><var>CHOICES["sqrt"]</var></code></p>
  98 + <p class="solution"><code><var>CHOICES.sqrt</var></code></p>
99 99 <ul class="choices" data-show="5" data-none="true">
100 100 <li data-each="filter( CHOICES, function( c ) { return c !== 'sqrt'; } ) as c"><code><var>c</var></code></li>
101 101 </ul>
@@ -104,7 +104,7 @@
104 104 <p><code>f(x)</code> is undefined when the radicand (the expression under the radical) is less than zero.</p>
105 105 <p>So the radicand, <code>x - <var>A</var></code>, must be greater than or equal to zero.</p>
106 106 <p>So <code>x - <var>A</var> \geq 0</code>; this means <code>x \geq <var>A</var></code>.</p>
107   - <p>Expressing this mathematically, the domain is <code><var>CHOICES["sqrt"]</var></code>.</p>
  107 + <p>Expressing this mathematically, the domain is <code><var>CHOICES.sqrt</var></code>.</p>
108 108 </div>
109 109
110 110 </div>
6 exercises/equation_of_a_hyperbola.html
@@ -22,8 +22,8 @@
22 22
23 23 <var id="WHICH_NEG">rand(2)</var>
24 24
25   - <var id="X_MINUS"> WHICH_NEG === 1 ? "+" : "+"</var>
26   - <var id="Y_MINUS"> WHICH_NEG === 1 ? "" : "-"</var>
  25 + <var id="X_MINUS">WHICH_NEG === 1 ? "+" : "+"</var>
  26 + <var id="Y_MINUS">WHICH_NEG === 1 ? "" : "-"</var>
27 27
28 28 <var id="X">H === 0 ? "x^2" : expr(["^", ["+", "x", -H], 2])</var>
29 29 <var id="Y">K === 0 ? "y^2" : expr(["^", ["+", "y", -K], 2])</var>
@@ -34,7 +34,7 @@
34 34 <div class="problems">
35 35 <div>
36 36 <div class="question">
37   - <p>The equation of hyperbola <code>H</code> is <code><var>WHICH_NEG == 1 ? expr(["-", Y2T, X2T]) : expr(["-", X2T, Y2T])</var> = 1</code>.</p>
  37 + <p>The equation of hyperbola <code>H</code> is <code><var>WHICH_NEG === 1 ? expr(["-", Y2T, X2T]) : expr(["-", X2T, Y2T])</var> = 1</code>.</p>
38 38 <p>What are the asymptotes?</p>
39 39 </div>
40 40
12 exercises/equation_of_a_line.html
@@ -99,8 +99,8 @@
99 99 <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>
100 100 </div>
101 101 <p>
102   - Writing the equation of the line, we have <code>y = <var>( M == -1 ? "-" : ( M == 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + b</code>
103   - <span data-if="abs( M ) == 1"> (the value of <code>m</code> is equal to <code><var>M</var></code>)</span>.
  102 + Writing the equation of the line, we have <code>y = <var>( M === -1 ? "-" : ( M === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + b</code>
  103 + <span data-if="abs( M ) === 1"> (the value of <code>m</code> is equal to <code><var>M</var></code>)</span>.
104 104 </p>
105 105
106 106 <p>To find <code>b</code>, we can substitute in either of the two points into the above equation. Let's go through both cases:</p>
@@ -114,7 +114,7 @@
114 114 <p><code><var>Y2</var> = (<var>fractionReduce( Y2 - Y1, X2 - X1 )</var>)(<var>X2</var>) + b</code></p>
115 115 <p><code>b = <var>Y2</var> - <var>fractionReduce( X2 * ( Y2 - Y1 ), X2 - X1 )</var> = <var>fractionReduce( Y2 * (X2 - X1) - X2 * ( Y2 - Y1 ), X2 - X1 )</var></code></p>
116 116 </div>
117   - <p>In both cases, the equation of the line is <code>y = <var>( M == -1 ? "-" : ( M == 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + <var>fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 )</var></code><span data-if="abs( M ) == 1"> (the value of <code>m</code> is equal to <code><var>M</var></code>)</span>.</p>
  117 + <p>In both cases, the equation of the line is <code>y = <var>( M === -1 ? "-" : ( M === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + <var>fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 )</var></code><span data-if="abs( M ) === 1"> (the value of <code>m</code> is equal to <code><var>M</var></code>)</span>.</p>
118 118 </div>
119 119 </div>
120 120
@@ -172,8 +172,8 @@
172 172 <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>
173 173 </div>
174 174 <p>
175   - Writing the equation of the line, we have <code>y = <var>( M == -1 ? "-" : ( M == 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + b</code>
176   - <span data-if="abs( M ) == 1"> (the value of <code>m</code> is equal to <code><var>M</var></code>)</span>.
  175 + Writing the equation of the line, we have <code>y = <var>( M === -1 ? "-" : ( M === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + b</code>
  176 + <span data-if="abs( M ) === 1"> (the value of <code>m</code> is equal to <code><var>M</var></code>)</span>.
177 177 </p>
178 178
179 179 <p>To find <code>b</code>, we can substitute in either of the two points into the above equation. Let's go through both cases:</p>
@@ -187,7 +187,7 @@
187 187 <p><code><var>Y2</var> = (<var>fractionReduce( Y2 - Y1, X2 - X1 )</var>)(<var>X2</var>) + b</code></p>
188 188 <p><code>b = <var>Y2</var> - <var>fractionReduce( X2 * ( Y2 - Y1 ), X2 - X1 )</var> = <var>fractionReduce( Y2 * (X2 - X1) - X2 * ( Y2 - Y1 ), X2 - X1 )</var></code></p>
189 189 </div>
190   - <p>In both cases, the equation of the line is <code>y = <var>( M == -1 ? "-" : ( M == 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + <var>fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 )</var></code><span data-if="abs( M ) == 1"> (the value of <code>m</code> is equal to <code><var>M</var></code>)</span>.</p>
  190 + <p>In both cases, the equation of the line is <code>y = <var>( M === -1 ? "-" : ( M === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + <var>fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 )</var></code><span data-if="abs( M ) === 1"> (the value of <code>m</code> is equal to <code><var>M</var></code>)</span>.</p>
191 191 </div>
192 192 </div>
193 193 </div>
4 exercises/equation_of_a_parabola.html
@@ -12,11 +12,11 @@
12 12 </head>
13 13 <body>
14 14 <div class="exercise">
15   - <div class="vars" data-ensure="( A != 0 ) && -10 < C && C < 10 && B != 0 ">
  15 + <div class="vars" data-ensure="( A !== 0 ) && -10 < C && C < 10 && B !== 0 ">
16 16 <var id="A"> randRange( -5, 5 ) </var>
17 17 <var id="H"> randRange( -5, 5 )</var>
18 18 <var id="K"> randRange( -5, 5 )</var>
19   - // y = A*(x-H)^2 + K = A(x^2-2Hx+H^2) + K = Ax^2 -2AHx + A*H^2+K
  19 + <!-- y = A*(x-H)^2 + K = A(x^2-2Hx+H^2) + K = Ax^2 -2AHx + A*H^2+K -->
20 20 <var id="B">-2 * A * H</var>
21 21 <var id="C">A * H * H + K</var>
22 22 </div>
4 exercises/equation_of_an_ellipse.html
@@ -14,7 +14,7 @@
14 14 <div class="exercise">
15 15 <div class="vars">
16 16 <var id="A">randRange( 2, 9 )</var>
17   - <var id="B" data-ensure=" A !== B" >randRange( 2, 9 )</var>
  17 + <var id="B" data-ensure="A !== B">randRange( 2, 9 )</var>
18 18
19 19 <var id="H">randRange( -9, 9 )</var>
20 20 <var id="K">randRange( -9, 9 )</var>
@@ -29,7 +29,7 @@
29 29 <div class="problems">
30 30 <div>
31 31 <div class="question">
32   - <p>The equation of an ellipse <code>E</code> is <code><var>rand(2) == 1 ? expr(["+", Y2T, X2T]) : expr(["+", X2T, Y2T])</var> = 1</code>.</p>
  32 + <p>The equation of an ellipse <code>E</code> is <code><var>rand(2) === 1 ? expr(["+", Y2T, X2T]) : expr(["+", X2T, Y2T])</var> = 1</code>.</p>
33 33
34 34 <p>What are its center <code>(h, k)</code> and its major and minor radius?</p>
35 35
22 exercises/estimation_with_decimals.html
... ... @@ -1,5 +1,5 @@
1 1 <!DOCTYPE html>
2   -<html data-require="math math-format word-problems">
  2 +<html data-require="math math-format word-problems stat">
3 3 <head>
4 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 5 <title>Estimation with decimals</title>
@@ -20,17 +20,19 @@
20 20 <div>
21 21 <div class="vars">
22 22 <var id="VALUES">$.map( randRange( 1000, 16000, randRange( 3, 7 ) ), function( n ){ return ( n / 1000 ).toFixed( randRange( 1, 2 ) ); } )</var>
23   - <var id="ANSWER">eval( $.map( VALUES, round ).join("+") )</var>
  23 + <var id="ANSWER">sum( $.map( VALUES, round ) )</var>
24 24 <var id="TYPES">randFromArray( [ [ "jogging", "ran", "mile" ], [ "riding a bicycle ", "traveled", "mile" ], [ "collecting mushrooms", "collected", "pound" ], [ "painting a roof", "painted", "square foot" ], [ "harvesting grain", "harvested", "tonne" ] ] )</var>
25 25 <var id="ACC">0</var>
26   - <var id="SIZE">$.map( VALUES, function( i ){
27   - if ( round( i ) &lt; i ) {
28   - return "smaller than";
29   - }
30   - else{
31   - return "bigger or equal to";
32   - }
33   - } ) </var>
  26 + <var id="SIZE">
  27 + $.map( VALUES, function( i ){
  28 + if ( round( i ) &lt; i ) {
  29 + return "smaller than";
  30 + }
  31 + else{
  32 + return "bigger or equal to";
  33 + }
  34 + } )
  35 + </var>
34 36 <var id="SUM">
35 37 (function() {
36 38 var sum = 0;
2  exercises/exponents_3.html
@@ -17,7 +17,7 @@
17 17 <var id="BASE_N">VALS.base_1</var>
18 18 <var id="BASE_D">VALS.base_2</var>
19 19
20   - <var id="EXP_NEG">random() &lt; .75</var>
  20 + <var id="EXP_NEG">random() &lt; 0.75</var>
21 21 <var id="EXP_D">VALS.root</var>
22 22
23 23 <!-- base, flipped if the exponent is negative. -->
4 exercises/exponents_4.html
@@ -15,10 +15,10 @@
15 15 <div class="vars">
16 16 <var id="VALS">twoBasesOneRoot()</var>
17 17
18   - <var id="EXP_NEG">random() &lt; .75</var>
  18 + <var id="EXP_NEG">random() &lt; 0.75</var>
19 19 <var id="EXP_D_ORIG">VALS.root</var>
20 20
21   - <var id="BASE_NEG">isOdd( EXP_D ) && ( random() &lt; .75 )</var>
  21 + <var id="BASE_NEG">isOdd( EXP_D ) && ( random() &lt; 0.75 )</var>
22 22 <var id="BASE_N">VALS.base_1</var>
23 23 <var id="BASE_D">VALS.base_2</var>
24 24
4 exercises/fractions_on_the_number_line.html
@@ -61,7 +61,7 @@
61 61 <div class="exercise">
62 62 <div class="vars" >
63 63 <var id="FOLLOW">follow()</var>
64   - <div data-ensure="NOMINATOR/DENOMINATOR < 3 && NOMINATOR/DENOMINATOR != round( NOMINATOR/DENOMINATOR )">
  64 + <div data-ensure="NOMINATOR/DENOMINATOR < 3 && NOMINATOR/DENOMINATOR !== round( NOMINATOR/DENOMINATOR )">
65 65 <var id="NOMINATOR">randRange( 0 , 15 )</var>
66 66 <var id="DENOMINATOR">randRange( 1 , 15 )</var>
67 67 </div>
@@ -99,7 +99,7 @@
99 99 <div class="hints">
100 100 <p data-if="reduces( NOMINATOR, DENOMINATOR )"><code><var>NICE_NUMBER</var></code> is equal to <code><var>REDUCED_NUMBER</var></code> </p>
101 101 <p> Because <code><var>REDUCED_NUMBER</var></code> is <span data-if="NUMBER > 0">positive</span><span data-else>negative</span> we go <span data-if="NUMBER > 0">right</span><span data-else>left</span> from 0</p>
102   - <p><code><var>REDUCED_NUMBER</var></code> is <code><var>fraction( parseInt( SIGN + ( NOMINATOR - ( DENOMINATOR * floor( abs( NUMBER) ) ) ) ) , DENOMINATOR, true, true )</var></code> away from <var>floor( abs( NUMBER ) ) * NUMBER/abs( NUMBER )</var></p>
  102 + <p><code><var>REDUCED_NUMBER</var></code> is <code><var>fraction( parseInt( SIGN + ( NOMINATOR - ( DENOMINATOR * floor( abs( NUMBER) ) ) ), 10 ) , DENOMINATOR, true, true )</var></code> away from <var>floor( abs( NUMBER ) ) * NUMBER/abs( NUMBER )</var></p>
103 103 <p>Therefore <code><var>REDUCED_NUMBER</var></code> is between <var>floor( NUMBER )</var> and <var>ceil( NUMBER )</var></p>
104 104 <div>
105 105 If we zoom in to that portion of the number line:
2  exercises/functions_1.html
@@ -10,7 +10,7 @@
10 10 <div class="vars">
11 11 <var id="FUNCTION_PATH">
12 12 (function() {
13   - var functionPath = new Array();
  13 + var functionPath = [];
14 14
15 15 functionPath.push([ -11, randRange( -5, 5 ) ]);
16 16 for( var i = -10; i &lt; 11; i++ ) {
4 exercises/functions_2.html
@@ -22,7 +22,7 @@
22 22 (function() {
23 23 var currentY = randRange( -5, 5 );
24 24
25   - var functionPath = new Array();
  25 + var functionPath = [];
26 26 functionPath.push([-11, currentY]);
27 27
28 28 for( var i = -10; i &lt; 11; i++ ) {
@@ -51,7 +51,7 @@
51 51 (function() {
52 52 var gY = randRange( 3, -7 );
53 53
54   - var gPath = new Array();
  54 + var gPath = [];
55 55 gPath.push([-11, gY]);
56 56
57 57 for( var i = -10; i &lt; 11; i++ ) {
4 exercises/graphing_inequalities.html
@@ -21,8 +21,8 @@
21 21 <var id="STD_FORM">randFromArray([ true, false ])</var>
22 22 <var id="COMP">randFromArray([ "&lt;", "&gt;", "&le;", "&ge;" ])</var>
23 23 <var id="STD_FORM_COMP">B &lt; 0 ? { "&lt;": "&gt;", "&gt;": "&lt;", "&le;": "&ge;", "&ge;": "&le;" }[ COMP ] : COMP</var>
24   - <var id="LESS_THAN">COMP == "&lt;" || COMP == "&le;"</var>
25   - <var id="INCLUSIVE">COMP == "&ge;" || COMP == "&le;"</var>
  24 + <var id="LESS_THAN">COMP === "&lt;" || COMP === "&le;"</var>
  25 + <var id="INCLUSIVE">COMP === "&ge;" || COMP === "&le;"</var>
26 26
27 27 </div>
28 28
20 exercises/graphing_inequalities_2.html
@@ -21,22 +21,22 @@
21 21 <var id="STD_FORM">randFromArray([ true, false ])</var>
22 22 <var id="COMP">randFromArray([ "&lt;", "&gt;", "&le;", "&ge;" ])</var>
23 23 <var id="STD_FORM_COMP">B &lt; 0 ? { "&lt;": "&gt;", "&gt;": "&lt;", "&le;": "&ge;", "&ge;": "&le;" }[ COMP ] : COMP</var>
24   - <var id="LESS_THAN">COMP == "&lt;" || COMP == "&le;"</var>
25   - <var id="INCLUSIVE">COMP == "&ge;" || COMP == "&le;"</var>
  24 + <var id="LESS_THAN">COMP === "&lt;" || COMP === "&le;"</var>
  25 + <var id="INCLUSIVE">COMP === "&ge;" || COMP === "&le;"</var>
26 26 <div data-ensure="sqrt( pow( POINT_1[0] - POINT_2[0], 2 ) + pow( POINT_1[1] - POINT_2[1], 2 ) ) > 4">
27 27 <var id="POINT_1">[ randRangeExclude( -9, 9, [ -3, -2, -1, 0 ] ), randRangeExclude( -9, 9, [ -1, -2 ] ) ]</var>
28 28 <var id="POINT_2">[ randRangeExclude( -9, 9, [ -3, -2, -1, 0 ] ), randRangeExclude( -9, 9, [ -1, -2 ] ) ]</var>
29 29 <var id="POINT_1_SOLUTION">
30   - (((COMP == "&lt;") &amp;&amp; ( POINT_1[1] &lt; SLOPE * POINT_1[0] + YINT ))
31   - || ((COMP == "&le;") &amp;&amp; ( POINT_1[1] &lt;= SLOPE * POINT_1[0] + YINT ))
32   - || ((COMP == "&gt;") &amp;&amp; ( POINT_1[1] &gt; SLOPE * POINT_1[0] + YINT ))
33   - || ((COMP == "&ge;") &amp;&amp; ( POINT_1[1] &gt;= SLOPE * POINT_1[0] + YINT )))
  30 + (((COMP === "&lt;") &amp;&amp; ( POINT_1[1] &lt; SLOPE * POINT_1[0] + YINT ))
  31 + || ((COMP === "&le;") &amp;&amp; ( POINT_1[1] &lt;= SLOPE * POINT_1[0] + YINT ))
  32 + || ((COMP === "&gt;") &amp;&amp; ( POINT_1[1] &gt; SLOPE * POINT_1[0] + YINT ))
  33 + || ((COMP === "&ge;") &amp;&amp; ( POINT_1[1] &gt;= SLOPE * POINT_1[0] + YINT )))
34 34 </var>
35 35 <var id="POINT_2_SOLUTION">
36   - (((COMP == "&lt;") &amp;&amp; ( POINT_2[1] &lt; SLOPE * POINT_2[0] + YINT ))
37   - || ((COMP == "&le;") &amp;&amp; ( POINT_2[1] &lt;= SLOPE * POINT_2[0] + YINT ))
38   - || ((COMP == "&gt;") &amp;&amp; ( POINT_2[1] &gt; SLOPE * POINT_2[0] + YINT ))
39   - || ((COMP == "&ge;") &amp;&amp; ( POINT_2[1] &gt;= SLOPE * POINT_2[0] + YINT )))
  36 + (((COMP === "&lt;") &amp;&amp; ( POINT_2[1] &lt; SLOPE * POINT_2[0] + YINT ))
  37 + || ((COMP === "&le;") &amp;&amp; ( POINT_2[1] &lt;= SLOPE * POINT_2[0] + YINT ))
  38 + || ((COMP === "&gt;") &amp;&amp; ( POINT_2[1] &gt; SLOPE * POINT_2[0] + YINT ))
  39 + || ((COMP === "&ge;") &amp;&amp; ( POINT_2[1] &gt;= SLOPE * POINT_2[0] + YINT )))
40 40 </var>
41 41 </div>
42 42 </div>
8 exercises/graphing_systems_of_inequalities.html
@@ -38,10 +38,10 @@
38 38 <var id="COMP_2">randFromArray([ "&lt;", "&gt;", "&le;", "&ge;" ])</var>
39 39 <var id="STD_FORM_COMP_1">B_1 &lt; 0 ? { "&lt;": "&gt;", "&gt;": "&lt;", "&le;": "&ge;", "&ge;": "&le;" }[ COMP_1 ] : COMP_1</var>
40 40 <var id="STD_FORM_COMP_2">B_2 &lt; 0 ? { "&lt;": "&gt;", "&gt;": "&lt;", "&le;": "&ge;", "&ge;": "&le;" }[ COMP_2 ] : COMP_2</var>
41   - <var id="LESS_THAN_1">COMP_1 == "&lt;" || COMP_1 == "&le;"</var>
42   - <var id="LESS_THAN_2">COMP_2 == "&lt;" || COMP_2 == "&le;"</var>
43   - <var id="INCLUSIVE_1">COMP_1 == "&ge;" || COMP_1 == "&le;"</var>
44   - <var id="INCLUSIVE_2">COMP_2 == "&ge;" || COMP_2 == "&le;"</var>
  41 + <var id="LESS_THAN_1">COMP_1 === "&lt;" || COMP_1 === "&le;"</var>
  42 + <var id="LESS_THAN_2">COMP_2 === "&lt;" || COMP_2 === "&le;"</var>
  43 + <var id="INCLUSIVE_1">COMP_1 === "&ge;" || COMP_1 === "&le;"</var>
  44 + <var id="INCLUSIVE_2">COMP_2 === "&ge;" || COMP_2 === "&le;"</var>
45 45 </div>
46 46
47 47 <p class="question">
40 exercises/graphing_systems_of_inequalities_2.html
@@ -38,34 +38,34 @@
38 38 <var id="COMP_2">randFromArray([ "&lt;", "&gt;", "&le;", "&ge;" ])</var>
39 39 <var id="STD_FORM_COMP_1">B_1 &lt; 0 ? { "&lt;": "&gt;", "&gt;": "&lt;", "&le;": "&ge;", "&ge;": "&le;" }[ COMP_1 ] : COMP_1</var>
40 40 <var id="STD_FORM_COMP_2">B_2 &lt; 0 ? { "&lt;": "&gt;", "&gt;": "&lt;", "&le;": "&ge;", "&ge;": "&le;" }[ COMP_2 ] : COMP_2</var>
41   - <var id="LESS_THAN_1">COMP_1 == "&lt;" || COMP_1 == "&le;"</var>
42   - <var id="LESS_THAN_2">COMP_2 == "&lt;" || COMP_2 == "&le;"</var>
43   - <var id="INCLUSIVE_1">COMP_1 == "&ge;" || COMP_1 == "&le;"</var>
44   - <var id="INCLUSIVE_2">COMP_2 == "&ge;" || COMP_2 == "&le;"</var>
  41 + <var id="LESS_THAN_1">COMP_1 === "&lt;" || COMP_1 === "&le;"</var>
  42 + <var id="LESS_THAN_2">COMP_2 === "&lt;" || COMP_2 === "&le;"</var>
  43 + <var id="INCLUSIVE_1">COMP_1 === "&ge;" || COMP_1 === "&le;"</var>
  44 + <var id="INCLUSIVE_2">COMP_2 === "&ge;" || COMP_2 === "&le;"</var>
45 45 <div data-ensure="sqrt( pow( POINT_1[0] - POINT_2[0], 2 ) + pow( POINT_1[1] - POINT_2[1], 2 ) ) > 4">
46 46 <var id="POINT_1">[ randRangeExclude( -9, 9, [ -3, -2, -1, 0 ] ), randRangeExclude( -9, 9, [ -1, -2 ] ) ]</var>
47 47 <var id="POINT_2">[ randRangeExclude( -9, 9, [ -3, -2, -1, 0 ] ), randRangeExclude( -9, 9, [ -1, -2 ] ) ]</var>
48 48 <var id="POINT_1_SOLUTION">
49   - (((COMP_1 == "&lt;") &amp;&amp; ( POINT_1[1] &lt; SLOPE_1 * POINT_1[0] + YINT_1 ))
50   - || ((COMP_1 == "&le;") &amp;&amp; ( POINT_1[1] &lt;= SLOPE_1 * POINT_1[0] + YINT_1 ))
51   - || ((COMP_1 == "&gt;") &amp;&amp; ( POINT_1[1] &gt; SLOPE_1 * POINT_1[0] + YINT_1 ))
52   - || ((COMP_1 == "&ge;") &amp;&amp; ( POINT_1[1] &gt;= SLOPE_1 * POINT_1[0] + YINT_1 )))
  49 + (((COMP_1 === "&lt;") &amp;&amp; ( POINT_1[1] &lt; SLOPE_1 * POINT_1[0] + YINT_1 ))
  50 + || ((COMP_1 === "&le;") &amp;&amp; ( POINT_1[1] &lt;= SLOPE_1 * POINT_1[0] + YINT_1 ))
  51 + || ((COMP_1 === "&gt;") &amp;&amp; ( POINT_1[1] &gt; SLOPE_1 * POINT_1[0] + YINT_1 ))
  52 + || ((COMP_1 === "&ge;") &amp;&amp; ( POINT_1[1] &gt;= SLOPE_1 * POINT_1[0] + YINT_1 )))
53 53 &amp;&amp;
54   - (((COMP_2 == "&lt;") &amp;&amp; ( POINT_1[1] &lt; SLOPE_2 * POINT_1[0] + YINT_2 ))
55   - || ((COMP_2 == "&le;") &amp;&amp; ( POINT_1[1] &lt;= SLOPE_2 * POINT_1[0] + YINT_2 ))
56   - || ((COMP_2 == "&gt;") &amp;&amp; ( POINT_1[1] &gt; SLOPE_2 * POINT_1[0] + YINT_2 ))
57   - || ((COMP_2 == "&ge;") &amp;&amp; ( POINT_1[1] &gt;= SLOPE_2 * POINT_1[0] + YINT_2 )))
  54 + (((COMP_2 === "&lt;") &amp;&amp; ( POINT_1[1] &lt; SLOPE_2 * POINT_1[0] + YINT_2 ))
  55 + || ((COMP_2 === "&le;") &amp;&amp; ( POINT_1[1] &lt;= SLOPE_2 * POINT_1[0] + YINT_2 ))
  56 + || ((COMP_2 === "&gt;") &amp;&amp; ( POINT_1[1] &gt; SLOPE_2 * POINT_1[0] + YINT_2 ))
  57 + || ((COMP_2 === "&ge;") &amp;&amp; ( POINT_1[1] &gt;= SLOPE_2 * POINT_1[0] + YINT_2 )))
58 58 </var>
59 59 <var id="POINT_2_SOLUTION">
60   - (((COMP_1 == "&lt;") &amp;&amp; ( POINT_2[1] &lt; SLOPE_1 * POINT_2[0] + YINT_1 ))
61   - || ((COMP_1 == "&le;") &amp;&amp; ( POINT_2[1] &lt;= SLOPE_1 * POINT_2[0] + YINT_1 ))
62   - || ((COMP_1 == "&gt;") &amp;&amp; ( POINT_2[1] &gt; SLOPE_1 * POINT_2[0] + YINT_1 ))
63   - || ((COMP_1 == "&ge;") &amp;&amp; ( POINT_2[1] &gt;= SLOPE_1 * POINT_2[0] + YINT_1 )))
  60 + (((COMP_1 === "&lt;") &amp;&amp; ( POINT_2[1] &lt; SLOPE_1 * POINT_2[0] + YINT_1 ))
  61 + || ((COMP_1 === "&le;") &amp;&amp; ( POINT_2[1] &lt;= SLOPE_1 * POINT_2[0] + YINT_1 ))
  62 + || ((COMP_1 === "&gt;") &amp;&amp; ( POINT_2[1] &gt; SLOPE_1 * POINT_2[0] + YINT_1 ))
  63 + || ((COMP_1 === "&ge;") &amp;&amp; ( POINT_2[1] &gt;= SLOPE_1 * POINT_2[0] + YINT_1 )))
64 64 &amp;&amp;
65   - (((COMP_2 == "&lt;") &amp;&amp; ( POINT_2[1] &lt; SLOPE_2 * POINT_2[0] + YINT_2 ))
66   - || ((COMP_2 == "&le;") &amp;&amp; ( POINT_2[1] &lt;= SLOPE_2 * POINT_2[0] + YINT_2 ))
67   - || ((COMP_2 == "&gt;") &amp;&amp; ( POINT_2[1] &gt; SLOPE_2 * POINT_2[0] + YINT_2 ))
68   - || ((COMP_2 == "&ge;") &amp;&amp; ( POINT_2[1] &gt;= SLOPE_2 * POINT_2[0] + YINT_2 )))