# jpallen/khan-exercises forked from Khan/khan-exercises

Run JSHint

... for questionable benefit.
1 parent 9ce709a commit fab2c19c08e0a95c1d1f9c3db6d67dbac3562d77 spicyj committed Jan 14, 2012
Showing with 361 additions and 349 deletions.
1. +29 −6 build/pack.rb
2. +1 −1 exercises/absolute_value.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
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
59. +6 −8 exercises/rate_problems_2.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,17 +1,14 @@ begin require 'rubygems' require 'nokogiri' + require 'execjs' require 'uglifier' require 'fileutils' rescue LoadError puts puts "-" * 78 puts "Oops! Some gems are missing; please run:" puts " sudo gem install nokogiri uglifier therubyracer" - puts - puts "If you prefer another JS runtime (https://github.com/sstephenson/execjs)," - puts "be aware that this script is much faster (around 50x speedup) using" - puts "therubyracer, which is based on Chrome's V8 engine." puts "-" * 78 puts exit 1 @@ -24,15 +21,39 @@ puts "-" * 78 puts "Warning! You don't have therubyracer installed, packing might be slow. Try:" puts " sudo gem install therubyracer" + puts + puts "If you prefer another JS runtime (https://github.com/sstephenson/execjs)," + puts "be aware that this script is much faster (around 50x speedup) using" + puts "therubyracer, which is based on Chrome's V8 engine." puts "-" * 78 puts end +JSHINT_ENABLED = false +JSHINT_OPTIONS = { + :laxbreak => true, + :eqeqeq => true, + :loopfunc => true, +} + +def jshint(js) + return unless JSHINT_ENABLED + if !@jshint.call("JSHINT", js, JSHINT_OPTIONS) + @jshint.eval("JSHINT.errors").each do |err| + break if err["reason"] == "Expected ')' to match '(' from line 1 and instead saw ','." + # puts "-- #{js}" + puts "-- #{err["reason"]} (#{err["line"]}:#{err["character"]})" + puts "-- > #{(err["evidence"] || "").strip}" + puts "--" + end + end +end + # All paths are relative to khan-exercises/ root Dir.chdir(File.join(File.dirname(__FILE__), "..")) -# Discard all comments -@uglifier = Uglifier.new(:copyright => false) +@uglifier = Uglifier.new(:copyright => false) # Discard all comments +@jshint = ExecJS.compile(File.read("build/jshint.js")) FileUtils.mkdir_p("exercises-packed") @@ -53,6 +74,7 @@ next if var.content !~ /\S/ # only whitespace + jshint("return (#{var.content});") exp = "(#{var.content})" var.content = @uglifier.compile(exp) end @@ -83,6 +105,7 @@ %w[data-ensure data-if data-else-if].each do |data_attr| doc.css("[#{data_attr}]").each do |el| + jshint("return (#{el[data_attr]});") js = el[data_attr] el[data_attr] = @uglifier.compile(js) end
2 exercises/absolute_value.html
 @@ -7,7 +7,7 @@
-
+
rand(5) > 0 ? randRange( 1, 9 ) : 0 rand(3) > 0 ? "." + randRange(1, 9) : "" randFromArray(["", "-"])
 @@ -11,7 +11,7 @@ randRange( 100, 999 ) randRange( 100, 999 )
- randRangeWeighted( 0, 3, 0, .1 ) + randRangeWeighted( 0, 3, 0, 0.1 ) randRange( 1, 3 )
A * ( B_DECIMAL > A_DECIMAL ? pow( 10, B_DECIMAL - A_DECIMAL ) : 1)
 @@ -8,11 +8,11 @@
- randRangeWeighted( 0, 9, 0, .25 )*1000 + randRangeWeighted( 0, 9, 0, 0.25 )*1000 randRange( 0, 9 )*100 randRange( 0, 9 )*10 randRange ( 0, 9 )*1 - randRangeWeighted( 0, 9, 0, .25 )*1000 + randRangeWeighted( 0, 9, 0, 0.25 )*1000 randRange( 0, 9 )*100 randRange( 0, 9 )*10 randRange ( 0, 9 )*1
 @@ -6,10 +6,10 @@ @@ -35,39 +35,39 @@ ["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], ["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], ["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], - ["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], + ["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] ]) - - shuffle( [0, 1, 2, 3] ) - - - ( function( usePercentages ) { - var rangemin = usePercentages ? 1 : 2; - var rangemax = usePercentages ? 100 : 10; - var vals = [0, 0, 0, 0]; - vals[VARINDX_X] = randRange( rangemin, rangemax ); - vals[VARINDX_Y] = randRange( rangemin, rangemax ); - vals[VARINDX_X_AND_Y] = randRange( max( rangemin, vals[VARINDX_X]+vals[VARINDX_Y]-100 ), min( vals[VARINDX_X], vals[VARINDX_Y] ) ); - vals[VARINDX_X_OR_Y] = vals[VARINDX_X] + vals[VARINDX_Y] - vals[VARINDX_X_AND_Y]; - return vals; - } )( USEPERCENTAGES ) - - - ( function() { + + shuffle( [0, 1, 2, 3] ) + + + ( function( usePercentages ) { + var rangemin = usePercentages ? 1 : 2; + var rangemax = usePercentages ? 100 : 10; + var vals = [0, 0, 0, 0]; + vals[VARINDX_X] = randRange( rangemin, rangemax ); + vals[VARINDX_Y] = randRange( rangemin, rangemax ); + vals[VARINDX_X_AND_Y] = randRange( max( rangemin, vals[VARINDX_X]+vals[VARINDX_Y]-100 ), min( vals[VARINDX_X], vals[VARINDX_Y] ) ); + vals[VARINDX_X_OR_Y] = vals[VARINDX_X] + vals[VARINDX_Y] - vals[VARINDX_X_AND_Y]; + return vals; + } )( USEPERCENTAGES ) + + + ( function() { var optionalPercentage = USEPERCENTAGES ? "% are " : " "; - var qstn = INTRO; - for (var i=0; i < ORDER.length-1; i++) { + var qstn = INTRO; + for (var i=0; i < ORDER.length-1; i++) { qstn += (i===ORDER.length-2) ? " and " : ""; qstn += VARVALS[ORDER[i]] + optionalPercentage + VARDESC[ORDER[i]]; qstn += (i < ORDER.length-2) ? ", " : ". "; - } - qstn += QSTNPRETEXT + VARDESC[ORDER[ORDER.length-1]] + QSTNPOSTTEXT; - return qstn; - } )() - - - function (innerString) { return enFunc(innerString, USEPERCENTAGES); } + } + qstn += QSTNPRETEXT + VARDESC[ORDER[ORDER.length-1]] + QSTNPOSTTEXT; + return qstn; + } )() + + + function (innerString) { return enFunc(innerString, USEPERCENTAGES); }

QUESTIONTEXT

2 exercises/angle_bisector_theorem.html
 @@ -8,7 +8,7 @@
- randomTriangleAngles.triangle() + randomTriangleAngles.triangle() [ [ 0, 1 ], [] ] [ [ 1 ], [ 2] ]
4 exercises/angles_1.html
 @@ -377,14 +377,14 @@
• \overline{HI} \parallel \overline{JK}, lines HI and JK are parallel.
• -
• +
• \color{purple}{\angle{BAC}} = Tri_X°
• \color{purple}{\angle{AKJ}} = Tri_Y°
• -
• +
• \color{green}{\angle{AJK}} = Tri_Z°
14 exercises/angles_2.html
 @@ -278,19 +278,19 @@ label([0,2], "\\color{orange}{" + X + "°}", "below left");

-

+

\color{blue}{\angle{GHD}} = \color{orange}{\angle{AGH}}. We know those 2 angles are equal because they are alternate interior angles of 2 parallel lines.

-

+

\color{blue}{\angle{CHF}} = \color{orange}{\angle{AGH}}. We know those 2 angles are equal because they are corresponding angles formed by parallel lines, and a single bisecting lines.

Therefore, - + \angle{GHD} = X° LABEL.remove(); @@ -543,7 +543,7 @@

Tri2_X
-

+

\color{purple}{\angle{DIJ}} = 180° - \color{orange}{\angle{AIC}}. This is because angles along a line total 180°. @@ -564,7 +564,7 @@

-

+

\color{teal}{\angle{DJI}} = 180° - \color{green}{\angle{BDC}} - \color{purple}{\angle{DIJ}}. We know this because the sum of angles inside a triangle add up to 180°. @@ -588,7 +588,7 @@

-

+

\color{blue}{\angle{AJF}} = \color{teal}{\angle{DJI}}. We know they are equal because they are opposite angles.

@@ -599,7 +599,7 @@

Therefore, - + \angle{AJF} = Tri2_X° LABEL.remove();

4 exercises/chain_rule_1.html
 @@ -13,7 +13,7 @@ ( ( OUTER.f[0] === '^' && OUTER.f[1] === 'e' && INNER.f[0] === 'ln' ) - || ( OUTER.f[0] === 'ln' && INNER.f[0] === '^' && INNER.f[1] == 'e' ) ) + || ( OUTER.f[0] === 'ln' && INNER.f[0] === '^' && INNER.f[1] === 'e' ) ) ? 'x' : null @@ -32,7 +32,7 @@ ( ( OUTER.f[0] === '^' && OUTER.f[1] === 'e' && INNER.f[0] === 'ln' ) - || ( OUTER.f[0] === 'ln' && INNER.f[0] === '^' && INNER.f[1] == 'e' ) ) + || ( OUTER.f[0] === 'ln' && INNER.f[0] === '^' && INNER.f[1] === 'e' ) ) ? [['frac', 'x', 'x'], '1'] : []
