Browse files

Merge branch 'master' of http://github.com/Khan/khan-exercises into c…

…hemistry
  • Loading branch information...
2 parents 97c26f5 + 07beb59 commit fc65663156c4328f6c2c6d28bf1459dcba79ebca @joelburget joelburget committed Sep 9, 2011
Showing with 19,097 additions and 4,033 deletions.
  1. +95 −0 build/kathjax-config.js
  2. +142 −0 build/kathjax.py
  3. +231 −2 css/khan-exercise.css
  4. +1 −1 exercises/adding_fractions.html
  5. +1 −3 exercises/angle_types.html
  6. +8 −8 exercises/arithmetic_word_problems_1.html
  7. +271 −0 exercises/arithmetic_word_problems_2.html
  8. +168 −0 exercises/compound_inequalities.html
  9. +108 −0 exercises/congruent_triangles_1.html
  10. +4 −4 exercises/conic_sections.html
  11. +2 −2 exercises/converting_decimals_to_fractions_1.html
  12. +7 −6 exercises/converting_decimals_to_fractions_2.html
  13. +1 −1 exercises/dependent_probability.html
  14. +3 −3 exercises/domain_of_a_function.html
  15. +13 −12 exercises/equation_of_a_parabola.html
  16. +4 −2 exercises/estimation_with_decimals.html
  17. +1 −1 exercises/fractions_on_the_number_line.html
  18. +2 −1 exercises/geometry_1.html
  19. +191 −0 exercises/graphing_inequalities.html
  20. +1 −1 exercises/graphing_points.html
  21. +5 −5 exercises/inequalities_on_a_number_line.html
  22. +2 −2 exercises/inverse_trig_functions.html
  23. +11 −7 exercises/khan-exercise.html
  24. +118 −33 exercises/lines_of_symmetry.html
  25. +1 −2 exercises/measuring_angles.html
  26. +55 −36 exercises/number_line.html
  27. +14 −16 exercises/ordering_fractions.html
  28. +5 −2 exercises/ordering_negative_numbers.html
  29. +5 −5 exercises/percentage_word_problems_1.html
  30. +190 −0 exercises/polygon_intuition.html
  31. +103 −0 exercises/properties_of_numbers_1.html
  32. +59 −0 exercises/properties_of_numbers_2.html
  33. +1 −0 exercises/ratio_word_problems.html
  34. +3 −3 exercises/recognizing_conic_sections.html
  35. +60 −61 exercises/signs_of_a_parabola.html
  36. +73 −0 exercises/similar_triangles_1.html
  37. +1 −1 exercises/subtracting_fractions.html
  38. +160 −0 exercises/triangle_angles.html
  39. +84 −0 exercises/triangle_inequality.html
  40. +110 −0 exercises/triangle_types.html
  41. +1 −1 exercises/writing_proportions.html
  42. +9,032 −3,603 jquery.js
  43. +639 −209 khan-exercise.js
  44. +30 −0 utils/MathJax/1.1a/MathJax.js
  45. +6 −0 utils/MathJax/1.1a/config/KAthJax-7d639a8567d885717dcee68710bda571.js
  46. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_AMS-Regular.eot
  47. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Caligraphic-Bold.eot
  48. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Caligraphic-Regular.eot
  49. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Fraktur-Bold.eot
  50. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Fraktur-Regular.eot
  51. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Main-Bold.eot
  52. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Main-Italic.eot
  53. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Main-Regular.eot
  54. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Math-BoldItalic.eot
  55. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Math-Italic.eot
  56. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Math-Regular.eot
  57. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_SansSerif-Bold.eot
  58. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_SansSerif-Italic.eot
  59. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_SansSerif-Regular.eot
  60. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Script-Regular.eot
  61. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Size1-Regular.eot
  62. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Size2-Regular.eot
  63. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Size3-Regular.eot
  64. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Size4-Regular.eot
  65. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_Typewriter-Regular.eot
  66. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/eot/MathJax_WinIE6-Regular.eot
  67. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_AMS-Regular.otf
  68. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Bold.otf
  69. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Regular.otf
  70. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Fraktur-Bold.otf
  71. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Fraktur-Regular.otf
  72. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Main-Bold.otf
  73. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Main-Italic.otf
  74. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Main-Regular.otf
  75. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Math-BoldItalic.otf
  76. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Math-Italic.otf
  77. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Math-Regular.otf
  78. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_SansSerif-Bold.otf
  79. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_SansSerif-Italic.otf
  80. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_SansSerif-Regular.otf
  81. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Script-Regular.otf
  82. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Size1-Regular.otf
  83. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Size2-Regular.otf
  84. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Size3-Regular.otf
  85. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Size4-Regular.otf
  86. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_Typewriter-Regular.otf
  87. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_WinChrome-Regular.otf
  88. BIN utils/MathJax/1.1a/fonts/HTML-CSS/TeX/otf/MathJax_WinIE6-Regular.otf
  89. +765 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_AMS-Regular.svg
  90. +136 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Caligraphic-Bold.svg
  91. +134 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Caligraphic-Regular.svg
  92. +319 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Fraktur-Bold.svg
  93. +309 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Fraktur-Regular.svg
  94. +656 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Main-Bold.svg
  95. +374 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Main-Italic.svg
  96. +659 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Main-Regular.svg
  97. +331 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Math-BoldItalic.svg
  98. +331 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Math-Italic.svg
  99. +330 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Math-Regular.svg
  100. +280 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_SansSerif-Bold.svg
  101. +245 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_SansSerif-Italic.svg
  102. +211 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_SansSerif-Regular.svg
  103. +160 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Script-Regular.svg
  104. +110 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Size1-Regular.svg
  105. +109 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Size2-Regular.svg
  106. +49 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Size3-Regular.svg
  107. +102 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Size4-Regular.svg
  108. +322 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_Typewriter-Regular.svg
  109. +39 −0 utils/MathJax/1.1a/fonts/HTML-CSS/TeX/svg/MathJax_WinChrome-Regular.svg
  110. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/Arrows.js
  111. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/BasicLatin.js
  112. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/CombDiacritMarks.js
  113. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/CombDiactForSymbols.js
  114. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/Dingbats.js
  115. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/GeneralPunctuation.js
  116. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/GeometricShapes.js
  117. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/GreekAndCoptic.js
  118. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/Latin1Supplement.js
  119. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/LetterlikeSymbols.js
  120. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/MathOperators.js
  121. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/MiscMathSymbolsA.js
  122. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/MiscMathSymbolsB.js
  123. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/MiscTechnical.js
  124. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/SpacingModLetters.js
  125. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/SuppMathOperators.js
  126. +16 −0 utils/MathJax/1.1a/jax/element/mml/optable/SupplementalArrowsB.js
  127. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/autoload/annotation-xml.js
  128. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/autoload/maction.js
  129. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/autoload/menclose.js
  130. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/autoload/mglyph.js
  131. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/autoload/mmultiscripts.js
  132. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/autoload/ms.js
  133. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/autoload/mtable.js
  134. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/autoload/multiline.js
  135. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Arrows.js
  136. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/BBBold.js
  137. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/BoxDrawing.js
  138. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/CombDiacritMarks.js
  139. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Dingbats.js
  140. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/EnclosedAlphanum.js
  141. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/GeneralPunctuation.js
  142. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/GeometricShapes.js
  143. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/GreekAndCoptic.js
  144. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Latin1Supplement.js
  145. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/LatinExtendedA.js
  146. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/LetterlikeSymbols.js
  147. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Main.js
  148. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MathOperators.js
  149. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MiscMathSymbolsB.js
  150. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MiscSymbols.js
  151. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/MiscTechnical.js
  152. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/PUA.js
  153. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/SpacingModLetters.js
  154. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/SuppMathOperators.js
  155. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Caligraphic/Bold/Main.js
  156. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Caligraphic/Regular/Main.js
  157. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Fraktur/Bold/BasicLatin.js
  158. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Fraktur/Bold/Main.js
  159. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Fraktur/Bold/Other.js
  160. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Fraktur/Bold/PUA.js
  161. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Fraktur/Regular/BasicLatin.js
  162. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Fraktur/Regular/Main.js
  163. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Fraktur/Regular/Other.js
  164. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Fraktur/Regular/PUA.js
  165. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Greek/Bold/Main.js
  166. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Greek/BoldItalic/Main.js
  167. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Greek/Italic/Main.js
  168. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Greek/Regular/Main.js
  169. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Main/Bold/Arrows.js
  170. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Main/Bold/CombDiacritMarks.js
  171. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Main/Bold/CombDiactForSymbols.js
  172. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Main/Bold/GeneralPunctuation.js
  173. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Main/Bold/GeometricShapes.js
  174. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Main/Bold/Latin1Supplement.js
  175. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Main/Bold/LatinExtendedA.js
  176. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Main/Bold/LatinExtendedB.js
  177. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Main/Bold/LetterlikeSymbols.js
  178. +16 −0 utils/MathJax/1.1a/jax/output/HTML-CSS/fonts/TeX/Main/Bold/Main.js
