Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

massive merge

  • Loading branch information...
commit 432ecb9fea799659d5e984c14dec75309a315dad 2 parents 39709fe + ef02c95
@nsfmc nsfmc authored
Showing with 8,397 additions and 655 deletions.
  1. +4 −0 README.md
  2. +36 −1 css/khan-exercise.css
  3. +23 −29 exercises/absolute_value.html
  4. +1 −1  exercises/adding_and_subtracting_fractions.html
  5. +2 −2 exercises/adding_decimals.html
  6. +54 −0 exercises/adding_fractions.html
  7. +1 −1  exercises/adding_fractions_with_common_denominators.html
  8. +1 −1  exercises/addition_1.html
  9. +1 −1  exercises/addition_2.html
  10. +1 −1  exercises/addition_3.html
  11. +1 −1  exercises/addition_4.html
  12. +26 −3 exercises/angle_types.html
  13. +304 −0 exercises/arithmetic_word_problems_1.html
  14. +18 −2 exercises/chain_rule_1.html
  15. +0 −46 exercises/changing_decimals_to_fractions_1.html
  16. +31 −0 exercises/changing_decimals_to_percents.html
  17. +45 −0 exercises/changing_fractions_to_decimals_1.html
  18. +13 −6 exercises/changing_fractions_to_percents.html
  19. +30 −0 exercises/changing_percents_to_decimals.html
  20. +44 −0 exercises/changing_percents_to_fractions.html
  21. +87 −0 exercises/comparing_absolute_values.html
  22. +8 −8 exercises/comparing_fractions_1.html
  23. +8 −6 exercises/comparing_fractions_2.html
  24. +1 −1  exercises/complementary_angles.html
  25. +15 −0 exercises/conic_sections.html
  26. +54 −0 exercises/converting_decimals_to_fractions_1.html
  27. +62 −0 exercises/converting_decimals_to_fractions_2.html
  28. +106 −0 exercises/converting_mixed_numbers_and_improper_fractions.html
  29. +78 −0 exercises/decimals_on_the_number_line.html
  30. +1 −1  exercises/dividing_decimals.html
  31. +2 −1  exercises/dividing_fractions.html
  32. +2 −2 exercises/divisibility.html
  33. +1 −1  exercises/division_0.5.html
  34. +1 −1  exercises/division_1.5.html
  35. +1 −1  exercises/division_1.html
  36. +1 −1  exercises/division_2.html
  37. +1 −1  exercises/division_3.html
  38. +1 −1  exercises/division_4.html
  39. +70 −0 exercises/equation_of_a_hyperbola.html
  40. +51 −0 exercises/equation_of_a_parabola.html
  41. +54 −0 exercises/equation_of_an_ellipse.html
  42. +94 −0 exercises/estimation_with_decimals.html
  43. +65 −0 exercises/evaluating_expressions_2.html
  44. +206 −0 exercises/even_and_odd_integers.html
  45. +4 −5 exercises/exponent_rules.html
  46. +1 −1  exercises/exponents_4.html
  47. +42 −0 exercises/expressing_ratios_as_fractions.html
  48. +86 −19 exercises/fraction_word_problems_1.html
  49. +111 −0 exercises/fractions_on_the_number_line.html
  50. +1 −1  exercises/graphing_points.html
  51. +2 −1  exercises/graphs_of_sine_and_cosine.html
  52. +216 −0 exercises/inequalities_on_a_number_line.html
  53. +7 −7 exercises/inverse_trig_functions.html
  54. +7 −2 exercises/khan-exercise.html
  55. +2 −2 exercises/khan-site.html
  56. +1 −1  exercises/line_relationships.html
  57. +6 −4 exercises/linear_equations_4.html
  58. +61 −0 exercises/lines_of_symmetry.html
  59. +10 −21 exercises/measuring_angles.html
  60. +7 −5 exercises/multiplication_0.5.html
  61. +1 −1  exercises/multiplication_1.5.html
  62. +5 −5 exercises/multiplication_1.html
  63. +1 −1  exercises/multiplication_2.html
  64. +1 −1  exercises/multiplication_3.html
  65. +1 −1  exercises/multiplication_4.html
  66. +1 −1  exercises/multiplying_decimals.html
  67. +1 −1  exercises/multiplying_fractions.html
  68. +526 −0 exercises/multiplying_fractions_1.html
  69. +58 −0 exercises/number_line.html
  70. +115 −0 exercises/one_step_inequalities.html
  71. +0 −3  exercises/order_of_operations.html
  72. +37 −29 exercises/ordering_fractions.html
  73. +108 −0 exercises/ordering_negative_numbers.html
  74. +7 −7 exercises/pythagorean_theorem_2.html
  75. +1 −1  exercises/quadratic_inequalities_1.html
  76. +99 −0 exercises/ratio_word_problems.html
  77. +45 −34 exercises/recognizing_conic_sections.html
  78. +12 −11 exercises/recognizing_fractions.html
  79. +101 −0 exercises/recognizing_percents.html
  80. +12 −5 exercises/recognizing_rays_lines_and_line_segments.html
  81. +12 −12 exercises/rounding_numbers.html
  82. +1 −8 exercises/scientific_notation.html
  83. +72 −0 exercises/signs_of_a_parabola.html
  84. +1 −1  exercises/simplifying_fractions.html
  85. +3 −3 exercises/solving_for_a_variable.html
  86. +143 −0 exercises/square_roots_cube_roots.html
  87. +2 −2 exercises/subtracting_decimals.html
  88. +40 −100 exercises/subtracting_fractions.html
  89. +1 −1  exercises/subtracting_fractions_with_common_denominators.html
  90. +1 −1  exercises/subtraction_1.html
  91. +1 −1  exercises/subtraction_2.html
  92. +1 −1  exercises/subtraction_3.html
  93. +1 −1  exercises/subtraction_4.html
  94. +2 −2 exercises/systems_of_equations.html
  95. +85 −0 exercises/telling_time.html
  96. +6 −12 exercises/trigonometry_1.html
  97. +15 −28 exercises/trigonometry_2.html
  98. +1 −1  exercises/writing_expressions_2.html
  99. +81 −0 exercises/writing_proportions.html
  100. BIN  images/protractor.png
  101. +3,616 −0 jquery.js
  102. +171 −63 khan-exercise.js
  103. +0 −1  test/qunit
  104. +49 −32 utils/answer-types.js
  105. +260 −0 utils/exercise_maker.html
  106. +13 −6 utils/expressions.js
  107. +32 −0 utils/graphie-helpers-arithmetic.js
  108. +272 −83 utils/graphie-helpers.js
  109. +15 −0 utils/graphie.js
  110. +81 −2 utils/math-format.js
  111. +33 −0 utils/math.js
  112. +1 −1  utils/tmpl.js
  113. +83 −3 utils/word-problems.js