2 exercises/changing_percents_to_fractions.html
 @@ -31,7 +31,7 @@

A\% literally means A per 100

Putting this in fraction form: fraction( A , 100 )

-

Multiplying top and bottom by 10 to get rid of the decimal: fraction( A * 10 , 1000 )

+

Multiplying top and bottom by 10 to get rid of the decimal: fraction( A * 10 , 1000 )

Both numerator and denominator are divisible by getGCD( A * 10 , 1000 ).

Reducing to lowest terms, fractionReduce( A * 10 , 1000 ).

Optionally, the improper fraction fractionReduce( A * 10 , 1000 ) can be converted to the mixed number ( A * 10 - A * 10 % 1000 ) / 1000 + fractionReduce( round ( A * 10 % 1000 ), 1000 ).

 @@ -13,7 +13,7 @@
- randomTriangleAngles.triangle() + randomTriangleAngles.triangle()
2 exercises/comparing_absolute_values.html
 @@ -38,7 +38,7 @@
- randFromArray([[ "|", "|", ], [ "|", "", ], [ "", "|", ]]) + randFromArray([[ "|", "|" ], [ "|", "" ], [ "", "|" ]]) randRange(-10, 10) ( NUM_1 < 0 ) ? randRange(0, 10) : randRange(-10, -1) ABS_1 ? abs( NUM_1 ) : NUM_1
2 exercises/compound_inequalities.html
 @@ -62,7 +62,7 @@ randFromArray([ "or", "and" ]) OR === "or" tabulate( function() { - return randRange( 2, 9 ) * ( rand( 3 ) > 0 ? 1 : -1 ) + return randRange( 2, 9 ) * ( rand( 3 ) > 0 ? 1 : -1 ); }, 2 ) (function() { if ( LESS_THAN[0] && LESS_THAN[1] ) {
4 exercises/congruent_triangles_1.html
 @@ -2,7 +2,7 @@ - Congruent Triangles 1 + Congruent triangles 1 @@ -30,7 +30,7 @@ function(){ var t = new Triangle( [ 7, -6 ], B, B_SIZE, {} ); - t.labels = { "name": "B", "angles" : clearArray( t.niceAngles, B_ANGLES ), "sides" : clearArray( t.niceSideLengths, B_SIDES ) } + t.labels = { "name": "B", "angles" : clearArray( t.niceAngles, B_ANGLES ), "sides" : clearArray( t.niceSideLengths, B_SIDES ) }; return t; }()
8 exercises/congruent_triangles_2.html
 @@ -102,10 +102,10 @@ function(){ var newAng = RAND_ANG; - if ( RAND_ANG == 0 ){ + if ( RAND_ANG === 0 ){ newAng = 1; } - else if ( RAND_ANG == 1 ){ + else if ( RAND_ANG === 1 ){ newAng = 0; } return newAng; @@ -116,10 +116,10 @@ randRange( 0, 2 ) function(){ - if ( ANG_LEFT == 1 ){ + if ( ANG_LEFT === 1 ){ return 0; } - if ( ANG_LEFT == 0 ){ + if ( ANG_LEFT === 0 ){ return 1; } return 2;
2 exercises/converting_repeating_decimals_to_fractions_1.html
 @@ -38,7 +38,7 @@

Subtracting the two equations, we have:

\large{(MULT1 - MULT2)x = DIFF}

-

\large{x = fraction( DIFF, MULT1 - MULT2 )}\quad \text{or} \quad\large{mixedFractionFromImproper( DIFF, MULT1 - MULT2 )}

+

\large{x = fraction( DIFF, MULT1 - MULT2 )}\quad \text{or} \quad\large{mixedFractionFromImproper( DIFF, MULT1 - MULT2 )}

\large{x = fraction( toFraction( N4 )[ 0 ], toFraction( N4 )[ 1 ])}\quad \text{or} \quad\large{mixedFractionFromImproper( toFraction( N4 )[ 0 ], toFraction( N4 )[ 1 ] )}

2 exercises/converting_repeating_decimals_to_fractions_2.html
 @@ -81,7 +81,7 @@

Subtracting the two equations, we have:

\large{(MULT1 - MULT2)x = DIFF}

-

\large{x = fraction( DIFF, MULT1 - MULT2 )}\quad \text{or} \quad\large{mixedFractionFromImproper( DIFF, MULT1 - MULT2 )}

+

\large{x = fraction( DIFF, MULT1 - MULT2 )}\quad \text{or} \quad\large{mixedFractionFromImproper( DIFF, MULT1 - MULT2 )}

\large{x = fraction( toFraction( N4 )[ 0 ], toFraction( N4 )[ 1 ])}\quad \text{or} \quad\large{mixedFractionFromImproper( toFraction( N4 )[ 0 ], toFraction( N4 )[ 1 ] )}

4 exercises/creating_bar_charts_1.html
 @@ -1,5 +1,5 @@ - + Creating bar charts 1 @@ -25,7 +25,7 @@ randFromArray([ "animal", "color", "fruit", "course" ]) jQuery.map( _.range(5), function( n ) { return ( KhanUtil[ SUBJECT ] )( n + 1 ); } ) jQuery.map( _.range(5), function() { return randRange( 0, 10 ); } ) - eval( DATA.join( "+" ) ) + sum( DATA ) randFromArray([ "student", "teacher", "person" ])
6 exercises/decimals_on_the_number_line.html
 @@ -21,14 +21,14 @@ arr = []; for ( i = 0; i < pos; i++){ - arr.push( NUMBER - ((pos - i) * 0.47)) + arr.push( NUMBER - ((pos - i) * 0.47)); } arr.push( NUMBER ); for ( i = pos + 1; i < 5; i++ ){ - arr.push( NUMBER + (( i - pos) * 0.47)) + arr.push( NUMBER + (( i - pos) * 0.47)); } return arr; - })() + })() [ "A", "B", "C", "D", "E" ] POSS_ANSWER[ WRONGS.indexOf( NUMBER ) ]
4 exercises/dependent_probability.html
 @@ -50,7 +50,7 @@ PERCENT_CHANCE_UNFAIR_HEADS / 100 (function() { - var uhdf = DECIMAL_CHANCE_UNFAIR_HEADS.toString() + var uhdf = DECIMAL_CHANCE_UNFAIR_HEADS.toString(); for (var i = 0; i < NUM_FLIPS - 1; i++) { uhdf += " \\times " + DECIMAL_CHANCE_UNFAIR_HEADS; } @@ -82,7 +82,7 @@ 1 - CHANCE_UNFAIR_PICKED round(10000 * (CHANCE_UNFAIR_PICKED * pow((PERCENT_CHANCE_UNFAIR_HEADS / 100), NUM_FLIPS) + - CHANCE_FAIR_PICKED * pow(.5,NUM_FLIPS))) / 100 + CHANCE_FAIR_PICKED * pow(0.5,NUM_FLIPS))) / 100
20 exercises/derivative_intuition.html
 @@ -91,38 +91,38 @@ { text: "sin(x)", ddxtext: "cos(x)", - fnx: function(x) { return Math.sin(x) }, - ddx: function(x) { return Math.cos(x) }, + fnx: function(x) { return Math.sin(x); }, + ddx: function(x) { return Math.cos(x); }, xrange: [-1.25*Math.PI, 1.25*Math.PI], yrange: [ -1.25, 1.25 ], 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 ], options: { xLabelFormat: piFraction } }, { text: "cos(x)", ddxtext: "-sin(x)", - fnx: function(x) { return Math.cos(x) }, - ddx: function(x) { return -Math.sin(x) }, + fnx: function(x) { return Math.cos(x); }, + ddx: function(x) { return -Math.sin(x); }, xrange: [-1.25*Math.PI, 1.25*Math.PI], yrange: [ -1.25, 1.25 ], 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 ], options: { xLabelFormat: piFraction } }, { text: "e^x", ddxtext: "e^x", - fnx: function(x) { return Math.exp(x, Math.E) }, - ddx: function(x) { return Math.exp(x, Math.E) }, + fnx: function(x) { return Math.exp(x, Math.E); }, + ddx: function(x) { return Math.exp(x, Math.E); }, xrange: [-5, 5], yrange: [ -5, 15 ], points: [ -2, -1, 0, 1, 2 ], options: {} }, { text: "ln(x)", ddxtext: "\\frac{1}{x}", - fnx: function(x) { return Math.log(x) }, - ddx: function(x) { return 1/x }, - xrange: [.001, 5], + fnx: function(x) { return Math.log(x); }, + ddx: function(x) { return 1/x; }, + xrange: [ 0.001, 5 ], yrange: [ -5, 5 ], - points: [ .25, .5, 1, 2, 3, 4 ], + points: [ 0.25, 0.5, 1, 2, 3, 4 ], options: { range: [ [ -0.25, 4.75 ], [ -5, 5 ] ] } } ])
48 exercises/derivatives_1.html
 @@ -71,52 +71,52 @@

\qquad = \displaystyle \lim_{H \to 0} \frac{(expr( ["+", ["*", A, ["^", ["+", "x", H], 2]], - ["*", B, ["+", "x", H]], - C] + ["*", B, ["+", "x", H]], + C] )) - (expr( ["+", ["*", A, ["^", "x", 2]], - ["*", B, "x"], - C] + ["*", B, "x"], + C] ))}{H}