Sorry, we could not display the entire diff because it was too big.
View
95 build/kathjax-config.js
@@ -0,0 +1,95 @@
+MathJax.Hub.Config({
+ messageStyle: "none",
+ skipStartupTypeset: true,
+ jax: ["input/TeX","output/HTML-CSS"],
+ extensions: ["tex2jax.js","MathZoom.js"],
+ TeX: {
+ extensions: [
+ "AMSmath.js",
+ "AMSsymbols.js",
+ "noErrors.js",
+ "noUndefined.js",
+ "newcommand.js",
+ "boldsymbol.js"
+ ],
+ Macros: {
+ RR: "\\mathbb{R}"
+ },
+ Augment: {
+ Definitions: {
+ macros: {
+ lrsplit: "LRSplit",
+ lcm: ["NamedOp", 0]
+ }
+ },
+ Parse: {
+ prototype: {
+ LRSplit: function( name ) {
+ var num = this.GetArgument( name ),
+ den = this.GetArgument( name );
+ var frac = MathJax.ElementJax.mml.mfrac( MathJax.InputJax.TeX.Parse( '\\strut\\textstyle{'+num+'\\qquad}', this.stack.env ).mml(),
+ MathJax.InputJax.TeX.Parse( '\\strut\\textstyle{\\qquad '+den+'}', this.stack.env ).mml() );
+ frac.numalign = MathJax.ElementJax.mml.ALIGN.LEFT;
+ frac.denomalign = MathJax.ElementJax.mml.ALIGN.RIGHT;
+ frac.linethickness = "0em";
+ this.Push( frac );
+ }
+ }
+ }
+ }
+ },
+ "HTML-CSS": {
+ scale: 100,
+ showMathMenu: false,
+ availableFonts: ["TeX"]
+ }
+});
+
+// We don't want to use inline script elements, we want to use code blocks
+MathJax.Hub.elementScripts = function( elem ) {
+ return elem.nodeName.toLowerCase() === "code" ?
+ [ elem ] :
+ elem.getElementsByTagName( "code" );
+};
+
+// Data is read in here:
+// https://github.com/mathjax/MathJax/blob/master/unpacked/jax/input/TeX/jax.js#L1704
+// We can force it to convert HTML entities properly by saying we're Konqueror
+MathJax.Hub.Browser.isKonqueror = true;
+
+MathJax.Ajax.timeout = 60 * 1000;
+MathJax.Ajax.loadError = (function( oldLoadError ) {
+ return function( file ) {
+ Khan.warnTimeout();
+ // Otherwise will receive unresponsive script error when finally finish loading
+ MathJax.Ajax.loadComplete = function( file ) { };
+ oldLoadError.call( this, file );
+ };
+})( MathJax.Ajax.loadError );
+
+MathJax.Hub.Register.StartupHook("HTML-CSS Jax - using image fonts", function() {
+ Khan.warnFont();
+});
+
+MathJax.Hub.Register.StartupHook("HTML-CSS Jax - no valid font", function() {
+ Khan.warnFont();
+});
+
+// Trying to monkey-patch MathJax.Message.Init to not throw errors
+MathJax.Message.Init = (function( oldInit ) {
+ return function( styles ) {
+ if ( this.div && this.div.parentNode == null ) {
+ var div = document.getElementById("MathJax_Message");
+ if ( div && div.firstChild == null ) {
+ var parent = div.parentNode;
+ if ( parent ) {
+ parent.removeChild( div );
+ }
+ }
+ }
+
+ oldInit.call( this, styles );
+ };
+})( MathJax.Message.Init );
+
+MathJax.Hub.Startup.onload();
View
142 build/kathjax.py
@@ -0,0 +1,142 @@
+import hashlib
+import os
+import re
+import shutil
+import sys
+import tempfile
+
+try:
+ import json
+except ImportError:
+ import simplejson as json
+
+pack = [
+ 'extensions/MathZoom.js',
+ 'extensions/TeX/AMSmath.js',
+ 'extensions/TeX/AMSsymbols.js',
+ 'extensions/TeX/noErrors.js',
+ 'extensions/TeX/noUndefined.js',
+ 'extensions/TeX/newcommand.js',
+ 'extensions/TeX/boldsymbol.js',
+ 'extensions/tex2jax.js',
+ 'jax/element/mml/jax.js',
+ 'jax/input/TeX/config.js',
+ 'jax/input/TeX/jax.js',
+ 'jax/output/HTML-CSS/config.js',
+ 'jax/output/HTML-CSS/jax.js',
+]
+
+origwd = os.getcwd()
+tempdir = tempfile.mkdtemp()
+mjdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../utils/MathJax/1.1a"))
+
+if os.path.isdir(mjdir):
+ print "%s exists, exiting" % mjdir
+ sys.exit(1)
+else:
+ print "Creating directory %s" % mjdir
+ os.makedirs(mjdir)
+
+os.chdir(tempdir)
+
+print "Downloading MathJax..."
+os.system('curl -# -L -o mathjax.zip https://github.com/mathjax/MathJax/zipball/v1.1a')
+
+print "Unzipping..."
+os.system('unzip -q mathjax.zip')
+os.unlink('mathjax.zip')
+
+try:
+ os.chdir((path for path in os.listdir(".") if path.startswith("mathjax-")).next())
+except:
+ print "Error unzipping mathjax.js"
+ sys.exit(1)
+
+# Pack most things into KAthJax.js
+
+print "Joining JavaScript files..."
+
+kathjax_js = open('KAthJax.js', 'w')
+
+config_js = open(os.path.join(origwd, os.path.dirname(__file__), "kathjax-config.js"), 'r')
+kathjax_js.write(config_js.read())
+config_js.close()
+
+kathjax_js.write('MathJax.Ajax.Preloading(\n')
+kathjax_js.write(',\n'.join('\t%s' % json.dumps('[MathJax]/%s' % path) for path in pack))
+kathjax_js.write('\n);\n\n')
+kathjax_js.write('MathJax.Hub.Config({"v1.0-compatible":false});\n\n')
+
+r_comment = re.compile(r'^/\*.+?\*/\s*', re.DOTALL)
+for path in pack:
+ fi = open(path, 'r')
+ contents = fi.read()
+ fi.close()
+
+ kathjax_js.write(r_comment.sub('', contents.strip(), 1))
+ kathjax_js.write('\n\n')
+
+kathjax_js.write('(function( ajax ) {\n')
+kathjax_js.write('\tfor (var path in ajax.loading) {\n')
+kathjax_js.write('\t\tif ( ( /KAthJax-[0-9a-f]{32}.js$/ ).test( path ) ) {\n')
+kathjax_js.write('\t\t\tajax.loadComplete( path );\n')
+kathjax_js.write('\t\t}\n')
+kathjax_js.write('\t}\n')
+kathjax_js.write('})( MathJax.Ajax );\n')
+kathjax_js.close()
+
+# Pack KAthJax.js and copy to mjdir
+
+os.mkdir(os.path.join(mjdir, 'config'))
+os.system('uglifyjs --overwrite --ascii KAthJax.js')
+
+kathjax_js = open('KAthJax.js', 'r')
+md5 = hashlib.md5(kathjax_js.read()).hexdigest()
+kathjax_js.close()
+
+kathjax_basename = "KAthJax-%s" % md5
+shutil.copy('KAthJax.js', os.path.join(mjdir, 'config/%s.js' % kathjax_basename))
+
+# Update hash in khan-exercise.js
+
+khan_exercise_path = os.path.join(origwd, os.path.dirname(__file__), "../khan-exercise.js")
+
+khan_exercise_f = open(khan_exercise_path, 'r')
+khan_exercise = khan_exercise_f.read()
+khan_exercise_f.close()
+
+khan_exercise_f = open(khan_exercise_path, 'w')
+khan_exercise_f.write(re.sub(r'KAthJax-[0-9a-f]{32}', kathjax_basename, khan_exercise))
+khan_exercise_f.close()
+
+print "Generated %s.js, copying files..." % kathjax_basename
+
+# Copy some other things
+
+dirs = [
+ 'fonts/HTML-CSS/TeX/eot',
+ 'fonts/HTML-CSS/TeX/otf',
+ 'fonts/HTML-CSS/TeX/svg',
+ 'jax/output/HTML-CSS/autoload', # not sure what this is
+ 'jax/output/HTML-CSS/fonts/TeX', # not sure if we need this either; better safe than sorry?
+ 'jax/element/mml/optable', # seems like we need this too
+]
+
+for d in dirs:
+ dest = os.path.join(mjdir, d)
+
+ # Make sure parent directory exists
+ if not os.path.exists(os.path.dirname(dest)):
+ os.makedirs(os.path.dirname(dest))
+
+ shutil.copytree(d, dest)
+
+shutil.copy('MathJax.js', mjdir)
+
+print "Removing temporary directory..."
+os.chdir(origwd)
+shutil.rmtree(tempdir)
+
+print "Done. You probably want to run:"
+print " git add -A utils/MathJax"
+print "to remove deleted files from git."
View
233 css/khan-exercise.css
@@ -46,18 +46,26 @@ body.debug .graphie { outline: 1px dashed red; }
#scratchpad { padding-left: 30px; overflow: hidden; display: none; }
#scratchpad div { position: absolute; z-index: 1; min-height: 378px; width: 100%; height: 98%; outline: 1px solid #ccc; }
+#scratchpad-not-available { display: none; }
#tester-info.info-box { background: #f2e4bf; }
#tester-info .box { border: 1px solid black; padding: 2px 4px; margin-left: 5px; }
.summary { display: none; }
#browserwarning { display: none; padding: 18px; font-size: 120%; text-align: center; }
-#answer_area input.button:disabled { opacity: 0.7; cursor: default; color: #333; }
+#answer_area input.simple-button[disabled=disabled] { opacity: 0.5; filter: alpha(opacity = 50); cursor: default; }
+#answer_area input.simple-button[disabled=disabled]:hover { color: #fff !important; }
+#answer_area input.simple-button.orange[disabled=disabled]:hover { border-color: #bf4f04 !important; border-bottom-color: #803503 !important; }
+#answer_area input.simple-button.green[disabled=disabled]:hover { border-color: #76a005 !important; border-bottom-color: #557303 !important; }
+
#hint-remainder { color: #777; }
-#footer .simple-button { padding: 3px 10px; top: -1px }
+#footer .simple-button, .info-box .simple-button { padding: 3px 10px; top: -1px }
+.info-box .simple-button { top: 3px; );
+
+}
#issue .error { font-style: italic; font-weight: bold; }
#issue-link { font-style: italic; }
@@ -71,3 +79,224 @@ var, div.graphie { white-space: pre; }
#issue-throbber { position: relative; top: 3px; }
.exp input { vertical-align: super; font-size: 9px; height: 11px; }
+
+.correct-activity {
+ background-color: #69bb00;
+ text-shadow: 0 -1px 0 #557303;
+}
+
+.incorrect-activity {
+ background-color: #e12c2d;
+ text-shadow: 0 -1px 0 #921118;
+}
+
+.hint-activity {
+ background-color: #f19726;
+ text-shadow: 0 -1px 0 #B55C00;
+}
+
+.user-activity {
+ margin: 5px;
+ padding: 2px 5px;
+ border: 1px solid #999;
+ border-radius: 4px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ float: left;
+ cursor: pointer;
+ /*height: 25px;*/
+ color: white;
+}
+
+.user-activity input {
+ cursor: pointer;
+}
+
+div.timeline-time {
+ float: left;
+ padding-top: 10px;
+}
+
+div.timeline-time:before {
+ padding: 3px;
+ content: "~";
+}
+
+div.timeline-time:after {
+ padding: 3px;
+ content: "~";
+}
+
+div.timeline-total {
+ border-top: 1px solid #999;
+}
+
+#timelinecontainer {
+ border: 1px solid #c6d1ad;
+ border-top: 0px;
+ position: relative;
+}
+
+#timelinecontainer:before, #timelinecontainer:after {
+ content: "";
+ display: table;
+}
+
+#timelinecontainer:after {
+ clear: both;
+}
+
+#timelinecontainer {
+ zoom: 1;
+}
+
+#timeline {
+ overflow: hidden;
+ position: absolute;
+ left: 265px;
+ right: 225px;
+ border-left: 1px solid #c6d1ad;
+ border-right: 1px solid #c6d1ad;
+}
+
+#timeline-events {
+ width: 10000px;
+}
+
+#timeline-events:first-child {
+ margin-left: 5px;
+}
+
+#timeline-events:last-child {
+ margin-right: 5px;
+}
+
+#timeline-events:last-child:after {
+ content: "";
+ height: 1px;
+ display: block;
+}
+
+#timeline p {
+ margin: 0;
+}
+
+#previous-problem {
+ margin: 5px;
+ cursor: pointer;
+ float: left;
+ width: 100px;
+}
+
+#previous-step {
+ margin: 5px;
+ cursor: pointer;
+ float: left;
+ width: 100px;
+}
+
+#next-step {
+ margin: 5px;
+ cursor: pointer;
+ float: right;
+ width: 80px;
+}
+
+#previous-step span {
+ background: url(/images/previous-step.png) no-repeat 0 50% transparent;
+ padding: 4px 0 4px 25px;
+}
+
+#next-step span {
+ background: url(/images/next-step.png) no-repeat 100% 50% transparent;
+ padding: 4px 25px 4px 0;
+}
+
+#next-problem {
+ margin: 5px;
+ cursor: pointer;
+ float: right;
+ width: 80px;
+}
+
+.user-activity.activated {
+ border: 2px solid #888;
+}
+
+.lite header, .lite footer, .lite #extras, .lite .exercise-badge, .lite .hint-box {
+ display: none;
+}
+
+.lite #page-container, .lite #container {
+ min-width: 0;
+ border-width: 0;
+}
+
+.lite #answer_area {
+ margin-top: 10px;
+}
+
+.lite #answercontent {
+ position: fixed;
+ right: 0px;
+ bottom: 0px;
+ margin: 10px;
+}
+
+.lite #answercontent > * {
+ float: left;
+ margin-right: 10px;
+}
+
+.lite #answercontent .info-box-header {
+ font-size: 16px;
+ content: "Answer:";
+}
+
+.lite #answercontent input.button {
+ margin-top: 2px;
+}
+
+.lite #answercontent #examples-show, .lite #answercontent #examples {
+ display: none !important;
+}
+
+.lite .ui-icon {
+ width: 18px;
+ height: 18px;
+}
+
+.lite h1 {
+ font-family: inherit;
+}
+
+#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
2 exercises/adding_fractions.html
@@ -36,7 +36,7 @@
<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>
+ <p><code>\lcm(<var>SIMP_D1</var>, <var>SIMP_D2</var>) = <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>
View
4 exercises/angle_types.html
@@ -42,9 +42,7 @@
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();
-
+ Khan.scratchpad.disable();
</div>
</div>
View
16 exercises/arithmetic_word_problems_1.html
@@ -34,7 +34,7 @@
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')</var> <var>plural('is', NUM1)</var> on the train.
+ <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>
@@ -58,15 +58,15 @@
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', NUM1)</var> on the train.
+ <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.
+ Now there <var>plural('is', NUM2)</var> <var>plural(NUM2, 'person')</var> riding on the train.
</p>
<p class="question">
How many people got off the train at the stop?
@@ -82,7 +82,7 @@
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')</var> <var>plural('is', NUM1)</var>.
+ <code><var>TOTAL</var> - <var>NUM2</var> = <var>NUM1</var></code> <var>plural('person', NUM1)</var> got off.
</p>
</div>
</div>
@@ -128,7 +128,7 @@
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')</var>.
+ <code><var>TOTAL</var> - <var>NUM2</var> = <var>NUM1</var></code> <var>plural('tree', NUM1)</var>.
</p>
</div>
</div>
@@ -153,7 +153,7 @@
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')</var>.
+ <code><var>TOTAL</var> - <var>NUM2</var> = <var>NUM1</var></code> <var>plural('car', NUM1)</var>.
</p>
</div>
</div>
@@ -177,7 +177,7 @@
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')</var>.
+ <code><var>TOTAL</var> - <var>NUM2</var> = <var>NUM1</var></code> <var>plural('car', NUM1)</var>.
</p>
</div>
</div>
@@ -286,7 +286,7 @@
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))</var>.
+ <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>
View
271 exercises/arithmetic_word_problems_2.html
@@ -0,0 +1,271 @@
+<!DOCTYPE html>
+<html data-require="math word-problems">
+<head>
+ <meta charset="UTF-8" />
+ <title>Arithmetic word problems 2</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+<body>
+ <div class="exercise">
+ <div class="vars">
+ <var id="NUM1">randRange( 1, 12 )</var>
+ <var id="NUM2">randRange( 2, 12 )</var>
+ <var id="TOTAL">NUM1 * NUM2</var>
+ </div>
+
+ <div class="problems">
+
+ <div id="compare-product">
+ <p class="problem">
+ <var>A( color(1) )</var> <var>clothing(1)</var> costs <code>$<var>NUM1</var></code>,
+ and a popular <var>color(2)</var> <var>clothing(2)</var> costs <code><var>NUM2</var></code> times as much.
+ </p>
+ <p class="question">
+ How much does the <var>color(2)</var> <var>clothing(2)</var> cost?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>TOTAL</var>
+ </p>
+ <div class="hints">
+ <p>
+ The cost of the <var>color(2)</var> <var>clothing(2)</var>
+ is a multiple of the cost of the <var>color(1)</var> <var>clothing(1)</var>,
+ so find the product.
+ </p>
+ <p>
+ The product is <code><var>NUM2</var> \times $<var>NUM1</var></code>.
+ </p>
+ <p>
+ <code><var>NUM2</var> \times $<var>NUM1</var> = $<var>TOTAL</var></code>
+ </p>
+ <p>
+ The <var>color(2)</var> <var>clothing(2)</var> costs <code>$<var>TOTAL</var></code>.
+ </p>
+ </div>
+ </div>
+
+ <div id="compare-groupsize">
+ <p class="problem">
+ <var>A( color(1) )</var> <var>clothing(1)</var> costs $<var>TOTAL</var>,
+ which is <var>NUM2</var> times as much as <var>a( color(2) )</var> <var>clothing(2)</var> costs.
+ </p>
+ <p class="question">
+ How much does the <var>color(2)</var> <var>clothing(2)</var> cost?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM1</var>
+ </p>
+ <div class="hints">
+ <p>
+ The cost of the <var>color(1)</var> <var>clothing(1)</var>
+ is a multiple of the cost of the <var>color(2)</var> <var>clothing(2)</var>,
+ so find the result of dividing.
+ </p>
+ <p>
+ This result, called the quotient, is equal to <code>$<var>TOTAL</var> \div <var>NUM2</var></code>.
+ </p>
+ <p>
+ <code>$<var>TOTAL</var> \div <var>NUM2</var> = $<var>NUM1</var></code>
+ </p>
+ <p><var>A( color( 2 ) )</var> <var>clothing( 2 )</var> costs <code>$<var>NUM1</var></code>.
+ </div>
+ </div>
+
+ <div id="compare-number">
+ <p class="problem">
+ <var>A( color(1) )</var> <var>clothing(1)</var> costs $<var>TOTAL</var>,
+ and <var>a( color(2) )</var> <var>clothing(2)</var> costs $<var>NUM2</var>.
+ </p>
+ <p class="question">
+ The <var>color( 1 )</var> <var>clothing( 1 )</var> costs how many times as much as
+ the <var>color( 2 )</var> <var>clothing( 2 )</var> costs?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM1</var>
+ </p>
+ <div class="hints">
+ <p>
+ The cost of the <var>color(1)</var> <var>clothing(1)</var>
+ is a multiple of the cost of the <var>color(2)</var> <var>clothing(2)</var>,
+ so find the result of dividing.
+ </p>
+ <p>
+ This result, called the quotient, is <code>$<var>TOTAL</var> \div $<var>NUM2</var></code>.
+ </p>
+ <p>
+ <code>$<var>TOTAL</var> \div $<var>NUM2</var> = <var>NUM1</var></code>
+ </p>
+ <p>
+ The <var>color( 1 )</var> <var>clothing( 1 )</var> costs <code><var>NUM1</var></code> times as much as
+ the <var>color( 2 )</var> <var>clothing( 2 )</var> costs.
+ </p>
+ </div>
+ </div>
+
+ <div id="groups-product">
+ <p class="problem">
+ <var>person(1)</var> <var>rode(1)</var> <var>his(1)</var> <var>bike(1)</var> for <var>plural( NUM1, distance(1) )</var> on each of the past <var>NUM2</var> days.
+ </p>
+ <p class="question">
+ How many <var>plural( distance(1) )</var> did <var>person(1)</var> <var>ride(1)</var> <var>his(1)</var> <var>bike(1)</var> altogether?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>TOTAL</var>
+ </p>
+ <div class="hints">
+ <p>
+ The total number of <var>plural( distance(1) )</var> <var>biked(1)</var>
+ is the product of the number of <var>plural( distance(1) )</var> <var>biked(1)</var> each day
+ and the number of days that <var>person(1)</var> went <var>biking(1)</var>.
+ </p>
+ <p>
+ The product is <code><var>NUM1</var>\text{ <var>plural( distance( 1 ) )</var> per day} \times <var>NUM2</var>\text{ days}</code>.
+ </p>
+ <p>
+ <code><var>NUM1</var>\text{ <var>plural( distance( 1 ) )</var> per day} \times <var>NUM2</var>\text{ days}= <var>TOTAL</var>\text{ <var>plural( distance(1) )</var>}</code>
+ </p>
+ <p>
+ <var>person( 1 )</var> <var>biked( 1 )</var> a total of <var>plural( TOTAL, distance( 1 ) )</var>.
+ </p>
+ </div>
+ </div>
+
+ <div id="groups-groupsize">
+ <p class="problem">
+ <var>person(1)</var> <var>rode(1)</var> <var>his(1)</var> <var>bike(1)</var> for a total of <var>plural( TOTAL, distance(1) )</var> in the past <var>NUM2</var> days.
+ </p>
+ <p class="question">
+ How many <var>plural( distance(1) )</var> did <var>person(1)</var> <var>ride(1)</var> <var>his(1)</var> <var>bike(1)</var> each day?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM1</var>
+ </p>
+ <div class="hints">
+ <p>
+ The number of <var>plural( distance(1) )</var> <var>biked(1)</var> each day
+ is the total number of <var>plural( distance(1) )</var> <var>biked(1)</var> divided
+ by the number of days that <var>person(1)</var> went <var>biking(1)</var>.
+ </p>
+ <p>
+ We are looking for the quotient, which is <code><var>TOTAL</var>\text{ <var>plural( distance( 1 ) )</var>} \div <var>NUM2</var>\text{ days}</code>.
+ </p>
+ <p>
+ <code><var>TOTAL</var>\text{ <var>plural( distance( 1 ) )</var>} \div <var>NUM2</var>\text{ days} = <var>NUM1</var> \text{ <var>plural( distance(1) )</var> per day}</code>
+ </p>
+ <p><var>person( 1 )</var> <var>biked( 1 )</var> <var>NUM1</var> <var>plural( distance(1) )</var> each day.
+ </div>
+ </div>
+
+ <div id="groups-number">
+ <p class="problem">
+ <var>person(1)</var> has <var>biked(1)</var> <var>his(1)</var> <var>bike(1)</var> for a total of <var>plural( TOTAL, distance(1) )</var>
+ since <var>he(1)</var> started <var>biking(1)</var> daily. <var>He(1)</var> has been <var>biking(1)</var> <var>plural( NUM2, distance(1) )</var> each day.
+ </p>
+ <p class="question">
+ For how many days has <var>person(1)</var> been <var>biking(1)</var>?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM1</var>
+ </p>
+ <div class="hints">
+ <p>
+ The number of days that <var>person(1)</var> has been <var>biking(1)</var>
+ is the total number of <var>plural( distance(1) )</var> <var>biked(1)</var> divided
+ by the number of <var>plural( distance(1) )</var> <var>biked(1)</var> each day.
+ </p>
+ <p>
+ <code><var>TOTAL</var>\text{ <var>plural( distance( 1 ) )</var>} \div <var>NUM2</var>\text{ <var>plural( distance( 1 ))</var> each day} = \text{number of days driving}</code>
+ </p>
+ <p>
+ <code><var>TOTAL</var>\text{ <var>plural( distance( 1 ) )</var>} \div <var>NUM2</var>\text{ <var>plural( distance( 1 ))</var> each day} = <var>NUM1</var>\text{ days}</code>
+ </p>
+ </div>
+ </div>
+
+ <div id="array-product">
+ <p class="problem">
+ <var>person(1)</var> is a <var>farmer(1)</var>.
+ <var>He(1)</var> plants <var>plural( NUM1, 'row' )</var> of <var>plural( crop(1) )</var> in a <var>field(1)</var>,
+ and each row has <var>plural( NUM2, crop(1) )</var>.
+ </p>
+ <p class="question">
+ How many <var>plural( crop(1) )</var> did <var>person(1)</var> plant in the <var>field(1)</var>?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>TOTAL</var>
+ </p>
+ <div class="hints">
+ <p>
+ The number of <var>plural( crop(1) )</var> that <var>person(1)</var> planted
+ is the product of the number of rows that <var>he(1)</var> planted and
+ the number of <var>plural( crop(1) )</var> planted in each row.
+ </p>
+ <p>
+ The product is <code><var>NUM1</var>\text{ rows of <var>plural( crop( 1 ) )</var>} \times <var>NUM2</var>\text{ <var>plural( crop( 1 ) )</var> per row}</code>.
+ </p>
+ <p>
+ <code><var>NUM1</var>\text{ rows of <var>plural( crop( 1 ) )</var>} \times <var>NUM2</var>\text{ <var>plural( crop( 1 ) )</var> per row} = <var>TOTAL</var></code> <var>plural( crop(1) )</var>
+ </p>
+ </div>
+ </div>
+
+ <div id="array-groupsize">
+ <p class="problem">
+ <var>person(1)</var> is a <var>farmer(1)</var>.
+ <var>He(1)</var> plants <var>plural( NUM1, 'row' )</var> of <var>plural( crop(1) )</var> in a <var>field(1)</var>,
+ with each row having the same number of <var>plural( crop(1) )</var>.
+ <var>He(1)</var> plants a total of <var>plural( TOTAL, crop(1) )</var> in the <var>field(1)</var>.
+ </p>
+ <p class="question">
+ How many <var>plural( crop(1) )</var> did <var>person(1)</var> plant in each row?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM2</var>
+ </p>
+ <div class="hints">
+ <p>
+ The number of <var>plural( crop(1) )</var> that <var>person(1)</var> planted
+ in each row is the total number of <var>plural( crop(1) )</var> that <var>he(1)</var> planted
+ divided by the number of rows.
+ </p>
+ <p>
+ The result, called the quotient, is <code><var>TOTAL</var>\text{ <var>plural( crop( 1 ) )</var>} \div <var>NUM1</var>\text{ rows of <var>plural( crop( 1 ) )</var>}</code>.
+ </p>
+ <p>
+ <code><var>TOTAL</var>\text{ <var>plural( crop( 1 ) )</var>} \div <var>NUM1</var>\text{ rows of <var>plural( crop( 1 ) )</var>} = <var>NUM2</var>\text{ <var>plural( crop(1) )</var> per row}</code>
+ </p>
+ </div>
+ </div>
+
+ <div id="array-number">
+ <p class="problem">
+ <var>person(1)</var> is a <var>farmer(1)</var>.
+ <var>He(1)</var> plants <var>plural( TOTAL, crop(1) )</var> in a <var>field(1)</var>,
+ and each row has <var>plural( NUM1, crop(1) )</var>.
+ </p>
+ <p class="question">
+ How many <var>plural( 'row' )</var> of <var>plural( crop(1) )</var> did <var>person(1)</var> plant in the <var>field(1)</var>?
+ </p>
+ <p class="solution" data-forms="integer">
+ <var>NUM2</var>
+ </p>
+ <div class="hints">
+ <p>
+ The number of <var>plural( 'row' )</var> of <var>plural( crop(1) )</var> that <var>person(1)</var> planted
+ is the total number of <var>plural( crop(1) )</var> that <var>he(1)</var> planted
+ divided by the number of <var>plural( crop(1) )</var> in each row.
+ </p>
+ <p>
+ The result, called the quotient, is <code><var>TOTAL</var>\text{ <var>plural( crop( 1 ) )</var>} \div <var>NUM1</var>\text{ <var>plural( crop(1) )</var> per row}</code>.
+ </p>
+ <p>
+ <code><var>TOTAL</var>\text{ <var>plural( crop( 1 ) )</var>} \div <var>NUM1</var>\text{ <var>plural( crop(1) )</var> per row} = <var>NUM2</var>\text{ <var>plural( 'row' )</var>}</code>
+ </p>
+ </div>
+ </div>
+
+ </div>
+ </div>
+</body>
+
+
View
168 exercises/compound_inequalities.html
@@ -0,0 +1,168 @@
+<!DOCTYPE html> <html data-require="math math-format graphie graphie-helpers">
+<head>
+ <meta charset="UTF-8" />
+ <title>Compound inequalities</title>
+ <script src="../khan-exercise.js"></script>
+ <script type="text/javascript">
+ function getComp( coef, comp ) {
+ if ( coef >= 0 ) {
+ return comp;
+ }
+
+ return {
+ "": "",
+ "": "",
+ "<": ">",
+ ">": "<"
+ }[comp];
+ }
+ </script>
+</head>
+<body>
+ <!--
+ Solving compound inequalities.
+ -->
+ <div class="exercise">
+ <div class="vars" data-ensure="abs( SOLUTION[0] - SOLUTION[1] ) <= 5 && FAKE_ANSWER[0] !== SOLUTION[0] && FAKE_ANSWER[1] !== SOLUTION[1]">
+ <var id="COEF">[ randRange( 2, 9 ) * ( rand( 3 ) > 0 ? 1 : -1 ), randRange( 2, 9 ) * ( rand( 3 ) > 0 ? 1 : -1 ) ]</var>
+ <var id="ONE_OVER_COEF">[ fraction( 1, COEF[0] ), fraction( 1, COEF[1]) ]</var>
+ <var id="SIGN">[ randFromArray([ "-", "+" ]), randFromArray([ "-", "+" ]) ]</var>
+ <var id="LEFT_INT">[ rand( 3 ) > 0 ? randRange( 2, 9 ) : 0, rand( 3 ) > 0 ? randRange( 2, 9 ) : 0 ]</var>
+ <var id="ADD_TO_SIMPLIFY">[ LEFT_INT[0] * ( SIGN[0] === "+" ? -1 : 1 ), LEFT_INT[1] * ( SIGN[1] === "+" ? -1 : 1 ) ]</var>
+ <var id="COMP">[ randFromArray([ "&lt;", "&gt;", "&le;", "&ge;" ]), randFromArray([ "&lt;", "&gt;", "&le;", "&ge;" ]) ]</var>
+ <var id="RIGHT_INT">[ randRange( 1, 6 ) * abs( COEF[0] ) + ( SIGN[0] === "+" ? 1 : -1 ) * LEFT_INT[0], randRange( 1, 6 ) * abs( COEF[1] ) + ( SIGN[1] === "+" ? 1 : -1 ) * LEFT_INT[1] ]</var>
+ <var id="VARIABLE_NAME">randFromArray([ "a", "b", "c", "x", "y", "z" ])</var>
+ <var id="COMP_SOLUTION">[ getComp( COEF[0], COMP[0] ), getComp( COEF[1], COMP[1] ) ]</var>
+ <var id="SOLUTION_NOT_REDUCED">[ fraction( RIGHT_INT[0] + ADD_TO_SIMPLIFY[0], COEF[0] ), fraction( RIGHT_INT[1] + ADD_TO_SIMPLIFY[1], COEF[1] ) ]</var>
+ <var id="SOLUTION">[ ( RIGHT_INT[0] + ADD_TO_SIMPLIFY[0] ) / COEF[0], ( RIGHT_INT[1] + ADD_TO_SIMPLIFY[1] ) / COEF[1] ]</var>
+ <var id="FIRST">[ "first", "second" ]</var>
+ <var id="COLOR">[ "#1F78B4", "#B30000" ]</var>
+ <var id="INCLUSIVE">[ COMP_SOLUTION[0] === "&le;" || COMP_SOLUTION[0] === "&ge;", COMP_SOLUTION[1] === "&le;" || COMP_SOLUTION[1] === "&ge;" ]</var>
+ <var id="LESS_THAN">[ COMP_SOLUTION[0] === "&le;" || COMP_SOLUTION[0] === "&lt;", COMP_SOLUTION[1] === "&le;" || COMP_SOLUTION[1] === "&lt;" ]</var>
+ <var id="ALL_NUMBERS">( LESS_THAN[0] && !LESS_THAN[1] && SOLUTION[0] >= SOLUTION [1] ) || ( !LESS_THAN[0] && LESS_THAN[1] && SOLUTION[0] <= SOLUTION [1] )</var>
+ <var id="NO_SOLUTION">( LESS_THAN[0] && !LESS_THAN[1] && SOLUTION[1] > SOLUTION[0] ) || ( !LESS_THAN[0] && LESS_THAN[1] && SOLUTION[0] > SOLUTION[1] ) || ( SOLUTION[0] === SOLUTION[1] && !INCLUSIVE[0] && !INCLUSIVE[1] )</var>
+ <var id="OR">randFromArray( [ "or", "and" ] )</var>
+ <var id="IS_OR">OR === "or"</var>
+ <var id="FAKE_ANSWER">[ randRange( 2, 9 ) * ( rand( 3 ) > 0 ? 1 : -1 ), randRange( 2, 9 ) * ( rand( 3 ) > 0 ? 1 : -1 ) ]</var>
+ <var id="CONTAINS">(function() {
+ if ( LESS_THAN[0] && LESS_THAN[1] ) {
+ if ( SOLUTION[0] === SOLUTION[1] ) {
+ return INCLUSIVE[0] ? 1 : 2;
+ }
+ return SOLUTION[0] > SOLUTION[1] ? 1 : 2;
+ } else if ( !LESS_THAN[0] && !LESS_THAN[1] ) {
+ if ( SOLUTION[0] === SOLUTION[1] ) {
+ return INCLUSIVE[0] ? 1 : 2;
+ }
+ return SOLUTION[0] < SOLUTION[1] ? 1 : 2;
+ }
+
+ return 0;
+ })()</var>
+ <var id="IS_CONTAINED">CONTAINS === 1 ? 2 : 1</var>
+ </div>
+
+ <div class="problems">
+ <div>
+ <p class="question">Solve for <code><var>VARIABLE_NAME</var></code>:</p>
+ <div>
+ <code>\color{<var>COLOR[0]</var>}{<var>COEF[0] + VARIABLE_NAME</var><var data-if="LEFT_INT[0] !== 0">SIGN[0] + LEFT_INT[0]</var><var>COMP[0] + RIGHT_INT[0]</var>}</code> <var>OR</var>
+ <code>\color{<var>COLOR[1]</var>}{<var>COEF[1] + VARIABLE_NAME</var><var data-if="LEFT_INT[1] !== 0">SIGN[1] + LEFT_INT[1]</var><var>COMP[1] + RIGHT_INT[1]</var>}</code>
+ </div>
+
+ <p class="solution">
+ <span data-if="IS_OR && ALL_NUMBERS">All real numbers.</span>
+ <span data-else-if="IS_OR && CONTAINS"><code><var>VARIABLE_NAME + COMP_SOLUTION[CONTAINS - 1] + SOLUTION[CONTAINS - 1]</var></code></span>
+ <span data-else-if="!IS_OR && CONTAINS"><code><var>VARIABLE_NAME + COMP_SOLUTION[IS_CONTAINED - 1] + SOLUTION[IS_CONTAINED - 1]</var></code></span>
+ <span data-else-if="!IS_OR && NO_SOLUTION">No solution.</span>
+ <span data-else><code><var>VARIABLE_NAME + COMP_SOLUTION[0] + SOLUTION[0]</var></code> <var>OR</var> <code><var>VARIABLE_NAME + COMP_SOLUTION[1] + SOLUTION[1]</var></code></span>
+ </p>
+
+ <ul class="choices" data-show="4">
+ <li><code><var>VARIABLE_NAME + COMP_SOLUTION[0] + FAKE_ANSWER[0]</var></code> <var>OR</var> <code><var>VARIABLE_NAME + COMP_SOLUTION[1] + FAKE_ANSWER[1]</var></code></li>
+ <li><code><var>VARIABLE_NAME + COMP_SOLUTION[0] + SOLUTION[0]</var></code> <var>OR</var> <code><var>VARIABLE_NAME + COMP_SOLUTION[1] + randRangeNonZero( -9, 9 )</var></code></li>
+ <li><code><var>VARIABLE_NAME + COMP_SOLUTION[0] + randRangeNonZero( -9, 9 )</var></code> <var>OR</var> <code><var>VARIABLE_NAME + COMP_SOLUTION[1] + SOLUTION[1]</var></code></li>
+ <li><code><var>VARIABLE_NAME + COMP_SOLUTION[0] + FAKE_ANSWER[0]</var></code></li>
+ <li data-if="CONTAINS"><code><var>VARIABLE_NAME + COMP_SOLUTION[0] + SOLUTION[0]</var></code> <var>OR</var> <code><var>VARIABLE_NAME + COMP_SOLUTION[1] + SOLUTION[1]</var></code></li>
+ <div data-if="COMP[0] !== COMP_SOLUTION[0]" data-unwrap>
+ <li><code><var>VARIABLE_NAME + COMP[0] + SOLUTION[0]</var></code> <var>OR</var> <code><var>VARIABLE_NAME + COMP_SOLUTION[1] + SOLUTION[1]</var></code></li>
+ <li><code><var>VARIABLE_NAME + COMP[0] + FAKE_ANSWER[0]</var></code> <var>OR</var> <code><var>VARIABLE_NAME + COMP_SOLUTION[1] + FAKE_ANSWER[1]</var></code></li>
+ </div>
+ <div data-if="COMP[1] !== COMP_SOLUTION[1]" data-unwrap>
+ <li><code><var>VARIABLE_NAME + COMP_SOLUTION[0] + SOLUTION[0]</var></code> <var>OR</var> <code><var>VARIABLE_NAME + COMP[1] + SOLUTION[1]</var></code></li>
+ <li><code><var>VARIABLE_NAME + COMP_SOLUTION[0] + FAKE_ANSWER[0]</var></code> <var>OR</var> <code><var>VARIABLE_NAME + COMP[1] + FAKE_ANSWER[1]</var></code></li>
+ </div>
+ <div data-if="COMP[0] !== COMP_SOLUTION[0] && COMP[1] !== COMP_SOLUTION[1]" data-unwrap>
+ <li><code><var>VARIABLE_NAME + COMP[0] + SOLUTION[0]</var></code> <var>OR</var> <code><var>VARIABLE_NAME + COMP[1] + SOLUTION[1]</var></code></li>
+ <li><code><var>VARIABLE_NAME + COMP[0] + FAKE_ANSWER[0]</var></code> <var>OR</var> <code><var>VARIABLE_NAME + COMP[1] + FAKE_ANSWER[1]</var></code></li>
+ </div>
+ <li data-if="LEFT_INT[0] !== 0 || LEFT_INT[1] !== 0"><code><var>VARIABLE_NAME + COMP_SOLUTION[0] + round( ( RIGHT_INT[0] - ADD_TO_SIMPLIFY[0] ) / COEF[0] )</var></code> <var>OR</var> <code><var>VARIABLE_NAME + COMP_SOLUTION[1] +
+ round( ( RIGHT_INT[1] - ADD_TO_SIMPLIFY[1] ) / COEF[1] )</var></code></li>
+ <li data-if="IS_OR && !ALL_NUMBERS">All real numbers.</li>
+ <li data-if="!IS_OR && !NO_SOLUTION">No solution.</li>
+ </ul>
+
+ <div class="hints">
+ <div data-each="[ 0, 1 ] as i" data-unwrap>
+ <div>
+ <p>The <var>FIRST[i]</var> inequality can be simplified into this:</p>
+ <p><code>\color{<var>COLOR[i]</var>}{<var>VARIABLE_NAME + COMP_SOLUTION[i] + SOLUTION[i]</var>}</code></p>
+ </div>
+ </div>
+ <div>
+ <div class="graphie">
+ var start = min( SOLUTION[0], SOLUTION[1] ) - randRange( 2, 5 );
+ var end = max( SOLUTION[0], SOLUTION[1] ) + randRange( 2, 5 );
+
+ init({
+ range: [ [ start - 1, end + 1 ], [ -1, 1 ] ]
+ });
+
+ numberLine( start, end, null, start );
+
+ // Draw both inequalities
+ var y_placement = [ 0.05, -0.05 ];
+ for ( var i = 0; i < 2; i++ ) {
+ style({ stroke: COLOR[i], fill: COLOR[i], strokeWidth: 3.5, arrows: "->" });
+ path( [ [ SOLUTION[i] + 0.15 * ( LESS_THAN[i] ? -1 : 1 ), y_placement[i] ], [ LESS_THAN[i] ? start : end, y_placement[i] ] ] );
+ style({ stroke: COLOR[i], fill: INCLUSIVE[i] ? COLOR[i] : null });
+ circle( [ SOLUTION[i], y_placement[i] ], 0.15 );
+ }
+ </div>
+ <div data-if="IS_OR">
+ <p>Since this is an "or" inequality, the solution is the part of the number line which is covered by <strong>either</strong> of the graphs of the inequalities.</p>
+ <p data-if="ALL_NUMBERS">The combined graphs of the inequalities span the entire number line, therefore the solution is "All real numbers."</p>
+ <div data-else-if="CONTAINS">
+ <p>Notice how the <var>FIRST[IS_CONTAINED - 1]</var> inequality is completely included by the <var>FIRST[CONTAINS - 1]</var> inequality. Therefore the answer is:</p>
+ <p><code>\color{<var>COLOR[CONTAINS - 1]</var>}{<var>VARIABLE_NAME + COMP_SOLUTION[CONTAINS - 1] + SOLUTION[CONTAINS - 1]</var>}</code></p>
+ </div>
+ <div data-else>
+ <p>Therefore, since the graphs of the equalities do not intersect, the solution is:</p>
+ <p>
+ <code>\color{<var>COLOR[0]</var>}{<var>VARIABLE_NAME + COMP_SOLUTION[0] + SOLUTION[0]</var>}</code> or
+ <code>\color{<var>COLOR[1]</var>}{<var>VARIABLE_NAME + COMP_SOLUTION[1] + SOLUTION[1]</var>}</code>
+ </p>
+ </div>
+ </div>
+ <div data-else>
+ <p>The solution to an inequality with the word "and" is the intersection of the graphs of the inequalities.</p>
+ <p data-if="NO_SOLUTION">Since the graphs of the inequalities do not intersect, there is no solution.</p>
+ <div data-else-if="CONTAINS">
+ <p>Since the <var>FIRST[IS_CONTAINED - 1]</var> inequality is completely included by the <var>FIRST[CONTAINS - 1]</var> inequality, their intersection is the <var>FIRST[IS_CONTAINED -1]</var> inequality. Therefore the answer is:</p>
+ <p><code>\color{<var>COLOR[IS_CONTAINED - 1]</var>}{<var>VARIABLE_NAME + COMP_SOLUTION[IS_CONTAINED - 1] + SOLUTION[IS_CONTAINED - 1]</var>}</code></p>
+ </div>
+ <div data-else>
+ <p>Therefore, the solution is:</p>
+ <p>
+ <code>\color{<var>COLOR[0]</var>}{<var>VARIABLE_NAME + COMP_SOLUTION[0] + SOLUTION[0]</var>}</code> and
+ <code>\color{<var>COLOR[1]</var>}{<var>VARIABLE_NAME + COMP_SOLUTION[1] + SOLUTION[1]</var>}</code>
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
View
108 exercises/congruent_triangles_1.html
@@ -0,0 +1,108 @@
+<!DOCTYPE html>
+<html data-require="math graphie graphie-helpers graphie-geometry math-format">
+<head>
+ <meta charset="UTF-8" />
+ <title>Congruent Triangles 1</title>
+ <script src="../khan-exercise.js"></script>
+ <script>
+ function randomTriangle(){
+ var a = KhanUtil.randRange( 25, 150 );
+ var b = KhanUtil.randRange( 25, 180 - a );
+ if ( a + b > 170 ){
+ a = Math.max( 30, a - 15 );
+ b = Math.max( 30, b - 15 );
+ }
+ var c = 180 - a - b;
+
+ var sa = KhanUtil.randRange( 4, 8 );
+ var sb = sa * Math.sin( b * Math.PI / 180 ) / Math.sin( a * Math.PI / 180 );
+ var sc = sa * Math.sin( c * Math.PI / 180 ) / Math.sin( a * Math.PI / 180 );
+ return [ [ a, b, c], [ sa.toFixed( 1 ), sb.toFixed( 1 ), sc.toFixed( 1 ) ] ];
+ }
+
+
+ function drawCongruentTriangle( tr, name, pos, size, type, seed ){
+ with( KhanUtil.currentGraph ){
+ var traA = null;
+ if ( type === "AAA" ){
+ trA = new Triangle( pos, tr[ 0 ], [ 1, 1, 1], size, { "name" : name, "CAB" : tr[ 0 ][ 0 ], "ABC" : tr[ 0 ][ 1 ], "BCA" : tr[ 0 ][ 2 ] } );
+ }
+
+ if ( type === "SSS" ){
+ trA = new Triangle( pos, tr[ 0 ], [ 1, 1, 1], size, { "name" : name, "a" : tr[ 1 ][ 0 ], "b" : tr[ 1 ][ 1 ], "c" : tr[ 1 ][ 2 ] } );
+ }
+
+ if ( type === "ASA" ){
+ var ang1 = seed;
+ var ang2 = ( ang1 + 1 ) % 3;
+ var side = ( ang1 + 2 ) % 3;
+ trA = new Triangle( pos, tr[ 0 ], [ 1, 1, 1], size, { "name" : name, "a" : side == 0 ? tr[ 1 ][ 0 ] : "" , "b" : side == 1 ? tr[ 1 ][ 1 ] : "" , "c" : side == 2 ? tr[ 1 ][ 2 ] : "" , "CAB" : ( ang1 === 0 || ang2 === 0 ) ? tr[ 0 ][ 0 ] : "", "ABC" : ( ang1 === 1 || ang2 === 1 ) ? tr[ 0 ][ 1 ] : "", "BCA" : ( ang1 === 2 || ang2 === 2 ) ? tr[ 0 ][ 2 ] : "" } );
+ }
+
+ if ( type === "AAS" ){
+ var ang1 = seed;
+ var ang2 = ( ang1 + 1 ) % 3;
+ var side = ang1 ;
+ trA = new Triangle( pos, tr[ 0 ], [ 1, 1, 1], size, { "name" : name, "a" : side == 0 ? tr[ 1 ][ 0 ] : "" , "b" : side == 1 ? tr[ 1 ][ 1 ] : "" , "c" : side == 2 ? tr[ 1 ][ 2 ] : "" , "CAB" : ( ang1 === 0 || ang2 === 0 ) ? tr[ 0 ][ 0 ] : "", "ABC" : ( ang1 === 1 || ang2 === 1 ) ? tr[ 0 ][ 1 ] : "", "BCA" : ( ang1 === 2 || ang2 === 2 ) ? tr[ 0 ][ 2 ] : "" } );
+ }
+
+ if ( type === "SAS" ){
+ var side1 = seed;
+ var side2 = ( side1 + 1 ) % 3;
+ var ang = ( side1 + 2 ) % 3;
+ trA = new Triangle( pos, tr[ 0 ], [ 1, 1, 1], size, { "name" : name, "a" : ( side1 === 0 || side2 === 0 ) ? tr[ 1 ][ 0 ] : "" , "b" : ( side1 === 1 || side2 === 1 ) ? tr[ 1 ][ 1 ] : "" , "c" : ( side1 === 2 || side2 === 2 ) ? tr[ 1 ][ 2 ] : "" , "CAB" : ang === 0 ? tr[ 0 ][ 0 ] : "", "ABC" : ang === 1 ? tr[ 0 ][ 1 ] : "", "BCA" : ang === 2 ? tr[ 0 ][ 2 ] : "" } );
+ }
+
+ trA.draw();
+ trA.rotate( KhanUtil.randRange( 0, 50 ), 4, -6 );
+ trA.drawLabels();
+ }
+ return trA;
+ }
+ </script>
+</head>
+<body>
+ <div class="exercise">
+ <div class="vars">
+ <var id="MAIN">randomTriangle()</var>
+ <var id="ANSWERS">[ "B", "C", "Both", "None" ]</var>
+ <var id="ANSWER">randFromArray( ANSWERS )</var>
+ <var id="B"> ANSWER === "B" || ANSWER === "Both" ? MAIN : randomTriangle()</var>
+ <var id="C"> ANSWER === "C" || ANSWER === "Both" ? MAIN : randomTriangle()</var>
+ <var id="TYPE">randFromArray( [ "SSS", "AAA","SAS", "ASA", "AAS" ] )</var>
+ </div>
+
+ <div class="problems">
+ <div id="similar">
+ <div class="problem">
+ Which triangles are congruent to triangle A?
+ </div>
+ <div class="question">
+ <div class="graphie">
+ init({
+ range: [ [-1, 12 ], [ -10, 2.5 ] ]
+ })
+ var start = randRange( 0, 2 );
+ drawCongruentTriangle( MAIN, "A", [ 2, -2 ], 3, TYPE, start );
+ drawCongruentTriangle( B, "B", [ 5, -5 ], 3, TYPE, start );
+ drawCongruentTriangle( C, "C", [ 1, -8 ], 3, TYPE, start );
+ </div>
+ </div>
+ <div class="solution"><var>ANSWER</var></div>
+ <ul class="choices" data-category="true"
+ <li>B</li>
+ <li>C</li>
+ <li>Both</li>
+ <li>None</li>
+ </ul>
+ <div class="hints">
+ <p>Triangles are congruent when all corresponding sides and interior angles are congruent. </p>
+ <p>However, we do not need to know all the values in order to determine whether two triangles are congruent. </p>
+ <p>The rules we use for determining congruency are SSS, ASA, SAS and AAS</p>
+
+ </div>
+ </div>
+ </div>
+
+</body>
+</html>
View
8 exercises/conic_sections.html
@@ -2,14 +2,14 @@
<html>
<head>
<meta charset="UTF-8" />
- <meta charset="UTF-8" /> <title>Conic sections</title>
+ <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>
+ <div class="exercise" data-name="equation_of_an_ellipse"></div>
+ <div class="exercise" data-name="equation_of_a_circle_1"></div>
+ <div class="exercise" data-name="equation_of_a_circle_2"></div>
</body>
</html>
-
View
4 exercises/converting_decimals_to_fractions_1.html
@@ -13,7 +13,7 @@
<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="question">Express <code><var>D.toFixed( 1 )</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>
@@ -27,7 +27,7 @@
<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="question">Express <code><var>D.toFixed( 2 )</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>
View
13 exercises/converting_decimals_to_fractions_2.html
@@ -37,21 +37,22 @@
<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>
+ <var id="GCD">getGCD( round( D * 100 ) , 100 )</var>
+ <var id="FIXED">( W + D ).toFixed( 2 )</var>
</div>
- <p class="question">Express <code><var>W + D</var></code> as a mixed number. Reduce to lowest terms.</p>
+ <p class="question">Express <code><var>FIXED</var></code> as a mixed number. Reduce to lowest terms.</p>
- <p class="solution" data-type="mixed"><var>W + D</var></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>FIXED</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>
+ <p><code>= <var>W + fraction( roundTo( 0, 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>
+ <p><code>=<var>W + fractionReduce( round( D * 100 ) , 100 )</var></code></p>
</div>
</div>
</div>
View
2 exercises/dependent_probability.html
@@ -89,7 +89,7 @@
<div class="problems">
<div>
<p class="problem">You have <code><var>NUM_COINS</var></code> coins in a bag. <code><var>NUM_UNFAIR_COINS</var></code> of them are unfair in that they have a <code><var>PERCENT_CHANCE_UNFAIR_HEADS</var>\%</code> chance of coming up heads when flipped (the rest are fair coins). You randomly choose one coin from the bag and flip it <code><var>NUM_FLIPS</var></code> times.</p>
- <p class="question">What is the percent probability of getting <code><var>NUM_FLIPS</var></code> heads?</p>
+ <p class="question">What is the percent probability of getting <code><var>NUM_FLIPS</var></code> heads? Round your answer to the nearest hundredth of a percent.</p>
<p class="solution" data-forms="percent"><var>ANSWER</var></p>
</div>
</div>
View
6 exercises/domain_of_a_function.html
@@ -72,7 +72,7 @@
<div id="two-denom-cond" data-type="two-denom-simplify">
- <p class="problem"><code>f(x)= \begin{cases} \dfrac{ x + <var>A</var> }{ ( x + <var>A</var> )( x - <var>B</var> ) } & \text{, if $x \neq <var>B</var>$} \\ <var>C</var> & \text{, if $x = <var>B</var>$} \end{cases}</code></p>
+ <p class="problem"><code>f(x)= \begin{cases} \dfrac{ x + <var>A</var> }{ ( x + <var>A</var> )( x - <var>B</var> ) } & \text{if $x \neq <var>B</var>$} \\ <var>C</var> & \text{if $x = <var>B</var>$} \end{cases}</code></p>
<p class="solution"><code><var>CHOICES["two-denom-cond"]</var></code></p>
<ul class="choices" data-show="5" data-none="true">
@@ -135,7 +135,7 @@
<div id="inverse-sqrt-cond" data-type="two-denom-simplify">
- <p class="problem"><code>f(x) = \begin{cases} \dfrac{ 1 }{ \sqrt{ x - <var>A</var> } } & \text{, if $x \geq <var>A</var>$} \\ \dfrac{ 1 }{ \sqrt{ <var>A</var> - x } } & \text{, if $x < <var>A</var>$} \end{cases}</code></p>
+ <p class="problem"><code>f(x) = \begin{cases} \dfrac{ 1 }{ \sqrt{ x - <var>A</var> } } & \text{if $x \geq <var>A</var>$} \\ \dfrac{ 1 }{ \sqrt{ <var>A</var> - x } } & \text{if $x < <var>A</var>$} \end{cases}</code></p>
<p class="solution"><code><var>CHOICES["inverse-sqrt-cond"]</var></code></p>
<ul class="choices" data-show="5" data-none="true">
@@ -184,7 +184,7 @@
<div id="two-denom-cond-weird" data-type="two-denom-simplify">
- <p class="problem"><code>f(x) = \begin{cases} \dfrac{ x + <var>A</var> }{ ( x + <var>A</var> )( x - <var>C</var> ) } & \text{, if $x \neq <var>B</var>$} \\ <var>A</var> & \text{, if $x = <var>B</var>$} \end{cases}</code></p>
+ <p class="problem"><code>f(x) = \begin{cases} \dfrac{ x + <var>A</var> }{ ( x + <var>A</var> )( x - <var>C</var> ) } & \text{if $x \neq <var>B</var>$} \\ <var>A</var> & \text{if $x = <var>B</var>$} \end{cases}</code></p>
<p class="solution"><code><var>CHOICES["two-denom-cond-weird"]</var></code></p>
<ul class="choices" data-show="5" data-none="true">
View
25 exercises/equation_of_a_parabola.html
@@ -24,27 +24,28 @@
<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>
+ <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 <code>y</code>-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>
+ <p><code>y</code>-intercept <code>=</code> <span class="sol"><var>C</var></span></p>
</div>
+ </div>
+ </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 <code>y</code>-intercept is the point on the <code>y</code>-axis where <code>x = 0</code>.</p>
+ <p>If <code>x = 0</code>, we have <code>y = <var>A</var> \cdot 0^2 + <var>B</var> \cdot 0 + <var>C</var> = <var>C</var></code>, so the <code>y</code>-intercept is <code><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>
+ <p>We can rewrite the given equation as <code><var>A</var>x^2 + <var>A</var> \cdot <var>- 2 * H</var>x + <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 <code>A</code>, giving <code>y = <var>A</var> ( x^2 + <var>2 * H</var>x + <var>H * H</var> ) + <var>K</var></code></p>
+ <p>The equation in the parentheses 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)</code> is <code>(<var>H</var>, <var>K</var>)</code></p>
</div>
</div>
</body>
View
6 exercises/estimation_with_decimals.html
@@ -50,8 +50,8 @@
<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";
+ if ( round( i ) &lt; i ) {
+ return "smaller than";
}
else{
return "bigger or equal to";
@@ -90,5 +90,7 @@
</div>
</div>
</div>
+
+ </div>
</body>
</html>
View
2 exercises/fractions_on_the_number_line.html
@@ -38,7 +38,7 @@
<var id="POSS_ANSWER">[ "A", "B", "C", "D", "E" ]</var>
<var id="ANSWER" > POSS_ANSWER[ WRONGS.indexOf( NUMBER ) ] </var>
<var id="NICE_NUMBER"> SIGN + " \\dfrac{" + NOMINATOR + "}{" + DENOMINATOR + "}" </var>
- <Var id="REDUCED_NUMBER">SIGN + fraction( NOMINATOR, DENOMINATOR, true, true, false )</var>
+ <var id="REDUCED_NUMBER">SIGN + fraction( NOMINATOR, DENOMINATOR, true, true, false )</var>
</div>
<div class="problems">
<div>
View
3 exercises/geometry_1.html
@@ -2,7 +2,8 @@
<html>
<head>
<meta charset="UTF-8" />
- <meta charset="UTF-8" /> <title>Geometry 1</title>
+ <meta charset="UTF-8" />
+ <title>Geometry 1</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
View
191 exercises/graphing_inequalities.html
@@ -0,0 +1,191 @@
+<!DOCTYPE html> <html data-require="math math-format graphie">
+<head>
+ <meta charset="UTF-8" />
+ <title>Graphing inequalities</title>
+ <script src="../khan-exercise.js"></script>
+ <script type="text/javascript">
+ function printPoint( point ) {
+ return "(" + point.join( ", " ) + ")";
+ }
+
+ function getComp( coef, comp ) {
+ if ( coef >= 0 ) {
+ return comp;
+ }
+
+ return {
+ "": "",
+ "": "",
+ "<": ">",
+ ">": "<"
+ }[comp];
+ }
+ </script>
+</head>
+<body>
+ <div class="exercise">
+ <div class="vars">
+ <var id="Y_COEF">randRange( 2, 9 ) * ( rand( 3 ) > 0 ? 1 : -1 )</var>
+ <var id="ONE_OVER_Y_COEF">fraction( 1, Y_COEF )</var>
+ <var id="X_COEF">randRangeExclude( -9, 9, [ -1, 0, 1 ] )</var>
+ <var id="RIGHT_INT">randRangeNonZero( -20, 20 )</var>
+ <var id="M">-X_COEF / Y_COEF</var>
+ <var id="M_FRAC">fractionReduce( -X_COEF, Y_COEF )</var>
+ <var id="B">RIGHT_INT / Y_COEF</var>
+ <var id="B_FRAC">fractionReduce( RIGHT_INT, Y_COEF )</var>
+ <var id="COMP">randFromArray([ "&lt;", "&gt;", "&le;", "&ge;" ])</var>
+ <var id="COMP_SOLUTION">getComp( Y_COEF, COMP )</var>
+ <var id="LESS_THAN">COMP_SOLUTION == "&lt;" || COMP_SOLUTION == "&le;"</var>
+ <var id="INCLUSIVE">COMP_SOLUTION == "&ge;" || COMP_SOLUTION == "&le;"</var>
+ <var id="NEG_10_INTERCEPT">M * -10 + B</var>
+ <var id="POS_10_INTERCEPT">M * 10 + B</var>
+ <div data-ensure="sqrt( pow( POINT_1[0] - POINT_2[0], 2 ) + pow( POINT_1[1] - POINT_2[1], 2 ) ) > 4">
+ <var id="POINT_1">[ randRangeExclude( -9, 9, [ -3, -2, -1, 0 ] ), randRangeExclude( -9, 9, [ -1, -2 ] ) ]</var>
+ <var id="POINT_2">[ randRangeExclude( -9, 9, [ -3, -2, -1, 0 ] ), randRangeExclude( -9, 9, [ -1, -2 ] ) ]</var>
+ <var id="POINT_1_SOLUTION">POINT_1[1] > M * POINT_1[0] + B !== LESS_THAN || ( INCLUSIVE && M * POINT_1[0] + B === POINT_1[1] )</var>
+ <var id="POINT_2_SOLUTION">POINT_2[1] > M * POINT_2[0] + B !== LESS_THAN || ( INCLUSIVE && M * POINT_2[0] + B === POINT_2[1] )</var>
+ </div>
+ </div>
+
+ <div class="problems">
+ <div>
+ <p class="question">Which of the following ordered pairs <code><var>printPoint( POINT_1 )</var></code> and <code><var>printPoint( POINT_2 )</var></code> are solutions to the inequality <code><var>Y_COEF</var>y + <var>X_COEF</var>x <var>COMP + RIGHT_INT</var></code>?</p>
+
+ <div class="solution">
+ <div data-if="POINT_1_SOLUTION">
+ <code><var>printPoint( POINT_1 )</var></code>
+ </div>
+ <div data-if="POINT_1_SOLUTION && POINT_2_SOLUTION">
+ and
+ </div>
+ <div data-if="POINT_2_SOLUTION">
+ <code><var>printPoint( POINT_2 )</var></code>
+ </div>
+ <div data-else-if="!POINT_1_SOLUTION && !POINT_2_SOLUTION">
+ None of the above.
+ </div>
+ </div>
+
+ <ol class="choices" data-category="true">
+ <li><code><var>printPoint( POINT_1 )</var></code></li>
+ <li><code><var>printPoint( POINT_2 )</var></code></li>
+ <li><code><var>printPoint( POINT_1 )</var></code> and <code><var>printPoint( POINT_2 )</var></code></li>
+ <li>None of the above.</li>
+ </ol>
+
+ <div class="hints">
+ <p>To graph the inequality, we need to first put it in slope-intercept form (<code>y<var>COMP</var>mx + b</code>).</p>
+ <div>
+ <p>Add <code><var>-X_COEF</var>x</code> to both sides of the inequality.</p>
+ <p>
+ <code>
+ <var>Y_COEF</var>y + <var>X_COEF</var>x +<var>-X_COEF</var>x<var>COMP + RIGHT_INT</var>y +<var>-X_COEF</var>x
+ </code>
+ </p>
+ <p>
+ <code>
+ <var>Y_COEF</var>y<var>COMP + (-X_COEF)</var>x + <var>RIGHT_INT</var>
+ </code>
+ </p>
+ </div>
+ <p data-if="Y_COEF < 0">When multiplying or dividing both sides of an inequality by a negative number you have to flip the inequality. Therefore <code><var>COMP</var></code> becomes <code><var>COMP_SOLUTION</var></code>.</p>
+ <div>
+ <p>Multiply both sides of the inequality by <code><var>ONE_OVER_Y_COEF</var></code>.</p>
+ <p>
+ <code>
+ (<var>Y_COEF</var>y) \cdot (<var>ONE_OVER_Y_COEF</var>)<var>COMP_SOLUTION</var>(<var>-X_COEF</var>x + <var>RIGHT_INT</var>) \cdot (<var>ONE_OVER_Y_COEF</var>)
+ </code>
+ </p>
+ <p>
+ <code>
+ y <var>COMP_SOLUTION + M_FRAC</var>x + <var>B_FRAC</var>
+ </code>
+ </p>
+ </div>
+ <div>
+ <p>Graph the line.</p>
+ <div class="graphie" id="inequality">
+ graphInit({
+ range: 10,
+ scale: 20,
+ tickStep: 1,
+ labelStep: 1,
+ labelFormat: function( s ) { return "\\small{" + s + "}"; },
+ axisArrows: "<->"
+ });
+
+
+ if ( !INCLUSIVE ) {
+ style ({
+ "stroke-dasharray": "-"
+ });
+ }
+
+ line( [ -10, NEG_10_INTERCEPT ], [ 10, POS_10_INTERCEPT ] , {
+ stroke: "#28AE7B",
+ });
+
+ </div>
+ </div>
+ <div>
+ <p>Since our inequality has a <var>LESS_THAN ? "less-than" : "greater-than"</var><var>INCLUSIVE ? " or equal to" : ""</var> sign, that means that any point <strong><var>LESS_THAN ? "below" : "above"</var></strong> the line is a solution to the inequality.</p>
+ <p data-if="INCLUSIVE">Note that since the sign is <var>LESS_THAN ? "less-than" : "greater-than"</var> or <strong>equal to</strong>, any point on the line is also a solution.</p>
+ <p data-else>Note that since the sign is <var>LESS_THAN ? "less-than" : "greater-than"</var> (and not equal to), any point on the line is <strong>not</strong> part of the solution.</p>
+ <div class="graphie" data-update="inequality">
+
+ // Highlight solution space
+ var x_start = -10;
+ var x_end = 10;
+
+ if ( ( NEG_10_INTERCEPT < POS_10_INTERCEPT && !LESS_THAN ) || ( POS_10_INTERCEPT < NEG_10_INTERCEPT && LESS_THAN ) ) {
+ var temp = NEG_10_INTERCEPT;
+ NEG_10_INTERCEPT = POS_10_INTERCEPT;
+ POS_10_INTERCEPT = temp;
+
+ temp = x_start;
+ x_start = x_end;
+ x_end = temp;
+ }
+
+ style( {
+ "fill": "#FF0000",
+ "fill-opacity": 0.1,
+ "stroke": null
+ });
+
+ path([ [ x_end, POS_10_INTERCEPT ], [ x_end, NEG_10_INTERCEPT ], [ x_start, NEG_10_INTERCEPT ] ]);
+
+ var vertical_end = 10;
+ if ( NEG_10_INTERCEPT < POS_10_INTERCEPT ) {
+ vertical_end = -10;
+ }
+ path([ [ -10, NEG_10_INTERCEPT ], [ -10, vertical_end ], [ 10, vertical_end ], [ 10, NEG_10_INTERCEPT ] ]);
+ </div>
+ </div>
+ <div>
+ <p>After plotting the points, we can see that
+ <span data-if="POINT_1_SOLUTION && !POINT_2_SOLUTION"><var>printPoint( POINT_1 )</var> is the only solution</span>
+ <span data-else-if="POINT_2_SOLUTION && !POINT_1_SOLUTION"><var>printPoint( POINT_2 )</var> is the only solution</span>
+ <span data-else-if="POINT_1_SOLUTION && POINT_2_SOLUTION"><var>printPoint( POINT_1 )</var> and<var>printPoint( POINT_2 )</var> are both solutions</span>
+ <span data-else>there are no solutions</span>
+ to the inequality.
+ </p>
+ <div class="graphie" data-update="inequality">
+ style({
+ fill: "#000",
+ "fill-opacity": 1,
+ stroke: "none"
+ });
+
+ circle( POINT_1, 3/20 );
+ circle( POINT_2, 3/20 );
+ label( POINT_1, printPoint( POINT_1 ), "above right" );
+ label( POINT_2, printPoint( POINT_2 ), "above right" );
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
View
2 exercises/graphing_points.html
@@ -69,7 +69,7 @@
</div>
</div>
- <p class="solution"><code>(<var>POINTS[FORGOTTEN].join( ", " )</var>)</code></p>
+ <p class="solution"><code><var>PAIR( POINTS[FORGOTTEN] )</var></code></p>
<ul class="choices" data-category="true">
<li><code><var>PAIR( POINTS[0] )</var></code></li>
<li><code><var>PAIR( POINTS[1] )</var></code></li>
View
10 exercises/inequalities_on_a_number_line.html
@@ -194,19 +194,19 @@
<div class="hints">
<p data-if="LESS_THAN">
- The arrow is pointing to the left of <code><var>INT</var></code>, so everything less than <var>INT</var> is included.
+ The arrow is pointing to the left of <code><var>SIGN + INT</var></code>, so everything less than <code><var>SIGN + INT</var></code> is included.
</p><p data-else>
- The arrow is pointing to the right of <code><var>INT</var></code>, so everything greater than <var>INT</var> is included.
+ The arrow is pointing to the right of <code><var>SIGN + INT</var></code>, so everything greater than <code><var>SIGN + INT</var></code> is included.
</p>
<p data-if="INCLUSIVE">
- The circle is filled in, so <code><var>INT</var></code> itself is also included.
+ The circle is filled in, so <code><var>SIGN + INT</var></code> itself is also included.
</p><p data-else>
- The circle is not filled in, so <code><var>INT</var></code> itself is not included.
+ The circle is not filled in, so <code><var>SIGN + INT</var></code> itself is not included.
</p>
<p>
- <code class="hint_blue"><var>VARIABLE_NAME</var> <var>REL</var> <var>INT</var></code>
+ <code class="hint_blue"><var>VARIABLE_NAME</var> <var>REL</var><var>SIGN + INT</var></code>
</p>
</div>
</div>
View
4 exercises/inverse_trig_functions.html
@@ -62,7 +62,7 @@
}</var>
<var id="DOMAIN">{
- sin: [ "0", DEG ? "180&deg;" : "\\pi" ],
+ sin: [ DEG ? "-90&deg;" : "-\\frac{\\pi}{2}", DEG ? "90&deg;" : "\\frac{\\pi}{2}" ],
cos: [ "0", DEG ? "180&deg;" : "\\pi" ],
tan: [ DEG ? "-90&deg;" : "-\\frac{\\pi}{2}", DEG ? "90&deg;" : "\\frac{\\pi}{2}" ]
}[ FN ]</var>
@@ -72,7 +72,7 @@
<div class="problems">
<div>
<div class="question">
- <p>What is the principle value of <code><var>FN_TEX( PRETTY( X ) )</var></code>?</p>
+ <p>What is the principal value of <code><var>FN_TEX( PRETTY( X ) )</var></code>?</p>
<p>Note: please answer in terms of <span data-if="DEG">degrees (ex: &quot;180 deg&quot; or &quot;180 degrees&quot;)</span><span data-else>radians (ex: &quot;3/4 pi&quot;)</span>.</p>
</div>
View
18 exercises/khan-exercise.html
@@ -33,12 +33,16 @@
<div id="exercise-message-container" style="display: none;">
<div class="exercise_message"></div>
</div>
+<div id="warning-bar">
+ <span id="warning-bar-content"></span>
+ <span id="warning-bar-close">(<a href="">close</a>)</span>
+</div>
<div id="extras" class="single-exercise">
<div id="back-to-dashboard-link" class="single-exercise">
<a href="/exercisedashboard?k" title="Back to Dashboard">&laquo; Back to Dashboard</a>
</div>
<!-- TODO: Toggle scratchpad display -->
- <a id="scratchpad-show" href="">Show scratchpad</a> | <a id="print-ten" href="">Show next 10 problems</a>
+ <a id="scratchpad-show" href="">Show scratchpad</a><span id="scratchpad-not-available">Scratchpad not available</span> | <a id="print-ten" href="">Show next 10 problems</a>
</div>