View
4 README.md
@@ -22,3 +22,7 @@ The process for writing exercises is rather well documented. More information ab
* [How to Get Involved](https://github.com/Khan/khan-exercises/wiki/Getting-Involved)
* [How to Write Exercises](https://github.com/Khan/khan-exercises/wiki/Writing-Exercises:-Home)
* [How to Test Exercises](https://github.com/Khan/khan-exercises/wiki/Testing-Exercises)
+
+## More
+
+If you're passionate about creating these exercises and want to apply to be a full-time exercise developer at the Khan Academy, [please do so](http://hire.jobvite.com/CompanyJobs/Careers.aspx?c=qd69Vfw7&page=Job%20Description&j=ohjSVfw7).
View
37 css/khan-exercise.css
@@ -55,6 +55,8 @@ body.debug .graphie { outline: 1px dashed red; }
#answer_area input.button:disabled { opacity: 0.7; cursor: default; color: #333; }
+#hint-remainder { color: #777; }
+
#footer .simple-button { padding: 3px 10px; top: -1px }
#issue .error { font-style: italic; font-weight: bold; }
@@ -66,4 +68,37 @@ body.debug .graphie { outline: 1px dashed red; }
var, div.graphie { white-space: pre; }
-#issue-throbber { position: relative; top: 3px; }
+#issue-throbber { position: relative; top: 3px; }
+
+.exp input { vertical-align: super; font-size: 9px; height: 11px; }
+
+#warning-bar {
+ background: red;
+ width: 100%;
+ height: 35px;
+ text-align: center;
+ color: #eee;
+ font-size: 15px;
+ display: none;
+}
+
+#warning-bar span {
+ position: relative;
+ top: 5px;
+}
+
+#warning-bar-close {
+ top: 5px;
+ float: right;
+ right: 20px;
+ position: relative;
+}
+
+#warning-bar a {
+ color: #eee;
+}
+
+#warning-bar-content a {
+ color: #eee;
+ text-decoration: underline;
+}
View
52 exercises/absolute_value.html
@@ -23,36 +23,30 @@
</div>
<div class="hints">
- <p data-if="SIGN == &quot;&quot;">The number <code><var>INT + FRAC</var></code> is already non-negative, so it is its own absolute value.</p>
- <div data-else>
- <p>The number <code>-<var>INT + FRAC</var></code> is negative, so its absolute value is positive: <code><var>INT + FRAC</var></code>.</p>
- </div>
- <div>
- <div class="graphie">
- init({
- range: [ [-1, 11], [-1, 1] ]
- });
- var start = 0;
- var end = 10;
- var originX = 0;
- var x = abs( INT ) + FRAC;
- if ( SIGN === "-" ) {
- start = -10;
- end = 0;
- originX = 10;
- x = 10 - x;
- }
- numberLine( start, end );
- style({ stroke: "#6495ED", fill: "#6495ED" });
- graph.pt = circle( [ x, 0 ], 0.15 );
- style({ stroke: "#FFA500", fill: "#FFA500", strokeWidth: 3.5, arrows: "->" });
- path( [ [ originX, 0 ], [ x, 0 ] ] );
- circle( [ originX, 0 ], 0.10 );
- graph.pt.toFront();
- </div>
- <p>The distance from <code>0</code> to <code><var>SIGN + INT + FRAC</var></code> is <code><var>INT + FRAC</var></code>, which equals the absolute value.</p>
- <p data-if="SIGN !== &quot;&quot;">In other words, <code><var>INT + FRAC</var></code> is the non-negative version of <code><var>SIGN + INT + FRAC</var></code>.</p>
+ <div class="graphie">
+ init({
+ range: [ [-1, 11], [-1, 1] ]
+ });
+ var start = 0;
+ var end = 10;
+ var originX = 0;
+ var x = abs( INT ) + FRAC;
+ if ( SIGN === "-" ) {
+ start = -10;
+ end = 0;
+ originX = 10;
+ x = 10 - x;
+ }
+ numberLine( start, end );
+ style({ stroke: "#6495ED", fill: "#6495ED" });
+ graph.pt = circle( [ x, 0 ], 0.15 );
+ style({ stroke: "#FFA500", fill: "#FFA500", strokeWidth: 3.5, arrows: "->" });
+ path( [ [ originX, 0 ], [ x, 0 ] ] );
+ circle( [ originX, 0 ], 0.10 );
+ graph.pt.toFront();
</div>
+ <p>The distance from <code>0</code> to <code><var>SIGN + INT + FRAC</var></code> is <code><var>INT + FRAC</var></code>, which equals the absolute value.</p>
+ <p data-if="SIGN !== &quot;&quot;">In other words, <code><var>INT + FRAC</var></code> is the non-negative version of <code><var>SIGN + INT + FRAC</var></code>.</p>
</div>
</div>
</body>
View
2  exercises/adding_and_subtracting_fractions.html
@@ -22,7 +22,7 @@
<div class="question">
<p><code><var>fraction( N1, D1 )</var> + <var>fraction( N2, D2 )</var> = {?}</code></p>
</div>
- <div class="solution" data-type="improper"><var>N1 / D1 + N2 / D2</var></div>
+ <div class="solution" data-type="rational"><var>N1 / D1 + N2 / D2</var></div>
</div>
</div>
View
4 exercises/adding_decimals.html
@@ -51,7 +51,7 @@
<div class="hints">
<div class="graphie" id="numbers">
init({
- range: [ [ -1, X_SIDE ], [ -0.5, 3 ] ],
+ range: [ [ -2, 17 ], [ -0.5, 3 ] ],
scale: [30, 45]
});
style({
@@ -60,7 +60,7 @@
X_MAX = X_MAX + ( B_DECIMAL - A_DECIMAL ) * (A_DECIMAL &lt; B_DECIMAL ? 1 : -1);
path( [ [ -0.5, Y_SECOND - 0.5 ], [ X_MAX + 0.5, Y_SECOND - 0.5 ] ]);
- HIGHLIGHTS.push( label( [ X_SIDE, Y_SIDE ], "\\large{\\text{Make sure the decimals are lined up.}}", "right" ) );
+ HIGHLIGHTS.push( label( [ X_SIDE, Y_SIDE ], "\\text{Make sure the decimals are lined up.}", "right" ) );
drawDigits( A_DIGITS.slice( 0 ).reverse(), X_MAX - A_DIGITS.length + 1, Y_FIRST );
drawDigits( B_DIGITS.slice( 0 ).reverse(), X_MAX - B_DIGITS.length + 1, Y_SECOND );
for ( var i = 0; i &lt; 3; i++ ){
View
54 exercises/adding_fractions.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html data-require="math math-format">
+<head>
+ <meta charset="UTF-8" />
+ <title>Adding fractions</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+<body>
+ <div class="exercise">
+ <div class="vars" data-ensure="SIMP_D1 !== SIMP_D2">
+ <var id="N1">randRange( 1, 9 )</var>
+ <var id="D1">randRange( N1 + 1, 13 )</var>
+ <var id="GCD1">getGCD( N1, D1 )</var>
+ <var id="SIMP_N1">N1 / GCD1</var>
+ <var id="SIMP_D1">D1 / GCD1</var>
+
+ <var id="N2">randRange( 1, 9 )</var>
+ <var id="D2">randRange( N2 + 1, 13 )</var>
+ <var id="GCD2">getGCD( N2, D2 )</var>
+ <var id="SIMP_N2">N2 / GCD2</var>
+ <var id="SIMP_D2">D2 / GCD2</var>
+
+ <var id="LCM">getLCM( SIMP_D1, SIMP_D2 )</var>
+ </div>
+
+ <div class="problems">
+ <div>
+ <p class="question"><code><var>fraction( N1, D1 )</var> + <var>fraction( N2, D2 )</var> = {?}</code></p>
+ <p class="solution" data-type="rational"><var>N1 / D1 + N2 / D2</var></p>
+ </div>
+ </div>
+
+ <div class="hints">
+ <div data-if="GCD1 !== 1 || GCD2 !== 1">
+ <p>Simplify each fraction.</p>
+ <p><code><var>fraction( SIMP_N1, SIMP_D1 )</var> + <var>fraction( SIMP_N2, SIMP_D2 )</var></code></p>
+ </div>
+ <p>Find a common denominator by finding the least common multiple of <code><var>SIMP_D1</var></code> and <code><var>SIMP_D2</var></code>.</p>
+ <p><code>\text{LCM(}<var>SIMP_D1</var>\text{, }<var>SIMP_D2</var>\text{)} = <var>LCM</var></code></p>
+ <div>
+ <p>Change each fraction to an equivalent fraction with a denominator of <code><var>LCM</var></code>.</p>
+ <p><code><var>fraction( SIMP_N1, SIMP_D1 )</var> + <var>fraction( SIMP_N2, SIMP_D2 )</var></code></p>
+ <p><code>=<var>fraction( SIMP_N1, SIMP_D1 )</var> <span data-if="LCM !== SIMP_D1">\cdot <var>fraction( LCM / SIMP_D1, LCM / SIMP_D1 )</var></span> + <var>fraction( SIMP_N2, SIMP_D2 )</var> <span data-if="LCM !== SIMP_D2">\cdot <var>fraction( LCM / SIMP_D2, LCM / SIMP_D2 )</var></span></code></p>
+ </div>
+ <p><code>=<var>fraction( SIMP_N1 * LCM / SIMP_D1, LCM )</var> + <var>fraction( SIMP_N2 * LCM / SIMP_D2, LCM )</var></code></p>
+ <p><code>=<var>fraction( SIMP_N1 * LCM / SIMP_D1 + SIMP_N2 * LCM / SIMP_D2, LCM )</var></code></p>
+ <div data-if="getGCD( SIMP_N1 * LCM / SIMP_D1 + SIMP_N2 * LCM / SIMP_D2, LCM ) !== 1">
+ <p>Simplify.</p>
+ <p><code>=<var>fractionReduce( SIMP_N1 * LCM / SIMP_D1 + SIMP_N2 * LCM / SIMP_D2, LCM )</var></code></p>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
View
2  exercises/adding_fractions_with_common_denominators.html
@@ -18,7 +18,7 @@
<div class="question">
<p><code><var>fraction( N1, D )</var> + <var>fraction( N2, D )</var> = {?}</code></p>
</div>
- <div class="solution" data-type="improper"><var>( N1 + N2 ) / D</var></div>
+ <div class="solution" data-type="rational"><var>( N1 + N2 ) / D</var></div>
</div>
</div>
View
2  exercises/addition_1.html
@@ -17,7 +17,7 @@
<div class="question">
<div class="graphie">
init({
- range: [ [0, 0], [0, 1] ]
+ range: [ [0, 12], [-1, 1] ]
});
label( [0, 0],
View
2  exercises/addition_2.html
@@ -28,7 +28,7 @@
<div>
<div class="graphie" id="numbers">
init({
- range: [ [ -1, 5 ], [ -0.5, 3 ] ],
+ range: [ [ -1, 11 ], [ -0.5, 3.5 ] ],
scale: [30, 45]
});
drawDigits( A_DIGITS.slice( 0 ).reverse(), X_MAX - A_DIGITS.length + 1, Y_FIRST );
View
2  exercises/addition_3.html
@@ -28,7 +28,7 @@
<div>
<div class="graphie" id="numbers">
init({
- range: [ [ -1, 5 ], [ -0.5, 3 ] ],
+ range: [ [ -1, 11 ], [ -0.5, 3.5 ] ],
scale: [30, 45]
});
drawDigits( A_DIGITS.slice( 0 ).reverse(), X_MAX - A_DIGITS.length + 1, Y_FIRST );
View
2  exercises/addition_4.html
@@ -28,7 +28,7 @@
<div>
<div class="graphie" id="numbers">
init({
- range: [ [ -1, 5 ], [ -0.5, 3 ] ],
+ range: [ [ -1, 11 ], [ -0.5, 3.5 ] ],
scale: [30, 45]
});
drawDigits( A_DIGITS.slice( 0 ).reverse(), X_MAX - A_DIGITS.length + 1, Y_FIRST );
View
29 exercises/angle_types.html
@@ -1,9 +1,19 @@
<!DOCTYPE html>
-<html data-require="math graphie">
+<html data-require="math graphie graphie-helpers">
<head>
<meta charset="UTF-8" />
<title>Angle types</title>
<script src="../khan-exercise.js"></script>
+ <script>
+ function protractorHint( pro, rot, angle ) {
+ pro.translate( 0, 0, true );
+ pro.rotate( rot, true );
+ pro.translatable( false );
+ pro.rotatable( false );
+
+ pro.drawAngle( angle, 2, "green", "green" );
+ }
+ </script>
</head>
<body>
<div class="exercise">
@@ -17,20 +27,24 @@
<div class="question">
<p>Is the shown angle acute, right, or obtuse?</p>
- <div class="graphie">
+ <div class="graphie" id="angle">
var ANGLE_TWO = ANGLE_ONE + DIFF;
var ANGLE_ONE_R = ANGLE_ONE * PI / 180;
var ANGLE_TWO_R = ANGLE_TWO * PI / 180;
init({
- range: [ [-6, 6], [-6, 6] ],
+ range: [ [-11, 31], [-10, 10] ],
scale: 20
});
path([ [5 * cos( ANGLE_ONE_R ), 5 * sin( ANGLE_ONE_R )], [0, 0], [5 * cos( ANGLE_TWO_R ), 5 * sin( ANGLE_TWO_R )] ]);
arc( [0,0], 1, ANGLE_ONE, ANGLE_TWO );
+ graph.protractor = new Protractor( [22, 0], 8 );
+ jQuery( "#scratchpad-show" ).replaceWith( "Scratchpad not available" ).hide();
+ jQuery( "#scratchpad" ).hide();
+
</div>
</div>
@@ -42,6 +56,9 @@
</ul>
<div class="hints">
+ <div class="graphie" data-update="angle">
+ protractorHint( graph.protractor, 360 - ANGLE_ONE, DIFF );
+ </div>
<p>The shown angle measures less than <code>90^\circ</code>.</p>
<p>Therefore, it is an acute angle.</p>
</div>
@@ -55,6 +72,9 @@
<div class="solution">Right</div>
<div class="hints">
+ <div class="graphie" data-update="angle">
+ protractorHint( graph.protractor, 360 - ANGLE_ONE, DIFF );
+ </div>
<p>The shown angle measures <code>90^\circ</code>.</p>
<p>Therefore, it is a right angle.</p>
</div>
@@ -68,6 +88,9 @@
<div class="solution">Obtuse</div>
<div class="hints">
+ <div class="graphie" data-update="angle">
+ protractorHint( graph.protractor, 360 - ANGLE_ONE, DIFF );
+ </div>
<p>The shown angle measures more than <code>90^\circ</code>.</p>
<p>Therefore, it is an obtuse angle.</p>
</div>
View
304 exercises/arithmetic_word_problems_1.html
@@ -0,0 +1,304 @@
+<!DOCTYPE html>
+<html data-require="math word-problems">
+<head>
+ <meta charset="UTF-8" />
+ <title>Arithmetic word problems 1</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+<body>
+ <div class="exercise">
+ <div class="vars">
+ <var id="TOTAL">randRange( 10, 100 )</var>
+ <var id="NUM1">randRange( 1, TOTAL - 1 )</var>
+ <var id="NUM2">TOTAL - NUM1</var>
+ </div>
+
+ <div class="problems">
+
+ <div id="take-away-result">
+ <p class="problem">
+ There <var>plural('was', TOTAL)</var> <var>plural(TOTAL, 'person')</var> riding on a train.
+ At the previous stop, <var>plural(NUM2, 'person')</var> got off.
+ </p>
+ <p class="question">
+ How many people are riding the train now?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM1</var>
+ </p>
+ <div class="hints">
+ <p>
+ The number riding the train now is the difference between the number who were riding and the number who got off at the previous stop.
+ </p>
+ <p>
+ The difference is <code><var>TOTAL</var> - <var>NUM2</var></code> <var>plural('person')</var> on the train.
+ </p>
+ <p>
+ <code><var>TOTAL</var> - <var>NUM2</var> = <var>NUM1</var></code> <var>plural('person', NUM1)</var> <var>plural('is', NUM1)</var> on the train.
+ </p>
+ </div>
+ </div>
+
+ <div id="take-away-start">
+ <p class="problem">
+ There <var>plural('is', NUM1)</var> <var>plural(NUM1, 'person')</var> riding on a train.
+ At the previous stop, <var>plural(NUM2, 'person')</var> got off.
+ </p>
+ <p class="question">
+ How many people were riding the train before the stop?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>TOTAL</var>
+ </p>
+ <div class="hints">
+ <p>
+ The number riding the train before the stop is the sum of the number who are riding now and the number who got off at the previous stop.
+ </p>
+ <p>
+ The sum is <code><var>NUM1</var> + <var>NUM2</var></code> <var>plural('person')</var> on the train.
+ </p>
+ <p>
+ <code><var>NUM1</var> + <var>NUM2</var> = <var>TOTAL</var></code> <var>plural('person')</var> <var>plural('is', TOTAL)</var> on the train.
+ </p>
+ </div>
+ </div>
+
+ <div id="take-away-change">
+ <p class="problem">
+ There <var>plural('was', TOTAL)</var> <var>plural(TOTAL, 'person')</var> riding on a train before it stopped and some number of people got off.
+ Now there are <var>plural(NUM2, 'person')</var> riding on the train.
+ </p>
+ <p class="question">
+ How many people got off the train at the stop?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM1</var>
+ </p>
+ <div class="hints">
+ <p>
+ The number of people who got off is the difference between the number who were riding before and the number who are riding now.
+ </p>
+ <p>
+ The difference is <code><var>TOTAL</var> - <var>NUM2</var></code> <var>plural('person')</var>.
+ </p>
+ <p>
+ <code><var>TOTAL</var> - <var>NUM2</var> = <var>NUM1</var></code> <var>plural('person', NUM1)</var> <var>plural('is', NUM1)</var>.
+ </p>
+ </div>
+ </div>
+
+ <div id="put-together">
+ <p class="problem">
+ There <var>plural('is', NUM1)</var> <var>plural(NUM1, 'tree')</var> on the right bank of a river and <var>plural(NUM2, 'tree')</var> on the left bank.
+ </p>
+ <p class="question">
+ How many trees are on the banks of the river?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>TOTAL</var>
+ </p>
+ <div class="hints">
+ <p>
+ The total number of trees on the two banks of the river is the sum of the number of trees on the left bank and the number of trees on the right bank.
+ </p>
+ <p>
+ The sum is <code><var>NUM1</var> + <var>NUM2</var></code> <var>plural('tree')</var>.
+ </p>
+ <p>
+ <code><var>NUM1</var> + <var>NUM2</var> = <var>TOTAL</var></code> <var>plural('tree')</var>.
+ </p>
+ </div>
+ </div>
+
+ <div id="take-apart">
+ <p class="problem">
+ There <var>plural('is', TOTAL)</var> <var>plural(TOTAL, 'tree')</var> on the banks of the river. The <var>side(1)</var> bank has <var>NUM2</var> of them.
+ </p>
+ <p class="question">
+ How many trees are on the <var>side(2)</var> bank of the river?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM1</var>
+ </p>
+ <div class="hints">
+ <p>
+ The number of trees on the <var>side(2)</var> bank of the river is the difference between the number of trees on both banks of the river and the number of trees on the <var>side(1)</var> bank.
+ </p>
+ <p>
+ The difference is <code><var>TOTAL</var> - <var>NUM2</var></code> <var>plural('tree')</var>.
+ </p>
+ <p>
+ <code><var>TOTAL</var> - <var>NUM2</var> = <var>NUM1</var></code> <var>plural('tree', NUM1)</var>.
+ </p>
+ </div>
+ </div>
+
+ <div id="add-start">
+ <p class="problem">
+ Some cars were parked in the <var>store(1)</var> store parking lot.
+ <var>NUM2</var> more <var>plural('car')</var> <var>plural('parks', 'park', NUM2)</var> at the <var>store(1)</var> store,
+ and now there <var>plural('is', TOTAL)</var> <var>plural(TOTAL, 'car')</var> in the parking lot.
+ </p>
+ <p class="question">
+ How many cars were parked at the <var>store(1)</var> store at the beginning?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM1</var>
+ </p>
+ <div class="hints">
+ <p>
+ The number of cars parked at the store at the beginning is the difference of the number parked now and the number that came and parked earlier.
+ </p>
+ <p>
+ The difference is <code><var>TOTAL</var> - <var>NUM2</var></code> <var>plural('car')</var>.
+ </p>
+ <p>
+ <code><var>TOTAL</var> - <var>NUM2</var> = <var>NUM1</var></code> <var>plural('car', NUM1)</var>.
+ </p>
+ </div>
+ </div>
+
+ <div id="add-change">
+ <p class="problem">
+ There <var>plural('was', NUM2)</var> <var>plural(NUM2, 'car')</var> parked in the <var>store(1)</var> store parking lot.
+ Some more cars park at the <var>store(1)</var> store, and now there <var>plural('is', TOTAL)</var> <var>plural(TOTAL, 'car')</var> in the parking lot.
+ </p>
+ <p class="question">
+ How many more cars parked at the <var>store(1)</var> store?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM1</var>
+ </p>
+ <div class="hints">
+ <p>
+ The number of cars that came and parked at the store is the difference between the number that were parked earlier and the number that are parked now.
+ </p>
+ <p>
+ The difference is <code><var>TOTAL</var> - <var>NUM2</var></code> <var>plural('car')</var>.
+ </p>
+ <p>
+ <code><var>TOTAL</var> - <var>NUM2</var> = <var>NUM1</var></code> <var>plural('car', NUM1)</var>.
+ </p>
+ </div>
+ </div>
+
+ <div id="add-result">
+ <p class="problem">
+ <var>plural(NUM1, 'car')</var> <var>plural('was', NUM1)</var> in the <var>store(1)</var> store parking lot.
+ <var>NUM2</var> more <var>plural('car', NUM2)</var> <var>plural('parks', 'park', NUM2)</var> at the <var>store(1)</var> store.
+ </p>
+ <p class="question">
+ How many cars are in the parking lot now?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>TOTAL</var>
+ </p>
+ <div class="hints">
+ <p>
+ The number of cars that are parked now is the sum of the number that were parked earlier and the number that came to park.
+ </p>
+ <p>
+ The sum is <code><var>NUM1</var> + <var>NUM2</var></code> <var>plural('car')</var>.
+ </p>
+ <p>
+ <code><var>NUM1</var> + <var>NUM2</var> = <var>TOTAL</var></code> <var>plural('car')</var>.
+ </p>
+ </div>
+ </div>
+
+ <div id="compare-diff-more">
+ <p class="problem">
+ <var>person(1)</var> did <var>plural(TOTAL, exercise(1))</var> <var>timeofday(1)</var>.
+ <var>person(2)</var> did <var>plural(NUM2, exercise(1))</var> <var>timeofday(2)</var>.
+ </p>
+ <p class="question">
+ How many more <var>plural(exercise(1))</var> did <var>person(1)</var> do than <var>person(2)</var>?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM1</var>
+ </p>
+ <div class="hints">
+ <p>
+ Find the difference between <var>person(1)</var>'s <var>plural(exercise(1))</var> and <var>person(2)</var>'s <var>plural(exercise(1))</var>.
+ </p>
+ <p>
+ The difference is <code><var>TOTAL</var> - <var>NUM2</var></code>.
+ </p>
+ <p>
+ <code><var>TOTAL</var> - <var>NUM2</var> = <var>NUM1</var></code>.
+ </p>
+ </div>
+ </div>
+
+ <div id="compare-diff-less" data-type="compare-diff-more">
+ <p class="question">
+ How many fewer <var>plural(exercise(1))</var> did <var>person(2)</var> do than <var>person(1)</var>?
+ </p>
+ </div>
+
+ <div id="compare-bigger-more">
+ <p class="problem">
+ <var>person(1)</var> did <var>NUM1</var> more <var>plural(exercise(1), NUM1)</var> than <var>person(2)</var> <var>timeofday(1)</var>.
+ <var>person(2)</var> did <var>plural(NUM2, exercise(1))</var>.
+ </p>
+ <p class="question">
+ How many <var>plural(exercise(1))</var> did <var>person(1)</var> do?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>TOTAL</var>
+ </p>
+ <div class="hints">
+ <p>
+ <var>person(2)</var> did <var>plural(NUM2, exercise(1))</var>, and <var>person(1)</var> did <var>NUM1</var> more than that, so find the sum.
+ </p>
+ <p>
+ The sum is <code><var>NUM2</var> + <var>NUM1</var></code> <var>plural(exercise(1))</var>.
+ </p>
+ <p>
+ <var>He(1)</var> did <code><var>NUM2</var> + <var>NUM1</var> = <var>TOTAL</var></code> <var>plural(exercise(1))</var>.
+ </p>
+ </div>
+ </div>
+
+ <div id="compare-bigger-less" data-type="compare-bigger-more">
+ <p class="problem">
+ <var>person(2)</var> did <var>NUM1</var> fewer <var>plural(exercise(1), NUM1)</var> than <var>person(1)</var> <var>timeofday(1)</var>.
+ <var>person(2)</var> did <var>plural(NUM2, exercise(1))</var>.
+ </p>
+ </div>
+
+ <div id="compare-smaller-more">
+ <p class="problem">
+ <var>person(1)</var> did <var>NUM1</var> more <var>plural(exercise(1), NUM1)</var> than <var>person(2)</var> <var>timeofday(1)</var>.
+ <var>person(1)</var> did <var>plural(TOTAL, exercise(1))</var>.
+ </p>
+ <p class="question">
+ How many <var>plural(exercise(1))</var> did <var>person(2)</var> do?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM2</var>
+ </p>
+ <div class="hints">
+ <p>
+ <var>person(1)</var> did <var>plural(TOTAL, exercise(1))</var>, and <var>person(2)</var> did <var>NUM1</var> fewer than that, so find the difference.
+ </p>
+ <p>
+ The difference is <code><var>TOTAL</var> - <var>NUM1</var></code> <var>plural(exercise(1))</var>.
+ </p>
+ <p>
+ <var>He(1)</var> did <code><var>TOTAL</var> - <var>NUM1</var> = <var>NUM2</var></code> <var>plural(exercise(1), NUM2)</var>.
+ </p>
+ </div>
+ </div>
+
+ <div id="compare-smaller-fewer" data-type="compare-smaller-more">
+ <p class="problem">
+ <var>person(2)</var> did <var>NUM1</var> fewer <var>plural(exercise(1), NUM1)</var> than <var>person(1)</var> <var>timeofday(1)</var>.
+ <var>person(1)</var> did <var>plural(TOTAL, exercise(1))</var>.
+ </p>
+ </div>
+
+ </div>
+ </div>
+</body>
+
View
20 exercises/chain_rule_1.html
@@ -11,6 +11,16 @@
<var id="INNER">generateFunction("x")</var>
<var id="OUTER">new CalcFunctions[randRange(1, CalcFunctions.length - 1)](INNER.f)</var>
+ <div data-ensure="expr(INNER_WRONG_1) !== expr(['-', INNER.ddxF]) || expr(OUTER_WRONG_1) !== expr(['-', OUTER.ddxF])">
+ <var id="INNER_WRONG_1">randFromArray( INNER.wrongs )</var>
+ <var id="OUTER_WRONG_1">randFromArray( OUTER.wrongs )</var>
+ </div>
+
+ <div data-ensure="expr(INNER_WRONG_2) !== expr(['-', INNER.ddxF]) || expr(OUTER_WRONG_2) !== expr(['-', OUTER.ddxF])">
+ <var id="INNER_WRONG_2">randFromArray( INNER.wrongs )</var>
+ <var id="OUTER_WRONG_2">randFromArray( OUTER.wrongs )</var>
+ </div>
+
<var id="DERIVATIVE">expr(["*", OUTER.ddxF, INNER.ddxF])</var>
<var id="NOTATION">funcNotation("x")</var>
</div>
@@ -24,10 +34,16 @@
<ul class="choices" data-none="true" data-show="5">
<li><code><var>
- expr(["*", randFromArray(OUTER.wrongs), randFromArray(INNER.wrongs)])
+ expr(["*", OUTER.ddxF, randFromArray(INNER.wrongs)])
+ </var></code></li>
+ <li><code><var>
+ expr(["*", randFromArray(OUTER.wrongs), INNER.ddxF])
+ </var></code></li>
+ <li><code><var>
+ expr(["*", OUTER_WRONG_1, INNER_WRONG_1])
</var></code></li>
<li><code><var>
- expr(["*", randFromArray(OUTER.wrongs), randFromArray(INNER.wrongs)])
+ expr(["*", OUTER_WRONG_2, INNER_WRONG_1])
</var></code></li>
<li><code><var>
expr(["+", randFromArray(OUTER.wrongs), randFromArray(INNER.wrongs)])
View
46 exercises/changing_decimals_to_fractions_1.html
@@ -1,46 +0,0 @@
-<!DOCTYPE html>
-<html data-require="math math-format">
-<head>
- <title>Changing Decimals to Fractions 1</title>
- <script src="../khan-exercise.js"></script>
-</head>
-
-<!-- Hints as per /video/decimals-and-fractions -->
-
-<body>
- <div class="exercise">
- <div class="vars">
- <var id="T">randRange( 1, 9 ) / 10</var> <!-- 0.1 and 0.9, only tenths -->
- <var id="H">randRangeExclude(1, 99, [10,20,30,40,50,60,70,80,90]) / 100</var> <!-- 0.01 and 0.99, no tenths -->
- </div>
-
- <div class="problems">
- <div id="to-the-tenth">
- <p class="question">Express <var>T</var> as a fraction.</p>
- <p class="solution" data-type="rational" data-simplify="optional"><var>T</var></p>
- <p class="extra-info"><i>(You can express this as any fraction - you don't have to simplify your answer)</i></p>
- <div class="hints">
- <p>The number <var>T * 10</var> is in the the tenths place.</p>
- <p>Since there is one decimal place, we simply put the number over 10.</p>
- <p>The answer is <code><var>fraction( T * 10, 10 )</var></code>.</p>
- </div>
- </div>
-
- <div id="to-the-hundredth" data-type="to-the-tenth" data-weight="3">
- <p class="question">Express <var>H</var> as a fraction.</p>
- <p class="solution" data-type="rational" data-simplify="optional"><var>H</var></p>
- <div class="hints">
- <p>The number <var>( floor( H * 10 )).toFixed(0)</var> is in the the tenths place.</p>
- <p>The number <var>( floor( H * 100 )).toFixed(0) - ( floor( H * 10 )).toFixed(0) * 10</var> is in the the hundredths place.</p>
- <p>This then becomes <code><var>fraction(( floor( H * 10 )).toFixed(0), 10 )</var></code> + <code><var>fraction(( floor( H * 100 )).toFixed(0) - ( floor( H * 10 )).toFixed(0) * 10 , 100 )</var></code></p>
- <p>Finding a common denominator: <code><var>fraction(( floor( H * 10 )).toFixed(0) * 10, 100 )</var></code> + <code><var>fraction(( floor( H * 100 )).toFixed(0) - ( floor( H * 10 )).toFixed(0) * 10 , 100 )</var></code></p>
- <p>Or more simply: Since there are two decimal places, we simply put the number over 100.</p>
- <p>The answer is <code><var>fraction( roundTo( 2, H * 100 ) , 100 )</var></code>.</p>
- </div>
- </div>
-
-
- </div>
- </div>
-</body>
-</html>
View
31 exercises/changing_decimals_to_percents.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html data-require="math">
+ <head>
+ <title>Changing decimals to percents</title>
+ <script src="../khan-exercise.js"></script>
+ </head>
+ <body>
+ <div class="exercise">
+ <div class="vars">
+ <var id="DECIMAL">randRange( 50, 999 ) / 1000</var> <!-- between 0.05 and .999, pcts with 1 decimal place-->
+ <var id="SOLN">DECIMAL * 100</var>
+ </div>
+
+ <div class="problems">
+ <div id="original" data-weight="1">
+ <p class="question">Express <code><var>DECIMAL</var></code> as a percent.</p>
+ <div class="solution" data-type="multiple">
+ <p><span class="sol"><var>SOLN</var></span> %</p>
+ </div>
+
+ <div class="hints">
+ <p>To convert a decimal to a fraction, we need to multiply by 100 and add the <code>\%</code> symbol.</p>
+ <p>To multiply by 100, we can just move the decimal point two places to the right.</p>
+ <p><code><var>DECIMAL</var> \rightarrow <var>DECIMAL * 10 </var> \rightarrow <var>SOLN</var></code></p>
+ <p>So <code><var>DECIMAL</var></code> = <code><var>SOLN</var>\%</code>.</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>
View
45 exercises/changing_fractions_to_decimals_1.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html data-require="math math-format graphie graphie-helpers">
+<head>
+ <title>Changing fractions to decimals 1</title>
+ <script src="../khan-exercise.js"></script>
+
+ <script type="text/javascript">
+ function decimalLength( n ) {
+ return ( ( n + "" ).split( "." )[1] || "" ).length;
+ }
+
+ </script>
+</head>
+
+<body>
+<div class="exercise">
+ <div class="vars">
+ <div data-ensure="decimalLength( DEC ) <= 4">
+ <var id="_D">randFromArray([ 4, 5, 8, 10, 16, 20, 25, 40, 50, 100 ])</var>
+ <var id="_N">randRange( 1, _D - 1 )</var>
+ <var id="DEC">_N / _D</var>
+ </div>
+
+ <var id="GCD">getGCD( _N, _D )</var>
+ <var id="N">round( _N / GCD )</var>
+ <var id="D">round( _D / GCD )</var>
+ </div>
+
+ <div class="problems">
+ <div>
+ <p class="question">Express <code><var>fraction( _N, _D )</var></code> as a decimal.</p>
+ <div class="solution" data-type="decimal"><var>DEC</var></div>
+ </div>
+ </div>
+
+ <div class="hints">
+ <p data-if="GCD > 1"><code><var>fraction( _N, _D )</var></code> reduces to <code><var>fraction( N, D )</var></code>.</p>
+ <p data-if="D === 10 || D === 100">Denominators of 10 or 100 are easy cases: The decimal form is just the numerator with the decimal place moved left by the number of 0s in the denominator.
+ <p data-if="D === 10 || D === 100">For this question, this means <var>D === 10 ? "1 place" : "2 places"</var>.</p>
+ <p data-else>To turn <code><var>fractionSmall( N, D )</var></code> into a decimal, perform long division, dividing <code><var>D</var></code> into <code><var>N</var></code> (if you need help with this, try practicing some Division exercises or watching some related videos).</p>
+ <p><code><var>N</var> \div <var>D</var> = <var>DEC</var></code></p>
+ </div>
+</div>
+</body>
+</html>
View
19 exercises/changing_fractions_to_percents.html
@@ -37,12 +37,19 @@
</div>
<div class="hints">
- <p data-if="GCD > 1"><code><var>fraction( _N, _D )</var></code> reduces to <code><var>fraction( N, D )</var></code>.</p>
- <p>To turn a fraction into a percent, turn the fraction into a decimal and then multiply the decimal by 100.</p>
- <p>To turn <code><var>fraction( N, D )</var></code> into a decimal, perform long division, dividing <code><var>D</var></code> into <code><var>N</var></code> (if you need help with this, try practicing some Division exercises or watching some related videos).</p>
- <p><code><var>N</var> \div <var>D</var> = <var>DEC</var></code></p>
- <p>To convert this decimal into a percent, we need to multiply it by 100.</p>
- <p><code><var>DEC</var> = (100 \cdot <var>DEC</var>) \% = <var>roundTo( 2, 100 * DEC )</var>\%</code></p>
+ <div data-if="_D === 100" data-unwrap>
+ <p>When the denominator is 100, you can simply take the numerator and apply the % sign:</p>
+ <p><code><var>fraction( _N, _D )</var></code> = <var>100 * DEC</var>%</p>
+ </div>
+ <div data-else data-unwrap>
+ <p data-if="GCD > 1"><code><var>fraction( _N, _D )</var></code> reduces to <code><var>fraction( N, D )</var></code>.</p>
+ <p>To turn a fraction into a percent, turn the fraction into a decimal and then multiply the decimal by 100.</p>
+ <p data-if="D === 10">Denominators of 10 are an easy case: The decimal form is just the numerator with the decimal place moved left by the number of 0s in the denominator - in this case 1 place.</p>
+ <p data-else>To turn <code><var>fraction( N, D )</var></code> into a decimal, perform long division, dividing <code><var>D</var></code> into <code><var>N</var></code> (if you need help with this, try practicing some Division exercises or watching some related videos).</p>
+ <p><code><var>N</var> \div <var>D</var> = <var>DEC</var></code></p>
+ <p>To convert this decimal into a percent, we need to multiply it by 100.</p>
+ <p><code><var>DEC</var> = (100 \cdot <var>DEC</var>) \% = <var>roundTo( 2, 100 * DEC )</var>\%</code></p>
+ </div>
</div>
</div>
</div>
View
30 exercises/changing_percents_to_decimals.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html data-require="math">
+<head>
+ <title>Changing percents to decimals</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+<body>
+<div class="exercise">
+ <div class="vars">
+ <var id="PCT">randRange( 10, 1999 ) / 10</var> <!-- between 1% and 199.9% with 1 decimal place-->
+ <var id="SOLN">roundTo( 5 , PCT / 100 )</var>
+ </div>
+
+ <div class="problems">
+ <div id="original" data-weight="1">
+ <p class="question">Express <code><var>PCT</var>\%</code> as a decimal.</p>
+ <div class="solution" data-type="decimal"><var>SOLN</var></div>
+
+ <div class="hints">
+ <p><code><var>PCT</var>\%</code> literally means <code><var>PCT</var></code> per 100</p>
+ <p><code><var>PCT</var>\%</code> = <code>\dfrac{<var>PCT</var>}{<var>100</var>}</code></p>
+ <p>To easily divide by 100, you can just move the decimal point two places to the left.</p>
+ <p><code><var>PCT</var> \rightarrow <var>roundTo( 5, PCT / 10 )</var> \rightarrow <var>SOLN</var></code></p>
+ <p>So <code><var>PCT</var>\%</code> = <code><var>SOLN</var></code><p>
+ </div>
+ </div>
+ </div>
+</div>
+</body>
+</html>
View
44 exercises/changing_percents_to_fractions.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html data-require="math math-format">
+<head>
+ <title>Changing percents to fractions</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+
+<body>
+ <div class="exercise">
+
+ <div class="problems">
+ <div id="lt-100">
+ <div class="vars">
+ <var id="A">randRangeExclude( 1 , 299 , [ 100 ] )</var>
+ </div>
+ <p class="question">Express <code><var>A</var>\%</code> as a fraction. Reduce to lowest terms.</p>
+ <p class="solution" data-type="rational"><var>A / 100</var></p>
+ <div class="hints">
+ <p><code><var>A</var>\%</code> literally means <code><var>A</var></code> per 100</p>
+ <p>Putting this in fraction form: <code><var>fraction( A , 100 )</var></code></p>
+ <p data-if="getGCD( A , 100 ) > 1">Both numerator and denominator are divisible by <code><var>getGCD( A , 100 )</var></code>.</p>
+ <p data-if="getGCD( A , 100 ) > 1">Reducing to lowest terms, <code><var>fractionReduce( A , 100 )</var></code>.</p>
+ <p data-if="A > 100">Optionally, the improper fraction <code><var>fractionReduce( A , 100 )</var></code> can be converted to the mixed number <code><var>( A - A % 100 ) / 100 + fractionReduce( round ( A % 100 ), 100 )</var></code>.</p>
+ </div>
+ </div>
+
+ <div id="decimal" data-type="lt-100">
+ <div class="vars">
+ <var id="A">randRange( 101, 1999 ) / 10</var>
+ </div>
+ <div class="hints">
+ <p><code><var>A</var>\%</code> literally means <code><var>A</var></code> per 100</p>
+ <p>Putting this in fraction form: <code><var>fraction( A , 100 )</var></code></p>
+ <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>
+ <p data-if="getGCD( A * 10 , 1000 ) > 1">Both numerator and denominator are divisible by <code><var>getGCD( A * 10 , 1000 )</var></code>.</p>
+ <p data-if="getGCD( A * 10 , 1000 ) > 1">Reducing to lowest terms, <code><var>fractionReduce( A * 10 , 1000 )</var></code>.</p>
+ <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>
+ </div>
+ </div>
+
+ </div>
+ </div>
+</body>
+</html>
View
87 exercises/comparing_absolute_values.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<html data-require="math graphie graphie-helpers">
+<head>
+ <meta charset="UTF-8" />
+ <title>Comparing absolute values</title>
+ <script src="../khan-exercise.js"></script>
+ <script type="text/javascript">
+ function drawNumberLine( NUM ) {
+ var graph = KhanUtil.currentGraph;
+
+ graph.init({
+ range: [ [-1, 11], [-1, 1] ],
+ });
+ var start = 0;
+ var end = 10;
+ var originX = 0;
+ var x = Math.abs( NUM );
+ if ( NUM < 0 ) {
+ start = -10;
+ end = 0;
+ originX = 10;
+ x = 10 - x;
+ }
+ numberLine( start, end );
+ graph.style({ stroke: "#FFA500", fill: "#FFA500", strokeWidth: 3.5, arrows: "->" });
+ graph.path( [ [ originX, 0 ], [ x, 0 ] ] );
+ graph.circle( [ originX, 0 ], 0.10 );
+ graph.style({ stroke: "#6495ED", fill: "#6495ED" });
+ graph.pt = graph.circle( [ x, 0 ], 0.15 );
+ }
+ </script>
+</head>
+<body>
+ <!--
+ Inequalities and equalities between absolute values with other absolute values and integers.
+ -->
+ <div class="exercise">
+ <div class="problems">
+ <div>
+ <div class="vars">
+ <var id="ABS_1, ABS_2">randFromArray([[ "|", "|", ], [ "|", "", ], [ "", "|", ]])</var>
+ <var id="NUM_1">randRange(-10, 10)</var>
+ <var id="NUM_2">( NUM_1 < 0 ) ? randRange(0, 10) : randRange(-10, -1)</var>
+ <var id="NUM_1_VALUE">ABS_1 ? abs( NUM_1 ) : NUM_1</var>
+ <var id="NUM_2_VALUE">ABS_2 ? abs( NUM_2 ) : NUM_2</var>
+ <var id="SOLUTION">(function() {
+ if ( NUM_1_VALUE === NUM_2_VALUE ) {
+ return "=";
+ }
+ return NUM_1_VALUE < NUM_2_VALUE ? "&lt;" : "&gt;";
+ })()</var>
+ </div>
+
+ <div class="problem">
+ <p>Fill in the blank.</p>
+ <p>
+ <code><var>ABS_1 + NUM_1 + ABS_1</var></code> ____ <code><var>ABS_2 + NUM_2 + ABS_2</var></code>
+ </p>
+ </div>
+ <p class="solution"><code><var>SOLUTION</var></code></p>
+ <ul class="choices" data-category="true">
+ <li><code>&lt;</code></li>
+ <li><code>&gt;</code></li>
+ <li><code>=</code></li>
+ </ul>
+ <div class="hints">
+ <div class="graphie" data-if="ABS_1 === '|'">
+ drawNumberLine( NUM_1 );
+ </div>
+ <p data-if="ABS_1 === '|'">
+ The "absolute value" can be viewed as the distance from 0. The distance from <var>NUM_1</var> to 0 is <var>NUM_1_VALUE</var> so <code>|<var>NUM_1</var>| = <var>NUM_1_VALUE</var></code>
+ </p>
+ <div class="graphie" data-if="ABS_2 === '|'">
+ drawNumberLine( NUM_2 );
+ </div>
+ <p data-if="ABS_2 === '|'">
+ The "absolute value" can be viewed as the distance from 0. The distance from <var>NUM_2</var> to 0 is <var>NUM_2_VALUE</var> so <code>|<var>NUM_2</var>| = <var>NUM_2_VALUE</var></code>
+ </p>
+ <p>Is <var>NUM_1_VALUE</var> less than, greater than, or equal to <var>NUM_2_VALUE</var>?</p>
+ <p><code><var>NUM_1_VALUE</var> <var>SOLUTION</var> <var>NUM_2_VALUE</var></code></p>
+ <p><code><var>ABS_1</var><var>NUM_1</var><var>ABS_1</var> <var>SOLUTION</var> <var>ABS_2</var><var>NUM_2</var><var>ABS_2</var></code></p>
+ </div>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
View
16 exercises/comparing_fractions_1.html
@@ -37,13 +37,13 @@
<p>Fill in the blank.</p>
<p>
<code>\dfrac{<var>NUM_1</var>}{<var>DEN_1</var>}</code>
- ____<code>\dfrac{<var>NUM_2</var>}{<var>DEN_2</var>}</code>
+ ____ <code>\dfrac{<var>NUM_2</var>}{<var>DEN_2</var>}</code>
</p>
</div>
- <p class="solution"><var>SOLUTION</var></p>
+ <p class="solution"><code><var>SOLUTION</var></code></p>
<ul class="choices" data-category="true">
- <li>&lt;</li>
- <li>&gt;</li>
+ <li><code>&lt;</code></li>
+ <li><code>&gt;</code></li>
</ul>
<div class="hints">
<div>
@@ -88,13 +88,13 @@
<p>Fill in the blank.</p>
<p>
<code>\dfrac{<var>NUM_1</var>}{<var>DEN_1</var>}</code>
- ____<code>\dfrac{<var>NUM_2</var>}{<var>DEN_2</var>}</code>
+ ____ <code>\dfrac{<var>NUM_2</var>}{<var>DEN_2</var>}</code>
</p>
</div>
- <p class="solution"><var>SOLUTION</var></p>
+ <p class="solution"><code><var>SOLUTION</var></code></p>
<ul class="choices" data-category="true">
- <li>&lt;</li>
- <li>&gt;</li>
+ <li><code>&lt;</code></li>
+ <li><code>&gt;</code></li>
</ul>
<div class="hints">
<div>
View
14 exercises/comparing_fractions_2.html
@@ -13,7 +13,7 @@
-->
<div class="problems">
<div id="original">
- <div class="vars" data-ensure="NUM_1 !== NUM_2 && DEN_1 !== DEN_2">
+ <div class="vars" data-ensure="NUM_1 !== NUM_2 && DEN_1 !== DEN_2" data-weight="2">
<var id="FACTOR">randRange( 2, 3 )</var>
<var id="NUM_1">randRange( 1, 14 )</var>
<var id="NUM_2">randRange( 1, 14 )</var>
@@ -44,14 +44,14 @@
<p>Fill in the blank.</p>
<p>
<code>\dfrac{<var>NUM_1</var>}{<var>DEN_1</var>}</code>
- ____<code>\dfrac{<var>NUM_2</var>}{<var>DEN_2</var>}</code>
+ ____ <code>\dfrac{<var>NUM_2</var>}{<var>DEN_2</var>}</code>
</p>
</div>
- <p class="solution"><var>SOLUTION</var></p>
+ <p class="solution"><code><var>SOLUTION</var></code></p>
<ul class="choices" data-category="true">
- <li>&lt;</li>
- <li>=</li>
- <li>&gt;</li>
+ <li><code>&lt;</code></li>
+ <li><code>&gt;</code></li>
+ <li><code>=</code></li>
</ul>
<div class="hints">
@@ -77,6 +77,8 @@
<div data-if="randRange( 0, 1 )">
<var id="NUM_1, NUM_2">[ NUM_2, NUM_1 ]</var>
<var id="DEN_1, DEN_2">[ DEN_2, DEN_1 ]</var>
+ <var id="F1, F2">[ F2, F1 ]</var>
+ <var id="BECOMES_1, BECOMES_2">[ BECOMES_2, BECOMES_1 ]</var>
</div>
</div>
</div>
View
2  exercises/complementary_angles.html
@@ -24,7 +24,7 @@
</div>
<div class="question">
- <p>If <code>m \angle <var>A + O + C</var></code> is a right angle and <code>m <var>ANGLE_ONE</var> = <var>ANGLE</var>^\circ</code>, what is <code>m <var>ANGLE_TWO</var></code>, in degrees?</p>
+ <p>If <code>\angle <var>A + O + C</var></code> is a right angle and <code>m <var>ANGLE_ONE</var> = <var>ANGLE</var>^\circ</code>, what is <code>m <var>ANGLE_TWO</var></code>, in degrees?</p>
<div class="graphie">
init({
View
15 exercises/conic_sections.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8" />
+ <meta charset="UTF-8" /> <title>Conic sections</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+<body>
+ <div class="exercise" data-name="equation_of_an_ellipse"></div>
+ <div class="exercise" data-name="equation_of_a_hyperbola"></div>
+ <div class="exercise" data-name="equation_of_a_parabola"></div>
+ <div class="exercise" data-name="signs_of_a_parabola"></div>
+</body>
+</html>
+
View
54 exercises/converting_decimals_to_fractions_1.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html data-require="math math-format">
+<head>
+ <title>Converting decimals to fractions 1</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+
+<body>
+ <div class="exercise">
+ <div class="problems">
+ <div id="to-the-tenth">
+ <div class="vars">
+ <var id="D">randRange( 1, 9 ) / 10</var>
+ <var id="T">floor( D * 10 )</var>
+ </div>
+ <p class="question">Express <code><var>D</var></code> as a fraction.</p>
+ <p class="solution" data-type="rational" data-simplify="optional"><var>D</var></p>
+ <div class="hints">
+ <p>The number <code><var>T</var></code> is in the tenths place, so we have <var>cardinal( T )</var> tenth<span data-if="T !== 1">s</span>.</p>
+ <p><var>Cardinal( T )</var> tenth<span data-if="T !== 1">s</span> can be written as <code><var>fraction( T, 10 )</var></code>.</p>
+ </div>
+ </div>
+
+ <div id="to-the-hundredth" data-type="to-the-tenth" data-weight="3">
+ <div class="vars">
+ <var id="D">randRangeExclude(1, 99, [10,20,30,40,50,60,70,80,90]) / 100</var>
+ <var id="T">floor( D * 10 )</var>
+ <var id="H">floor( ( D * 100 ) % 10 )</var>
+ </div>
+ <p class="question">Express <code><var>D</var></code> as a fraction.</p>
+ <p class="solution" data-type="rational" data-simplify="optional"><var>D</var></p>
+ <div class="hints">
+ <p>The number <code><var>T</var></code> is in the tenths place, so we have <var>cardinal( T )</var> tenth<span data-if="T !== 1">s</span>.</p>
+ <p><var>Cardinal( T )</var> tenth<span data-if="T !== 1">s</span> can be written as <code><var>fraction( T, 10 )</var></code>.</p>
+ <p>The number <code><var>H</var></code> is in the hundredths place, so we have <var>cardinal( H )</var> hundredth<span data-if="H !== 1">s</span>.</p>
+ <p><var>Cardinal( H )</var> hundredth<span data-if="H !== 1">s</span> can be written as <code><var>fraction( H, 100 )</var></code>.</p>
+ <div>
+ <p>Add the two parts together.</p>
+ <p><code><var>fraction( T, 10 )</var> + <var>fraction( H, 100 )</var></code></p>
+ </div>
+ <div>
+ <p><code>= <var>fraction( T * 10, 100 )</var> + <var>fraction( H, 100 )</var></code></p>
+ <p><code>= <var>fraction( T * 10 + H, 100 )</var></code></p>
+ </div>
+ <div>
+ <p>You can also skip a few steps by making a fraction with <code><var>floor( D * 100 )</var></code> as the numerator and <code>100</code> (because the decimal extends to the hundredths place) as the denominator.</p>
+ <p><code><var>fraction( T * 10 + H, 100 )</var></code></p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
View
62 exercises/converting_decimals_to_fractions_2.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html data-require="math math-format">
+<head>
+ <title>Changing decimals to fractions 2</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+
+<!--
+Convert fraction such as 0.3763 to a fraction, convert fraction such as 12.16 into mixed number (12 4/25), reduce to simplest terms
+ -->
+
+<body>
+<div class="exercise">
+
+ <div class="problems">
+ <div id="into-fraction">
+ <div class="vars">
+ <var id="NUMERATOR">randRange( 0, 1 ) ? randRange( 100, 999 ) : randRange( 1000, 9999 )</var>
+ <var id="D">( NUMERATOR / 10000 ).toFixed( 4 )</var>
+ </div>
+ <p class="question">Express <code><var>D</var></code> as a fraction.</p>
+ <p class="solution" data-type="rational" data-simplify="optional"><var>D</var></p>
+ <div class="hints">
+ <div>
+ <p><code><var>D</var></code> can be represented as follows.</p>
+ <p><code>= 0 + <var>fraction( D.substr( 2, 1 ) , 10 )</var> + <var>fraction( D.substr( 3, 1 ) , 100 )</var> + <var>fraction( D.substr( 4, 1 ), 1000 )</var> + <var>fraction( D.substr( 5, 1 ), 10000 )</var></code></p>
+ <p><code>= <var>fraction( NUMERATOR, 10000 )</var></code></p>
+ </div>
+ <div>
+ <p>You can also skip a few steps by making a fraction with <code><var>NUMERATOR</var></code> as the numerator and <code>10000</code> (because the decimal extends to the ten thousandths place) as the denominator.</p>
+ <p><code><var>fraction( NUMERATOR, 10000 )</var></code></p>
+ </div>
+ </div>
+ </div>
+
+ <div id="into-mixed">
+ <div class="vars">
+ <var id="W">randRange( 1, 19 )</var>
+ <var id="D">randRangeExclude(1, 99, [ 10 , 20 , 30 , 40 , 50 , 60 , 70 , 80 , 90 ]) / 100</var>
+ <var id="GCD">getGCD( D * 100 , 100 )</var>
+ </div>
+ <p class="question">Express <code><var>W + D</var></code> as a mixed number. Reduce to lowest terms.</p>
+
+ <p class="solution" data-type="mixed"><var>W + D</var></p>
+
+ <div class="hints">
+ <div>
+ <p><code><var>W + D</var></code> can be represented as follows:</p>
+ <p><code>= <var>W</var> + <var>fraction( floor( D * 10 ), 10 )</var> + <var>fraction( floor( ( D * 100 ) % 10 ), 100 )</var></code></p>
+ </div>
+ <p><code>= <var>W + fraction( D * 100, 100 )</var></code></p>
+ <div data-if="GCD > 1">
+ <p>Reduce the fractional part by dividing the numerator and denominator by <code><var>GCD</var></code>.</p>
+ <p><code>=<var>W + fractionReduce( D * 100 , 100 )</var></code></p>
+ </div>
+ </div>
+ </div>
+
+ </div>
+</div>
+</body>
+</html>
View
106 exercises/converting_mixed_numbers_and_improper_fractions.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<html data-require="math math-format graphie graphie-helpers">
+ <head>
+ <title>Converting mixed numbers and improper fractions</title>
+ <script src="../khan-exercise.js"></script>
+ </head>
+ <body>
+ <div class="exercise">
+ <div class="vars" data-ensure="M_NUM &lt; M_DENOM">
+ <var id="WHOLE">randRange( 1, 10 )</var>
+
+ <var id="M_NUM">randRange( 1, 30 )</var>
+ <var id="M_DENOM">randRange( 1, 30 )</var>
+
+ <var id="M_REDUCED_NUM">M_NUM / getGCD( M_NUM, M_DENOM )</var>
+ <var id="M_REDUCED_DENOM">M_DENOM / getGCD( M_NUM, M_DENOM )</var>
+
+ <var id="I_NUM">WHOLE * M_REDUCED_DENOM + M_REDUCED_NUM</var>
+ <var id="I_DENOM">M_REDUCED_DENOM</var>
+ </div>
+
+ <div class="problems">
+ <div id="improper-to-mixed">
+ <p class="question">Convert <code><var>fraction( I_NUM, I_DENOM, false, true )</var></code> to a mixed number.</p>
+
+ <p class="solution" data-type="mixed"><var>I_NUM / I_DENOM</var></p>
+
+ <div class="hints">
+ <div>
+ <p>First, divide the numerator by the denominator.</p>
+ <p><code><var>I_NUM</var> \div <var>I_DENOM</var> = \color{#28AE7B}{<var>WHOLE</var>}\ \text{ R } \color{purple}{<var>M_REDUCED_NUM</var>}</code></p>
+ </div>
+ <div>
+ <p>So the improper fraction has <code class="hint_green"><var>WHOLE</var></code> wholes in it, which is equal to <code>\color{#28AE7B}{<var>WHOLE</var>} \times \dfrac{<var>I_DENOM</var>}{<var>I_DENOM</var>} = \color{#28AE7B}{<var>fraction( I_DENOM * WHOLE, I_DENOM, false, false )</var>}</code>.</p>
+ <div class="graphie">
+ init({ range: [ [0, 1], [0, WHOLE] ], scale: [250, 25] });
+
+ for ( var y = 0; y < WHOLE; y++ ) {
+ rectchart( [M_REDUCED_DENOM, 0], ["#28AE7B", "#999"], y );
+ }
+ </div>
+ <p>This quotient <code class="hint_green"><var>WHOLE</var></code> is the whole number part of the mixed number.</p>
+ </div>
+ <div>
+ <p>We also have a remainder of <code class="hint_purple"><var>M_REDUCED_NUM</var></code>, though. That represents the <code>\dfrac{\color{purple}{<var>M_REDUCED_NUM</var>}}{<var>I_DENOM</var>}</code> remaining from the improper fraction; it wasn't enough to be another whole number.</p>
+ <div class="graphie">
+ init({ range: [ [0, 1], [0, 1] ], scale: [250, 25] });
+
+ rectchart( [M_REDUCED_NUM, M_REDUCED_DENOM - M_REDUCED_NUM], ["purple", "#999"] );
+ </div>
+ </div>
+ <div>
+ <p>The converted mixed fraction is <code>\color{#28AE7B}{<var>WHOLE</var>}\ \color{purple}{<var>fraction( M_NUM, M_DENOM, false, true )</var>}.</code></p>
+ <div class="graphie">
+ init({ range: [ [0, 1], [0, WHOLE + 1] ], scale: [250, 25] });
+
+ for ( var y = 1; y <= WHOLE; y++ ) {
+ rectchart( [M_REDUCED_DENOM, 0], ["#28AE7B", "#999"], y );
+ }
+
+ rectchart( [M_REDUCED_NUM, M_REDUCED_DENOM - M_REDUCED_NUM], ["purple", "#999"] );
+ </div>
+ </div>
+ <p>Note that if we add up the two pieces of our mixed fraction, <code>\color{#28AE7B}{<var>fraction( I_DENOM * WHOLE, I_DENOM, false, false )</var>} + \color{purple}{<var>fraction( M_NUM, M_DENOM, false, true )</var>}</code>, we get the original improper fraction <code><var>fraction( I_NUM, I_DENOM, false, true )</var></code>.</p>
+ </div>
+ </div>
+
+ <div id="mixed-to-improper">
+ <p class="question">Convert <code><var>WHOLE</var>\ <var>fraction( M_NUM, M_DENOM, false, true )</var></code> to an improper fraction.</p>
+
+ <p class="solution" data-type="improper"><var>I_NUM / I_DENOM</var></p>
+
+ <div class="hints">
+ <p><code>\color{#FFA500}{<var>WHOLE</var>}\ \color{#6495ED}{<var>fraction( M_NUM, M_DENOM, false, true )</var>}</code></p>
+ <p>This mixed number is equivalent to <code>\color{#FFA500}{<var>WHOLE</var>} + \color{#6495ED}{<var>fraction( M_NUM, M_DENOM, false, true )</var>}</code>.</p>
+ <div>
+ <p>First, convert the <span class="hint_orange">whole part</span> of the mixed number to a fraction with the same denominator <code><var>M_REDUCED_DENOM</var></code> as the <span class="hint_blue">fractional part</span>.</p>
+ <p><code>\color{#FFA500}{<var>WHOLE</var>} \times \dfrac{<var>M_REDUCED_DENOM</var>}{<var>M_REDUCED_DENOM</var>} = \color{#FFA500}{\dfrac{<var>WHOLE * M_REDUCED_DENOM</var>}{<var>M_REDUCED_DENOM</var>}}</code></p>
+ <div class="graphie">
+ init({ range: [ [0, 1], [0, WHOLE] ], scale: [250, 25] });
+
+ for ( var y = 0; y < WHOLE; y++ ) {
+ rectchart( [M_REDUCED_DENOM, 0], ["#FFA500", "#999"], y );
+ }
+ </div>
+ </div>
+ <div>
+ <p>So now we have our number in the form <code>\color{#FFA500}{\dfrac{<var>WHOLE * M_REDUCED_DENOM</var>}{<var>M_REDUCED_DENOM</var>}} + \color{#6495ED}{<var>fraction( M_NUM, M_DENOM, false, true )</var>}</code>.</p>
+ <div class="graphie">
+ init({ range: [ [0, 1], [0, WHOLE + 1] ], scale: [250, 25] });
+
+ for ( var y = 1; y <= WHOLE; y++ ) {
+ rectchart( [M_REDUCED_DENOM, 0], ["#FFA500", "#999"], y );
+ }
+
+ rectchart( [M_REDUCED_NUM, M_REDUCED_DENOM - M_REDUCED_NUM], ["#6495ED", "#999"] );
+ </div>
+ <p>Now, just add the two fractions and simplify!</p>
+ </div>
+ <p><code>\color{#FFA500}{\dfrac{<var>WHOLE * M_REDUCED_DENOM</var>}{<var>M_REDUCED_DENOM</var>}} + \color{#6495ED}{<var>fraction( M_NUM, M_DENOM, false, true )</var>} = <var>fraction( I_NUM, I_DENOM, true, true )</var></code></p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>
View
78 exercises/decimals_on_the_number_line.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<html data-require="math math-format graphie graphie-helpers">
+<head>
+ <meta charset="UTF-8" />
+ <title>Decimals on the number line</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+<body>
+
+ <div class="exercise">
+ <div class="vars" >
+ <var id="NUMBER">( randRange( -300, 300 ) / 100 )</var>
+ <var id="WRONGS">( function() {
+ var pos = rand( 5 );
+ while( NUMBER - (0.47 * pos) < -3 ){
+ pos--;
+ }
+ while( NUMBER + 0.47 * (5 - pos) > 3 ){
+ pos++;
+ }
+
+ arr = [];
+ for ( i = 0; i < pos; i++){
+ arr.push( NUMBER - ((pos - i) * 0.47))
+ }
+ arr.push( NUMBER );
+ for ( i = pos + 1; i < 5; i++ ){
+ arr.push( NUMBER + (( i - pos) * 0.47))
+ }
+ return arr;
+ })()</var>
+ <var id="POSS_ANSWER">[ "A", "B", "C", "D", "E" ]</var>
+ <var id="ANSWER" >POSS_ANSWER[ WRONGS.indexOf( NUMBER ) ] </var>
+ </div>
+ <div class="problems">
+ <div>
+ <div class="question">
+ <p>Which dot marks the position of <code><var>NUMBER</var></code> on the number line?</p>
+
+ <div class="graphie">
+ init({
+ scale: [ 80, 40 ],
+ range: [ [-0.2, 22], [-1, 1] ]
+ });
+ var start = -3;
+ var end = 3;
+ var originX = 0;
+ var x = NUMBER;
+ numberLine( start, end );
+ style({ stroke: "#6495ED", fill: "#6495ED" });
+ style({ stroke: "#FFA500", fill: "#FFA500", strokeWidth: 3.5, arrows: "->" });
+ var already = [];
+ for( i = 0; i != WRONGS.length; i++ ){
+ ellipse( [ WRONGS[ i ] + 3, 0 ], [ 0.06, 0.12 ] );
+ label( [WRONGS[ i ] + 3, 0 ], POSS_ANSWER[ i ] , "above", { labelDistance: 5 } );
+ }
+ </div>
+ <div class="solution"><var>ANSWER</var></div>
+ <ul class="choices" data-category="true">
+ <li>A</li>
+ <li>B</li>
+ <li>C</li>
+ <li>D</li>
+ <li>E</li>
+ </ul>
+ </div>
+
+ <div class="hints">
+ <p><var>NUMBER</var> is between <var>floor( NUMBER )</var> and <var>ceil( NUMBER )</var>.</p>
+
+ <p><var>NUMBER</var> is closest to <var>round( NUMBER )</var></p>
+ <p>It is <var>ANSWER</var>.</p>
+ </div>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
View
2  exercises/dividing_decimals.html
@@ -28,7 +28,7 @@
<div>
<div class="graphie" id="numbers">
init({
- range: [ [ -2 - DIVISOR_DIGITS.length, DIVIDEND_DIGITS.length + 2 ], [ DIVIDEND_DIGITS.length * -2 - 1, 2 ] ],
+ range: [ [ -2 - DIVISOR_DIGITS.length, 17 ], [ DIVIDEND_DIGITS.length * -2 - 1, 2 ] ],
scale: [ 30, 45 ]
});
style({
View
3  exercises/dividing_fractions.html
@@ -21,10 +21,11 @@
<div class="problems">
<div>
+ <div class="problem">Reduce to lowest terms:</div>
<div class="question">
<p><code>\displaystyle <var>NEG1S</var> \frac{<var>A</var>}{<var>B</var>} \div <var>NEG2S</var> \frac{<var>C</var>}{<var>D</var>} = {?}</code></p>
</div>
- <div class="solution" data-type="improper"><var>(NEG1 * A * NEG2 * D) / (B * C)</var></div>
+ <div class="solution" data-type="rational"><var>(NEG1 * A * NEG2 * D) / (B * C)</var></div>
</div>
</div>
View
4 exercises/divisibility.html
@@ -7,9 +7,9 @@
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="A != ANSWER && B != ANSWER && A != B">
+ <div class="vars" data-ensure="A !== ANSWER && B !== ANSWER">
<var id="A">randRange( 10, 25 )</var>
- <var id="B">randRange( 10, 25 )</var>
+ <var id="B" data-ensure="A !== B">randRange( 10, 25 )</var>
<var id="LCM">getLCM( A, B )</var>
<var id="LCM_FACTORIZATION">getPrimeFactorization( LCM )</var>
<var id="ANSWER">
View
2  exercises/division_0.5.html
@@ -18,7 +18,7 @@
<div class="graphie" id="numbers">
var bottomBoundary = ( B === 1 ) ? A - 1 : -1;
init({
- range: [ [ -1, B + 1 ], [ bottomBoundary, A + 1 ] ],
+ range: [ [ -1, 10 ], [ bottomBoundary, A + 1 ] ],
scale: [ 50, 50 ]
});
View
2  exercises/division_1.5.html
@@ -32,7 +32,7 @@
<div>
<div class="graphie" id="numbers">
init({
- range: [ [ -1 - DIVISOR_DIGITS.length, DIVIDEND_DIGITS.length + 2 ], [ DIVIDEND_DIGITS.length * -2 - 1, 2 ] ],
+ range: [ [ -1 - DIVISOR_DIGITS.length, 17], [ DIVIDEND_DIGITS.length * -2 - 1, 2 ] ],
scale: [ 30, 45 ]
});
style({
View
2  exercises/division_1.html
@@ -18,7 +18,7 @@
<div class="graphie" id="numbers">
var bottomBoundary = ( B === 1 ) ? A - 1 : -1;
init({
- range: [ [ -1, B + 1 ], [ bottomBoundary, A + 1 ] ],
+ range: [ [ -1, 10 ], [ bottomBoundary, A + 1 ] ],
scale: [ 50, 50 ]
});
View
2  exercises/division_2.html
@@ -23,7 +23,7 @@
<div>
<div class="graphie" id="numbers">
init({
- range: [ [ -1 - DIVISOR_DIGITS.length, DIVIDEND_DIGITS.length + 2 ], [ DIVIDEND_DIGITS.length * -2 - 1, 2 ] ],
+ range: [ [ -1 - DIVISOR_DIGITS.length, 17 ], [ DIVIDEND_DIGITS.length * -2 - 1, 2 ] ],
scale: [ 30, 45 ]
});
style({
View
2  exercises/division_3.html
@@ -26,7 +26,7 @@
<div class="graphie" id="numbers">
init({
- range: [ [ -1 - DIVISOR_DIGITS.length, DIVIDEND_DIGITS.length + 2 ], [ DIVIDEND_DIGITS.length * -2 - 1, 2 ] ],
+ range: [ [ -1 - DIVISOR_DIGITS.length, 17 ], [ DIVIDEND_DIGITS.length * -2 - 1, 2 ] ],
scale: [ 30, 45 ]
});
style({
View
2  exercises/division_4.html
@@ -23,7 +23,7 @@
<div>
<div class="graphie" id="numbers">
init({
- range: [ [ -1 - DIVISOR_DIGITS.length, DIVIDEND_DIGITS.length + 2 ], [ DIVIDEND_DIGITS.length * -2 - 1, 2 ] ],
+ range: [ [ -1 - DIVISOR_DIGITS.length, 17 ], [ DIVIDEND_DIGITS.length * -2 - 1, 2 ] ],
scale: [ 30, 45 ]
});
style({
View
70 exercises/equation_of_a_hyperbola.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html data-require="math math-format expressions">
+<head>
+ <meta charset="UTF-8" />
+ <title>Equation of a hyperbola</title>
+ <script src="../khan-exercise.js"></script>
+ <style type="text/css">
+ #answer_area .short input[type=text] {
+ width: 60px;
+ }
+ </style>
+</head>
+<body>
+ <div class="exercise">
+ <div class="vars">
+ <var id="A">randRange( 2, 9 )</var>
+ <var id="B" data-ensure=" A !== B" >randRange( 2, 9 )</var>
+
+ <var id="H">randRange( -9, 9 )</var>
+ <var id="K">randRange( -9, 9 )</var>
+
+ <var id="WHICH_NEG">rand(2)</var>
+
+ <var id="X_MINUS"> WHICH_NEG === 1 ? "+" : "+"</var>
+ <var id="Y_MINUS"> WHICH_NEG === 1 ? "" : "-"</var>
+
+ <var id="ASYMPT">"\\dfrac{" + expr( ["*", reduce( A, B )[1] , plus( "x", -H ) ] ) + "}{" + reduce( A, B )[0] + "}" </var>
+ <var id="ANSWER">B+"*(-" + H + "+ x)/" + A</var>
+ <var id="X">H === 0 ? "x^2" : expr(["^", ["+", "x", -H], 2])</var>
+ <var id="Y">K === 0 ? "y^2" : expr(["^", ["+", "y", -K], 2])</var>
+ <var id="X2T">H === 0 ? "\\dfrac{x^2}{" + A*A + "}" : "\\dfrac {" + expr(["^", ["+", "x", -H], 2]) + "}{" + A*A +"}" </var>
+ <var id="Y2T">K === 0 ? "\\dfrac{y^2}{" + B*B + "}" : "\\dfrac {" + expr(["^", ["+", "y", -K], 2]) + "}{" + B*B +"}" </var>
+ </div>
+
+ <div class="problems">
+ <div>
+ <div class="question">
+ <p>The equation of a hyperbola <code>H</code> is <code><var>WHICH_NEG == 1 ? expr(["-", Y2T, X2T]) : expr(["-", X2T, Y2T])</var> = 1</code>.</p>
+ <p>What are the asymptotes?</p>
+ </div>
+
+ <div class="solution" data-type="multiple">
+ <p><code>y = \pm </code> <span class="sol" data-type="line" ><var>ANSWER</var></span></p>
+ </div>
+ </div>
+ </div>
+
+ <div class="hints">
+ <div>
+ <p>We first rewrite the equation in terms of y.</p>
+ <p><code><var> Y2T</var> = <var>Y_MINUS</var> 1 <var>X_MINUS</var> <var>X2T</var></code></p>
+ </div>
+
+ <div>
+ <p>Multiply both sides of the equation by <code><var>B * B</var></code>.</p>
+ <p><code><var> Y</var> = { <var>Y_MINUS</var> <var>B*B</var> <var>X_MINUS</var> \dfrac{ <var>X</var> \cdot <var> B*B </var> }{<var> A*A </var>}}</code> </p>
+ </div>
+ <div>
+ <p>Take the square root.</p>
+ <p><code><var> plus("y", -K) </var> = \pm \sqrt { <var>Y_MINUS</var> <var>B*B</var> <var>X_MINUS</var> \dfrac{ <var>X</var> \cdot <var> B*B </var> }{<var> A*A </var>}}</code></p>
+ </div>
+ <div>
+ <p>As <code>x</code> approaches infinity, the constants matter less and less.</p>
+ <p><code>y \approx \sqrt { \dfrac{ <var>X</var> \cdot <var> B*B </var> }{<var> A*A </var>}}</code></p>
+ </div>
+ <p>Therefore, the asymptotes are <code>\pm <var>ASYMPT</var></code>.</p>
+ </div>
+ </div>
+</body>
+</html>
View
51 exercises/equation_of_a_parabola.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html data-require="math math-format expressions">
+<head>
+ <meta charset="UTF-8" />
+ <title>Equation of a parabola</title>
+ <script src="../khan-exercise.js"></script>
+ <style type="text/css">
+ #answer_area .short input[type=text] {
+ width: 60px;
+ }
+ </style>
+</head>
+<body>
+ <div class="exercise">
+ <div class="vars" data-ensure="( A != 0 ) && -10 < C && C < 10 && B != 0 ">
+ <var id="A"> randRange( -5, 5 ) </var>
+ <var id="H"> randRange( -5, 5 )</var>
+ <var id="K"> randRange( -5, 5 )</var>
+ // y = A*(x-H)^2 + K = A(x^2-2Hx+H^2) + K = Ax^2 -2AHx + A*H^2+K
+ <var id="B">-2 * A * H</var>
+ <var id="C">A * H * H + K</var>
+ </div>
+
+ <div class="problems">
+ <div>
+ <div class="question">
+ <p>The equation of a parabola <code>P</code> is <code>y = <var>A</var>x^2 + <var>B</var>x + <var>C</var></code></p>
+ <p>What are its vertex <code>(h, k)</code> and its y intercept?</p>
+ </div>
+
+ <div class="solution" data-type="multiple">
+ <p class="short"><code>(h, k) = (</code><span class="sol"><var>H</var></span><code>,</code> <span class="sol"><var>K</var></span><code>)</code></p>
+ <p>Y intercept= <span class="sol"><var>C</var></span></p>
+ </div>
+
+ <div class="hints">
+ <p>Y intercept is the point on the Y axis, where x = 0</p>
+ <p>If x = 0, we have <code> y = <var>A</var> \cdot 0^2 + <var>B</var> \cdot 0 + <var>C</var></code></p>
+ <p><code>y = <var>C</var></code>, thus the Y intercept is <var>C</var></code></p>
+
+ <p>The equation of a parabola with vertex <code>(h, k)</code> is <code>y = a(x - h)^2 + k</code>.</p>
+ <p>We can rewrite the given equation as <code><var>A</var>x^2 + <var>A</var> \cdot <var>- 2 * H</var> + <var>H * A * H</var> + <var>K</var></code>, in order to get the form <code>a(x - h)^2</code></p>
+i <p>We factor out A, <code>y = <var>A</var> ( x^2 + <var>2 * H</var> + <var>H * H</var> ) + <var>K</var></code></p>
+ <p>The equation in the parantheses is of the form <code>( a + b )^2</code>, because <code> ( x^2 + <var>2 * H</var> + <var>H * H</var> ) = ( x^2 + 2 \cdot <var>H</var> + <var>H</var>^2 ) </code></p>
+ <p>Therefore <code>y = <var>A</var>( x - <var>H</var>)^2 + <var>K</var></code>.</p>
+ <p data-if="H < 0"> <code> y = <var>A</var>(x - (<var>H</var>))^2 + <var>K</var></code></p>
+ <p>Thus, the center <code>(h, k) = (<var>H</var>, <var>K</var>)</code></p>
+ </div>
+ </div>
+</body>
+</html>
View
54 exercises/equation_of_an_ellipse.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html data-require="math math-format expressions">
+<head>
+ <meta charset="UTF-8" />
+ <title>Equation of an ellipse</title>
+ <script src="../khan-exercise.js"></script>
+ <style type="text/css">
+ #answer_area .short input[type=text] {
+ width: 60px;
+ }
+ </style>
+</head>
+<body>
+ <div class="exercise">
+ <div class="vars">
+ <var id="A">randRange( 2, 9 )</var>
+ <var id="B" data-ensure=" A !== B" >randRange( 2, 9 )</var>
+
+ <var id="H">randRange( -9, 9 )</var>
+ <var id="K">randRange( -9, 9 )</var>
+
+ <var id="MAJ">max( A, B )</var>
+ <var id="MIN">min( A, B)</var>
+
+ <var id="X2T">H === 0 ? "\\dfrac{x^2}{" + A*A + "}" : "\\dfrac {" + expr(["^", ["+", "x", -H], 2]) + "}{" + A*A +"}" </var>
+ <var id="Y2T">K === 0 ? "\\dfrac{y^2}{" + B*B + "}" : "\\dfrac {" + expr(["^", ["+", "y", -K], 2]) + "}{" + B*B +"}" </var>
+ </div>
+
+ <div class="problems">
+ <div>
+ <div class="question">
+ <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>
+
+ <p>What are its center <code>(h, k)</code> and its major and minor radius?</p>
+
+ </div>
+
+ <div class="solution" data-type="multiple">
+ <p class="short"><code>(h, k) = (</code><span class="sol"><var>H</var></span><code>,</code> <span class="sol"><var>K</var></span><code>)</code></p>
+ <p>Major radius = <span class="sol"><var>MAJ</var></span></p>
+ <p>Minor radius = <span class="sol"><var>MIN</var></span></p>
+ </div>
+ </div>
+ </div>
+
+ <div class="hints">
+ <p>The equation of an ellipse with center <code>(h, k)</code> is <code> \dfrac{(x - h)^2}{a^2} + \dfrac{(y - k)^2}{b^2} = 1</code>.</p>
+ <p>We can rewrite the given equation as <code>\dfrac{(x - <var>negParens(H)</var>)^2}{<var>A*A</var>} + \dfrac{(y - <var>negParens(K)</var>)^2}{<var>B*B</var>} = 1 </code>.</p>
+ <p>Thus, the center <code>(h, k) = (<var>H</var>, <var>K</var>)</code>.</p>
+ <p><code><var>MAJ*MAJ</var></code> is bigger than <code><var>MIN*MIN</var></code> so the major radius is <code>\sqrt{<var>MAJ*MAJ</var>} = <var>MAJ</var></code> and the minor radius is <code>\sqrt{<var>MIN*MIN</var>} = <var>MIN</var></code>.</p>
+ </div>
+ </div>
+</body>
+</html>
View
94 exercises/estimation_with_decimals.html
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+<html data-require="math math-format word-problems">
+<head>
+ <meta charset="UTF-8" />
+ <title>Estimation with decimals</title>
+ <script src="../khan-exercise.js"></script>
+ <style>
+ .fake_header span {
+ font-weight: bold;
+ display: inline-block;
+ padding-left: 10px;
+ width: 100px;
+ border-bottom: 2px solid #CCCCCC;
+ }
+
+ .fake_header span:first-child {
+ width: 50px
+ }
+
+ .fake_row span {
+ display: inline-block;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ padding-left: 10px;
+ width: 100px;
+ border-bottom: 1px solid #DDD;
+ }
+
+ .fake_row:nth-child(n) span {
+ border-bottom: none;
+ }
+
+ .fake_row:nth-child(2n+1) span {
+ background-color: #F3F3F3;
+ }
+
+ .fake_row span:first-child {
+ width: 50px;
+ }
+ </style>
+</head>
+<body>
+ <div class="exercise">
+
+ <div class="problems">
+ <div>
+ <div class="vars">
+ <var id="VALUES">$.map( randRange( 1000, 16000, randRange( 3, 7 ) ), function( n ){ return ( n / 1000 ).toFixed( randRange( 1, 2 ) ); } )</var>
+ <var id="ANSWER">eval( $.map( VALUES , round ).join("+") )</var>
+ <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>
+ <var id="ACC">0</var>
+ <var id="SIZE">$.map( VALUES, function( i ){
+ if ( round( i ) &lt i ) {
+ return "smaller than";
+ }
+ else{
+ return "bigger or equal to";
+ }
+ } ) </var>
+ </div>
+ <p><var>person( 1 )</var> has been <var>TYPES[ 0 ]</var> every day for the last <var>VALUES.length</var> days.</p>
+ <p class="question">Given that <var>person( 1 )</var> <var>TYPES[ 1 ]</var> the following amounts (in <var>plural( TYPES[ 2 ] )</var>) each day, estimate how much <var>he( 1 )</var> <var>TYPES[ 1 ]</var> in total by rounding each amount to a whole number and summing.</p>
+ <div class="fake_header">
+ <span>Day</span>
+ <span>Amount</span>
+ </div>
+ <div class="fake_row" data-each="VALUES as i, val">
+ <span><var>i+1</var></span>
+ <span><var>val</var></span>
+ </div>
+ <p class="solution" data-type="multiple">
+ <span class="sol" data-forms="integer"><var>ANSWER</var></span> <var>plural( TYPES[ 2 ] )</var>
+ </p>
+
+ <div class="hints">