\qquad = \displaystyle \lim_{H \to 0} \frac{(expr( ["+", ["*", A, ["+", ["^", "x", 2], - "2x " + H, - ["^", H, 2]]], - ["*", B, ["+", "x", H]], - C] + "2x " + H, + ["^", H, 2]]], + ["*", B, ["+", "x", H]], + C] )) - (expr( ["+", ["*", A, ["^", "x", 2]], - ["*", B, "x"], - C] + ["*", B, "x"], + C] ))}{H}

\qquad = \displaystyle \lim_{H \to 0} \frac{expr( ["+", ["*", A, ["^", "x", 2]], - ["*", 2 * A, "x " + H], - ["*", A, ["^", H, 2]], - ["*", B, "x"], - ["*", B, H], - C, - ["*", -A, ["^", "x", 2]], - ["*", -B, "x"], - -C] + ["*", 2 * A, "x " + H], + ["*", A, ["^", H, 2]], + ["*", B, "x"], + ["*", B, H], + C, + ["*", -A, ["^", "x", 2]], + ["*", -B, "x"], + -C] )}{H}

\qquad = \displaystyle \lim_{H \to 0} \frac{expr( ["+", ["*", 2 * A, "x " + H], - ["*", A, ["^", H, 2]], - ["*", B, H]] + ["*", A, ["^", H, 2]], + ["*", B, H]] )}{H}

\qquad = \displaystyle \lim_{H \to 0} expr( ["+", ["*", 2 * A, "x"], - ["*", A, H], - B] + ["*", A, H], + B] )

\qquad = \displaystyle expr( ["+", ["*", 2 * A, "x"], - B] + B] )

\qquad = \displaystyle expr( ["+", ["*", 2 * A, X], - B] + B] )

\qquad = 2 * A * X + B

6 exercises/distance_formula.html
 @@ -64,7 +64,7 @@ = X_DIST

-
+
style({ color: "#679b00", stroke: "#679b00" @@ -87,7 +87,7 @@ = Y_DIST

-
+
style({ color: "#a66000", stroke: "#a66000" @@ -98,7 +98,7 @@
-
+

The distance is the length of the hypotenuse of this right triangle.

2 exercises/distributive_property.html
 @@ -54,7 +54,7 @@ (function() { return jQuery.map( NUMS, function( el, i ) { - if ( i == SWAP_INDEX ) { + if ( i === SWAP_INDEX ) { return SYMBOL; } else { return el;
16 exercises/distributive_property_with_variables.html
 @@ -97,13 +97,13 @@

plus( B+X, A+(B*C)+D )

-
• X - A+(-1*C)+D
• -
• plus( B+X ) + A+C+D
• -
• X + A+(-1*C)+D
• -
• X - A+C+D
• -
• X + A+C+D
• -
• plus( A, B+X, C+D )
• -
• plus( A, B+X, (-1*C)+D )
• +
• X - A+(-1*C)+D
• +
• plus( B+X ) + A+C+D
• +
• X + A+(-1*C)+D
• +
• X - A+C+D
• +
• X + A+C+D
• +
• plus( A, B+X, C+D )
• +
• plus( A, B+X, (-1*C)+D )
@@ -171,7 +171,7 @@

plus( A+X, A*B ) + plus( color( C, true )+color( PLUSPARENS( D, X ), false ) )

-

A negative sign before an expression is the same as -1 times that expression.

+

A negative sign before an expression is the same as -1 times that expression.

plus( A+X, A*B ) + \color{ blue }{ -1 }*plus( color( PLUSPARENS( D, X ), false ) )

plus( A+X, A*B ) + color( plus( C*D, C+X ) )

4 exercises/domain_and_range_0.5.html
 @@ -12,13 +12,13 @@ [ randRange( -9, -1 ), randRange( 1, 9 ) ] (function() { - var functionPath = new Array(); + var functionPath = []; var prev; var push = function( val ) { prev = val; functionPath.push( prev ); - } + }; push([ DOMAIN[0], randRange( -5, 5 ) ]);
4 exercises/domain_of_a_function.html
 @@ -95,7 +95,7 @@

f(x) = \sqrt{ x - A }

-

CHOICES["sqrt"]

+

CHOICES.sqrt

• c
@@ -104,7 +104,7 @@

f(x) is undefined when the radicand (the expression under the radical) is less than zero.

So the radicand, x - A, must be greater than or equal to zero.

So x - A \geq 0; this means x \geq A.

-

Expressing this mathematically, the domain is CHOICES["sqrt"].

+

Expressing this mathematically, the domain is CHOICES.sqrt.

6 exercises/equation_of_a_hyperbola.html
 @@ -22,8 +22,8 @@ rand(2) - WHICH_NEG === 1 ? "+" : "+" - WHICH_NEG === 1 ? "" : "-" + WHICH_NEG === 1 ? "+" : "+" + WHICH_NEG === 1 ? "" : "-" H === 0 ? "x^2" : expr(["^", ["+", "x", -H], 2]) K === 0 ? "y^2" : expr(["^", ["+", "y", -K], 2]) @@ -34,7 +34,7 @@
-

The equation of hyperbola H is WHICH_NEG == 1 ? expr(["-", Y2T, X2T]) : expr(["-", X2T, Y2T]) = 1.

+

The equation of hyperbola H is WHICH_NEG === 1 ? expr(["-", Y2T, X2T]) : expr(["-", X2T, Y2T]) = 1.

What are the asymptotes?

12 exercises/equation_of_a_line.html
 @@ -99,8 +99,8 @@

m = \dfrac{Y2 - negParens(Y1)}{X2 - negParens(X1)} = fractionReduce( Y2 - Y1, X2 - X1 )

- Writing the equation of the line, we have y = ( M == -1 ? "-" : ( M == 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 ))) x + b - (the value of m is equal to M). + Writing the equation of the line, we have y = ( M === -1 ? "-" : ( M === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 ))) x + b + (the value of m is equal to M).

To find b, we can substitute in either of the two points into the above equation. Let's go through both cases:

@@ -114,7 +114,7 @@

Y2 = (fractionReduce( Y2 - Y1, X2 - X1 ))(X2) + b

b = Y2 - fractionReduce( X2 * ( Y2 - Y1 ), X2 - X1 ) = fractionReduce( Y2 * (X2 - X1) - X2 * ( Y2 - Y1 ), X2 - X1 )

-

In both cases, the equation of the line is y = ( M == -1 ? "-" : ( M == 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 ))) x + fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 ) (the value of m is equal to M).

+

In both cases, the equation of the line is y = ( M === -1 ? "-" : ( M === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 ))) x + fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 ) (the value of m is equal to M).

@@ -172,8 +172,8 @@

m = \dfrac{Y2 - negParens(Y1)}{X2 - negParens(X1)} = fractionReduce( Y2 - Y1, X2 - X1 )

- Writing the equation of the line, we have y = ( M == -1 ? "-" : ( M == 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 ))) x + b - (the value of m is equal to M). + Writing the equation of the line, we have y = ( M === -1 ? "-" : ( M === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 ))) x + b + (the value of m is equal to M).

To find b, we can substitute in either of the two points into the above equation. Let's go through both cases:

@@ -187,7 +187,7 @@

Y2 = (fractionReduce( Y2 - Y1, X2 - X1 ))(X2) + b

b = Y2 - fractionReduce( X2 * ( Y2 - Y1 ), X2 - X1 ) = fractionReduce( Y2 * (X2 - X1) - X2 * ( Y2 - Y1 ), X2 - X1 )

-

In both cases, the equation of the line is y = ( M == -1 ? "-" : ( M == 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 ))) x + fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 ) (the value of m is equal to M).

+

In both cases, the equation of the line is y = ( M === -1 ? "-" : ( M === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 ))) x + fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 ) (the value of m is equal to M).

4 exercises/equation_of_a_parabola.html
 @@ -12,11 +12,11 @@
-
+
randRange( -5, 5 ) randRange( -5, 5 ) randRange( -5, 5 ) - // y = A*(x-H)^2 + K = A(x^2-2Hx+H^2) + K = Ax^2 -2AHx + A*H^2+K + -2 * A * H A * H * H + K
4 exercises/equation_of_an_ellipse.html
 @@ -14,7 +14,7 @@
randRange( 2, 9 ) - randRange( 2, 9 ) + randRange( 2, 9 ) randRange( -9, 9 ) randRange( -9, 9 ) @@ -29,7 +29,7 @@
-

The equation of an ellipse E is rand(2) == 1 ? expr(["+", Y2T, X2T]) : expr(["+", X2T, Y2T]) = 1.

+

The equation of an ellipse E is rand(2) === 1 ? expr(["+", Y2T, X2T]) : expr(["+", X2T, Y2T]) = 1.

What are its center (h, k) and its major and minor radius?

22 exercises/estimation_with_decimals.html
 @@ -1,5 +1,5 @@ - + Estimation with decimals @@ -20,17 +20,19 @@
$.map( randRange( 1000, 16000, randRange( 3, 7 ) ), function( n ){ return ( n / 1000 ).toFixed( randRange( 1, 2 ) ); } ) - eval($.map( VALUES, round ).join("+") ) + sum( $.map( VALUES, round ) ) randFromArray( [ [ "jogging", "ran", "mile" ], [ "riding a bicycle ", "traveled", "mile" ], [ "collecting mushrooms", "collected", "pound" ], [ "painting a roof", "painted", "square foot" ], [ "harvesting grain", "harvested", "tonne" ] ] ) 0 -$.map( VALUES, function( i ){ - if ( round( i ) < i ) { - return "smaller than"; - } - else{ - return "bigger or equal to"; - } - } ) + + \$.map( VALUES, function( i ){ + if ( round( i ) < i ) { + return "smaller than"; + } + else{ + return "bigger or equal to"; + } + } ) + (function() { var sum = 0;
2 exercises/exponents_3.html
 @@ -17,7 +17,7 @@ VALS.base_1 VALS.base_2 - random() < .75 + random() < 0.75 VALS.root
4 exercises/exponents_4.html
 @@ -15,10 +15,10 @@
twoBasesOneRoot() - random() < .75 + random() < 0.75 VALS.root - isOdd( EXP_D ) && ( random() < .75 ) + isOdd( EXP_D ) && ( random() < 0.75 ) VALS.base_1 VALS.base_2
4 exercises/fractions_on_the_number_line.html
 @@ -61,7 +61,7 @@
follow() -
+
randRange( 0 , 15 ) randRange( 1 , 15 )
@@ -99,7 +99,7 @@

NICE_NUMBER is equal to REDUCED_NUMBER

Because REDUCED_NUMBER is positivenegative we go rightleft from 0

-

REDUCED_NUMBER is fraction( parseInt( SIGN + ( NOMINATOR - ( DENOMINATOR * floor( abs( NUMBER) ) ) ) ) , DENOMINATOR, true, true ) away from floor( abs( NUMBER ) ) * NUMBER/abs( NUMBER )

+

REDUCED_NUMBER is fraction( parseInt( SIGN + ( NOMINATOR - ( DENOMINATOR * floor( abs( NUMBER) ) ) ), 10 ) , DENOMINATOR, true, true ) away from floor( abs( NUMBER ) ) * NUMBER/abs( NUMBER )

Therefore REDUCED_NUMBER is between floor( NUMBER ) and ceil( NUMBER )

If we zoom in to that portion of the number line:
2 exercises/functions_1.html
 @@ -10,7 +10,7 @@
(function() { - var functionPath = new Array(); + var functionPath = []; functionPath.push([ -11, randRange( -5, 5 ) ]); for( var i = -10; i < 11; i++ ) {
4 exercises/functions_2.html
 @@ -22,7 +22,7 @@ (function() { var currentY = randRange( -5, 5 ); - var functionPath = new Array(); + var functionPath = []; functionPath.push([-11, currentY]); for( var i = -10; i < 11; i++ ) { @@ -51,7 +51,7 @@ (function() { var gY = randRange( 3, -7 ); - var gPath = new Array(); + var gPath = []; gPath.push([-11, gY]); for( var i = -10; i < 11; i++ ) {
4 exercises/graphing_inequalities.html
 @@ -21,8 +21,8 @@ randFromArray([ true, false ]) randFromArray([ "<", ">", "≤", "≥" ]) B < 0 ? { "<": ">", ">": "<", "≤": "≥", "≥": "≤" }[ COMP ] : COMP - COMP == "<" || COMP == "≤" - COMP == "≥" || COMP == "≤" + COMP === "<" || COMP === "≤" + COMP === "≥" || COMP === "≤"
20 exercises/graphing_inequalities_2.html
 @@ -21,22 +21,22 @@ randFromArray([ true, false ]) randFromArray([ "<", ">", "≤", "≥" ]) B < 0 ? { "<": ">", ">": "<", "≤": "≥", "≥": "≤" }[ COMP ] : COMP - COMP == "<" || COMP == "≤" - COMP == "≥" || COMP == "≤" + COMP === "<" || COMP === "≤" + COMP === "≥" || COMP === "≤"
[ randRangeExclude( -9, 9, [ -3, -2, -1, 0 ] ), randRangeExclude( -9, 9, [ -1, -2 ] ) ] [ randRangeExclude( -9, 9, [ -3, -2, -1, 0 ] ), randRangeExclude( -9, 9, [ -1, -2 ] ) ] - (((COMP == "<") && ( POINT_1[1] < SLOPE * POINT_1[0] + YINT )) - || ((COMP == "≤") && ( POINT_1[1] <= SLOPE * POINT_1[0] + YINT )) - || ((COMP == ">") && ( POINT_1[1] > SLOPE * POINT_1[0] + YINT )) - || ((COMP == "≥") && ( POINT_1[1] >= SLOPE * POINT_1[0] + YINT ))) + (((COMP === "<") && ( POINT_1[1] < SLOPE * POINT_1[0] + YINT )) + || ((COMP === "≤") && ( POINT_1[1] <= SLOPE * POINT_1[0] + YINT )) + || ((COMP === ">") && ( POINT_1[1] > SLOPE * POINT_1[0] + YINT )) + || ((COMP === "≥") && ( POINT_1[1] >= SLOPE * POINT_1[0] + YINT ))) - (((COMP == "<") && ( POINT_2[1] < SLOPE * POINT_2[0] + YINT )) - || ((COMP == "≤") && ( POINT_2[1] <= SLOPE * POINT_2[0] + YINT )) - || ((COMP == ">") && ( POINT_2[1] > SLOPE * POINT_2[0] + YINT )) - || ((COMP == "≥") && ( POINT_2[1] >= SLOPE * POINT_2[0] + YINT ))) + (((COMP === "<") && ( POINT_2[1] < SLOPE * POINT_2[0] + YINT )) + || ((COMP === "≤") && ( POINT_2[1] <= SLOPE * POINT_2[0] + YINT )) + || ((COMP === ">") && ( POINT_2[1] > SLOPE * POINT_2[0] + YINT )) + || ((COMP === "≥") && ( POINT_2[1] >= SLOPE * POINT_2[0] + YINT )))
8 exercises/graphing_systems_of_inequalities.html
 @@ -38,10 +38,10 @@ randFromArray([ "<", ">", "≤", "≥" ]) B_1 < 0 ? { "<": ">", ">": "<", "≤": "≥", "≥": "≤" }[ COMP_1 ] : COMP_1 B_2 < 0 ? { "<": ">", ">": "<", "≤": "≥", "≥": "≤" }[ COMP_2 ] : COMP_2 - COMP_1 == "<" || COMP_1 == "≤" - COMP_2 == "<" || COMP_2 == "≤" - COMP_1 == "≥" || COMP_1 == "≤" - COMP_2 == "≥" || COMP_2 == "≤" + COMP_1 === "<" || COMP_1 === "≤" + COMP_2 === "<" || COMP_2 === "≤" + COMP_1 === "≥" || COMP_1 === "≤" + COMP_2 === "≥" || COMP_2 === "≤"

40 exercises/graphing_systems_of_inequalities_2.html
 @@ -38,34 +38,34 @@ randFromArray([ "<", ">", "≤", "≥" ]) B_1 < 0 ? { "<": ">", ">": "<", "≤": "≥", "≥": "≤" }[ COMP_1 ] : COMP_1 B_2 < 0 ? { "<": ">", ">": "<", "≤": "≥", "≥": "≤" }[ COMP_2 ] : COMP_2 - COMP_1 == "<" || COMP_1 == "≤" - COMP_2 == "<" || COMP_2 == "≤" - COMP_1 == "≥" || COMP_1 == "≤" - COMP_2 == "≥" || COMP_2 == "≤" + COMP_1 === "<" || COMP_1 === "≤" + COMP_2 === "<" || COMP_2 === "≤" + COMP_1 === "≥" || COMP_1 === "≤" + COMP_2 === "≥" || COMP_2 === "≤"
[ randRangeExclude( -9, 9, [ -3, -2, -1, 0 ] ), randRangeExclude( -9, 9, [ -1, -2 ] ) ] [ randRangeExclude( -9, 9, [ -3, -2, -1, 0 ] ), randRangeExclude( -9, 9, [ -1, -2 ] ) ] - (((COMP_1 == "<") && ( POINT_1[1] < SLOPE_1 * POINT_1[0] + YINT_1 )) - || ((COMP_1 == "≤") && ( POINT_1[1] <= SLOPE_1 * POINT_1[0] + YINT_1 )) - || ((COMP_1 == ">") && ( POINT_1[1] > SLOPE_1 * POINT_1[0] + YINT_1 )) - || ((COMP_1 == "≥") && ( POINT_1[1] >= SLOPE_1 * POINT_1[0] + YINT_1 ))) + (((COMP_1 === "<") && ( POINT_1[1] < SLOPE_1 * POINT_1[0] + YINT_1 )) + || ((COMP_1 === "≤") && ( POINT_1[1] <= SLOPE_1 * POINT_1[0] + YINT_1 )) + || ((COMP_1 === ">") && ( POINT_1[1] > SLOPE_1 * POINT_1[0] + YINT_1 )) + || ((COMP_1 === "≥") && ( POINT_1[1] >= SLOPE_1 * POINT_1[0] + YINT_1 ))) && - (((COMP_2 == "<") && ( POINT_1[1] < SLOPE_2 * POINT_1[0] + YINT_2 )) - || ((COMP_2 == "≤") && ( POINT_1[1] <= SLOPE_2 * POINT_1[0] + YINT_2 )) - || ((COMP_2 == ">") && ( POINT_1[1] > SLOPE_2 * POINT_1[0] + YINT_2 )) - || ((COMP_2 == "≥") && ( POINT_1[1] >= SLOPE_2 * POINT_1[0] + YINT_2 ))) + (((COMP_2 === "<") && ( POINT_1[1] < SLOPE_2 * POINT_1[0] + YINT_2 )) + || ((COMP_2 === "≤") && ( POINT_1[1] <= SLOPE_2 * POINT_1[0] + YINT_2 )) + || ((COMP_2 === ">") && ( POINT_1[1] > SLOPE_2 * POINT_1[0] + YINT_2 )) + || ((COMP_2 === "≥") && ( POINT_1[1] >= SLOPE_2 * POINT_1[0] + YINT_2 ))) - (((COMP_1 == "<") && ( POINT_2[1] < SLOPE_1 * POINT_2[0] + YINT_1 )) - || ((COMP_1 == "≤") && ( POINT_2[1] <= SLOPE_1 * POINT_2[0] + YINT_1 )) - || ((COMP_1 == ">") && ( POINT_2[1] > SLOPE_1 * POINT_2[0] + YINT_1 )) - || ((COMP_1 == "≥") && ( POINT_2[1] >= SLOPE_1 * POINT_2[0] + YINT_1 ))) + (((COMP_1 === "<") && ( POINT_2[1] < SLOPE_1 * POINT_2[0] + YINT_1 )) + || ((COMP_1 === "≤") && ( POINT_2[1] <= SLOPE_1 * POINT_2[0] + YINT_1 )) + || ((COMP_1 === ">") && ( POINT_2[1] > SLOPE_1 * POINT_2[0] + YINT_1 )) + || ((COMP_1 === "≥") && ( POINT_2[1] >= SLOPE_1 * POINT_2[0] + YINT_1 ))) && - (((COMP_2 == "<") && ( POINT_2[1] < SLOPE_2 * POINT_2[0] + YINT_2 )) - || ((COMP_2 == "≤") && ( POINT_2[1] <= SLOPE_2 * POINT_2[0] + YINT_2 )) - || ((COMP_2 == ">") && ( POINT_2[1] > SLOPE_2 * POINT_2[0] + YINT_2 )) - || ((COMP_2 == "≥") && ( POINT_2[1] >= SLOPE_2 * POINT_2[0] + YINT_2 ))) + (((COMP_2 === "<") && ( POINT_2[1] < SLOPE_2 * POINT_2[0] + YINT_2 )) + || ((COMP_2 === "≤") && ( POINT_2[1] <= SLOPE_2 * POINT_2[0] + YINT_2 )) + || ((COMP_2 === ">") && ( POINT_2[1] > SLOPE_2 * POINT_2[0] + YINT_2 )) + || ((COMP_2 === "≥") && ( POINT_2[1] >= SLOPE_2 * POINT_2[0] + YINT_2 )))
4 exercises/graphs_of_sine_and_cosine.html
 @@ -24,7 +24,7 @@ randFromArray( [ "cos", "sin" ] ) { "cos": "cosine", "sin": "sine"}[FN] randRange( 1, 5 ) / 2 - random() < .5 ? randRange( 1, 4 ) : 1 / randRange( 1, 4 ) + random() < 0.5 ? randRange( 1, 4 ) : 1 / randRange( 1, 4 ) 2 * PI * HSCALE 3.5 @@ -37,7 +37,7 @@ HSCALE * PI / 4 - .5 + 0.5 2
6 exercises/inequalities_on_a_number_line.html
 @@ -100,15 +100,15 @@
-
+
rand( 6 ) > 0 ? randRange( 1, 9 ) : 0 rand( 3 ) > 0 ? (randRange( 1, 9 ) / 10) : 0
(INT === 0 ? "" : randFromArray(["", "-"])) randFromArray([ "<", ">", "≤", "≥" ]) - REL == "≤" || REL == "≥" - REL == "<" || REL == "≤" + REL === "≤" || REL === "≥" + REL === "<" || REL === "≤" randVar() shuffle([ "direction", "inclusion", "positivity", "quantity", "none" ]) jQuery.inArray( "none", LINE_ERROR_TYPES )
100 exercises/kinematic_equations.html
 @@ -9,7 +9,7 @@
-
+
randFromArray(['a', 'd', 't', 'v_i', 'v_f']) randFromArray(['a', 'd', 't', 'v_i', 'v_f']) randRangeNonZero(-200, 200) / 10 @@ -20,42 +20,42 @@ /* 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 < 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)) || /* division by 0 */ - (OMITTED=='d' && UNKNOWN == 'a' && TIME == 0) || - (OMITTED=='d' && UNKNOWN == 't' && ACCEL == 0) || - (OMITTED=='v_i' && UNKNOWN == 'v_f' && TIME == 0) || - (OMITTED=='v_i' && UNKNOWN == 'a' && TIME == 0) || - (OMITTED=='v_i' && UNKNOWN == 't' && ACCEL == 0) || - (OMITTED=='v_f' && UNKNOWN == 'v_i' && TIME == 0) || - (OMITTED=='v_f' && UNKNOWN == 'a' && TIME == 0) || - (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=='t' && UNKNOWN == 'd' && ACCEL == 0) || - (OMITTED=='t' && UNKNOWN == 'a' && DISP == 0) + (OMITTED === 'd' && UNKNOWN === 'a' && TIME === 0) || + (OMITTED === 'd' && UNKNOWN === 't' && ACCEL === 0) || + (OMITTED === 'v_i' && UNKNOWN === 'v_f' && TIME === 0) || + (OMITTED === 'v_i' && UNKNOWN === 'a' && TIME === 0) || + (OMITTED === 'v_i' && UNKNOWN === 't' && ACCEL === 0) || + (OMITTED === 'v_f' && UNKNOWN === 'v_i' && TIME === 0) || + (OMITTED === 'v_f' && UNKNOWN === 'a' && TIME === 0) || + (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 === 't' && UNKNOWN === 'd' && ACCEL === 0) || + (OMITTED === 't' && UNKNOWN === 'a' && DISP === 0) - (OMITTED == 't' && UNKNOWN == 'v_i') || - (OMITTED == 't' && UNKNOWN == 'v_f') + (OMITTED === 't' && UNKNOWN === 'v_i') || + (OMITTED === 't' && UNKNOWN === 'v_f') - (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 === '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))
-

d = DISP \text{m}

-

v_i = V_INIT \frac{\text{m}}{\text{s}}

-

v_f = V_FINAL \frac{\text{m}}{\text{s}}

-

a = ACCEL \frac{\text{m}}{\text{s}^2}

-

t = TIME \text{s}

+

d = DISP \text{m}

+

v_i = V_INIT \frac{\text{m}}{\text{s}}

+

v_f = V_FINAL \frac{\text{m}}{\text{s}}

+

a = ACCEL \frac{\text{m}}{\text{s}^2}

+

t = TIME \text{s}

OMITTED = {?}

UNKNOWN = {?}

@@ -68,40 +68,40 @@
- roundTo(1, DISP) - roundTo(1, V_INIT) - roundTo(1, V_FINAL) - roundTo(1, ACCEL) - roundTo(1, TIME) + roundTo(1, DISP) + roundTo(1, V_INIT) + roundTo(1, V_FINAL) + roundTo(1, ACCEL) + roundTo(1, TIME) - m - m/s - m/s - m/s² - s + m + m/s + m/s + m/s² + s
- roundTo(1, -V_INIT) - roundTo(1, -V_FINAL) + roundTo(1, -V_INIT) + roundTo(1, -V_FINAL) m/s
- roundTo(1, ((-V_FINAL) + sqrt(V_FINAL * V_FINAL - 2 * ACCEL * DISP))/(-ACCEL)) - roundTo(1, ((-V_INIT) + sqrt(V_INIT * V_INIT + 2 * ACCEL * DISP))/ACCEL) + roundTo(1, ((-V_FINAL) + sqrt(V_FINAL * V_FINAL - 2 * ACCEL * DISP))/(-ACCEL)) + roundTo(1, ((-V_INIT) + sqrt(V_INIT * V_INIT + 2 * ACCEL * DISP))/ACCEL) s
- roundTo(1, ((-V_FINAL) - sqrt(V_FINAL * V_FINAL - 2 * ACCEL * DISP))/(-ACCEL)) - roundTo(1, ((-V_INIT) - sqrt(V_INIT * V_INIT + 2 * ACCEL * DISP))/ACCEL) + roundTo(1, ((-V_FINAL) - sqrt(V_FINAL * V_FINAL - 2 * ACCEL * DISP))/(-ACCEL)) + roundTo(1, ((-V_INIT) - sqrt(V_INIT * V_INIT + 2 * ACCEL * DISP))/ACCEL) s
@@ -131,7 +131,7 @@
-
+
0 randRange(5, 25) V_INIT @@ -292,29 +292,29 @@

\pm\sqrt{(V_FINAL \frac{\text{m}}{\text{s}})^2 - 2(ACCEL \frac{\text{m}}{\text{s}^2})(DISP \text{m})} = v_i

-

+

Without making any assumptions about t, either direction for v_i could be correct. Imagine throwing an object upward at velocity v compared to throwing it downward at the same speed (-v). In both cases it will reach the same final velocity v_f at the same point in space; it will just take different amounts of time to get there.

v_i = roundTo(1, V_INIT) \frac{\text{m}}{\text{s}} \text{ or } roundTo(1, -V_INIT) \frac{\text{m}}{\text{s}}

-

However, we also know a = 0 \frac{\text{m}}{\text{s}^2}

-

We know intuitively that with zero acceleration v_i must equal v_f, so v_i = roundTo(1, V_INIT) \frac{\text{m}}{\text{s}}

+

However, we also know a = 0 \frac{\text{m}}{\text{s}^2}

+

We know intuitively that with zero acceleration v_i must equal v_f, so v_i = roundTo(1, V_INIT) \frac{\text{m}}{\text{s}}

v_f = \pm\sqrt{(V_INIT \frac{\text{m}}{\text{s}})^2 + 2(ACCEL \frac{\text{m}}{\text{s}^2})(DISP \text{m})}

-

+

Without making any assumptions about t, either direction for v_f could be correct. Imagine an object traveling upward at velocity v_i. It will reach a particular velocity v on the way up, then reach the same speed in the opposite direction (-v) on the way down at the same point in space; it will just take a different amount of time to get there.

v_f = roundTo(1, V_FINAL) \frac{\text{m}}{\text{s}} \text{ or } roundTo(1, -V_FINAL) \frac{\text{m}}{\text{s}}

-

However, we also know a = 0 \frac{\text{m}}{\text{s}^2}

-

We know intuitively that with zero acceleration v_f must equal v_i, so v_f = roundTo(1, V_FINAL) \frac{\text{m}}{\text{s}}

+

However, we also know a = 0 \frac{\text{m}}{\text{s}^2}

+

We know intuitively that with zero acceleration v_f must equal v_i, so v_f = roundTo(1, V_FINAL) \frac{\text{m}}{\text{s}}

6 exercises/lhopitals_rule.html
 @@ -11,8 +11,8 @@
randFromArray([ 0, Infinity ]) - { 0: "0", Infinity: "\\infty" }[ APPROACHES ] - "\\frac" + { 0: "{0}{0}", Infinity: "{\\infty}{\\infty}" }[ APPROACHES ] + { 0: "0", "Infinity": "\\infty" }[ APPROACHES ] + "\\frac" + { 0: "{0}{0}", "Infinity": "{\\infty}{\\infty}" }[ APPROACHES ]
-
+

Repeat this process until evaluating the limit will not result in an indeterminate form:

2 exercises/multiplying_and_dividing_negative_numbers.html
 @@ -7,7 +7,7 @@
-
+
rand( 18 ) - 9 rand( 18 ) - 9 A * B
32 exercises/multiplying_fractions_1.html
 @@ -108,11 +108,11 @@ function createVertTable( numerator, denominator, id, className ) { var table = jQuery( "" ); - if ( id != null ) { + if ( id !== null ) { table.attr( "id", id ); } - if( className != null ) { + if( className !== null ) { table.addClass( className ); } else { table.addClass( "hint_diagram_table_small" ); @@ -145,18 +145,18 @@ function createHorizTable( numerator, denominator, id, className, boxClass ) { var table = jQuery( "" ); - if ( id != null ) { + if ( id !== null ) { table.attr( "id", id ); } - if ( className != null ) { + if ( className !== null ) { table.addClass( className ); } else { table.addClass( "hint_diagram_table_small" ); } var useBoxClass = "hint_box2_cell"; - if ( boxClass != null ) { + if ( boxClass !== null ) { useBoxClass = boxClass; } @@ -242,7 +242,7 @@ var tablesSrc = ""; for ( var i = 0; i < number; i++ ) { var idToUse = null; - if( idPrefix != null ) { + if( idPrefix !== null ) { idToUse = idPrefix + "-" + i; } @@ -261,7 +261,7 @@ var tablesSrc = ""; for ( var i = 0; i < number; i++ ) { var idToUse = null; - if( idPrefix != null ) { + if( idPrefix !== null ) { idToUse = idPrefix + "-" + i; } @@ -279,7 +279,7 @@ var tablesSrc = ""; for ( var i = 0; i < number; i++ ) { var idToUse = null; - if( idPrefix != null ) { + if( idPrefix !== null ) { idToUse = idPrefix + "-" + i; } @@ -358,14 +358,11 @@
- - (navigator.userAgent.indexOf('MSIE') !=-1)
-
+
randRange(1, 4) N1 + randRange(1, 4) @@ -415,17 +412,6 @@ TABLE_1_HINT TABLE_2_HINT
- - - - - - - - - - -
2 exercises/multiplying_polynomials.html
 @@ -27,7 +27,7 @@ coefs[ i ] = value; } - return new Polynomial( 0, MAX_DEGREE, coefs, X ) + return new Polynomial( 0, MAX_DEGREE, coefs, X ); }, 2 ) function() { var likeTerms = [];
2 exercises/negative_number_word_problems.html
 @@ -80,7 +80,7 @@
randRange( 5, 20 ) randRange( 5, 10 ) - Y - -X + Y + X

A spinner dolphin jumped from X meters below sea level and flipped through the air at Y meters above sea level. {The jump itself took about 1.randRange( 1, 9 ) seconds.|}

4 exercises/new_definitions_1.html
 @@ -35,8 +35,8 @@ expr(FUN(X, Y)) expr(FUN(X, Y), true) - !isNaN(expr(FUN(0, Number.NaN), true)) - !isNaN(expr(FUN(Number.NaN, 0), true)) + !isNaN(expr(FUN(0, NaN), true)) + !isNaN(expr(FUN(NaN, 0), true))
6 exercises/new_definitions_2.html
 @@ -29,11 +29,11 @@ function(C, D, x, y) { return ["-", ["*", D, ["^", x, 2]], ["^", y, 2]]; }, function(C, D, x, y) { return ["-", ["*", D, x], C]; }, function(C, D, x, y) { return ["+", ["*", C, y], D]; }, - function(C, D, x, y) { return ["+", ["*", x, y], ["*", D, x], ["-", y]]; }, + function(C, D, x, y) { return ["+", ["*", x, y], ["*", D, x], ["-", y]]; } ], 2) - !isNaN(expr(FUN1(A, B, 0, Number.NaN), true)) - !isNaN(expr(FUN1(A, B, Number.NaN, 0), true)) + !isNaN(expr(FUN1(A, B, 0, NaN), true)) + !isNaN(expr(FUN1(A, B, NaN, 0), true)) randRange(-6, 6) randRange(-6, 6)
14 exercises/ordering_numbers.html
 @@ -14,11 +14,11 @@ var used = {}; while ( array.length < 5 ) { - var type = types[ array.length ]; + var type = types[ array.length ], n, ns; switch ( type ) { case 1: // decimal - var n = randRange( 100, 999 ) / 1000; - var ns = n.toFixed( 3 ); + n = randRange( 100, 999 ) / 1000; + ns = n.toFixed( 3 ); if ( !used[ ns ] ) { array.push([ type, n, ns, "= " + ns ]); @@ -28,8 +28,8 @@ break; case 2: // percentage - var n = randRange( 100, 999 ) / 1000; - var ns = n.toFixed( 3 ); + n = randRange( 100, 999 ) / 1000; + ns = n.toFixed( 3 ); if ( !used[ ns ] ) { array.push([ type, n, (100 * n).toFixed( 1 ) + "\\%", "= " + ns ]); @@ -40,8 +40,8 @@ case 3: // fraction var d = 4 * randRange( 5, 15 ); - var n = randRange( 1, d - 1 ); - var ns = ( n / d ).toFixed( 3 );