Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote branch 'upstream/master' into polynomials

  • Loading branch information...
commit f91220cab37b6e59ea5b7d7f376f53451ec4047d 2 parents 906de7f + 790708d
@jeffdyer jeffdyer authored
Showing with 18,326 additions and 1,249 deletions.
  1. +1 −0  .gitignore
  2. +1 −1  README.md
  3. +4,350 −0 build/jshint.js
  4. +4 −0 build/kathjax-config.js
  5. +117 −0 build/pack.rb
  6. 0  css/images/{non-repeating-sprites.1.png → non-repeating-sprites.3.png}
  7. +25 −9 css/khan-exercise.css
  8. +6,398 −1 css/khan-site.css
  9. +2 −2 exercises/absolute_value.html
  10. +1 −1  exercises/absolute_value_equations.html
  11. +2 −2 exercises/adding_and_subtracting_decimals_word_problems.html
  12. +1 −1  exercises/adding_and_subtracting_fractions.html
  13. +1 −1  exercises/adding_and_subtracting_negative_numbers.html
  14. +4 −4 exercises/adding_and_subtracting_polynomials.html
  15. +1 −1  exercises/adding_and_subtracting_radicals.html
  16. +34 −14 exercises/adding_decimals.html
  17. +5 −5 exercises/{adding_decimals_1.html → adding_decimals_0.5.html}
  18. +0 −57 exercises/adding_decimals_2.html
  19. +1 −1  exercises/adding_decimals_3.html
  20. +1 −1  exercises/adding_fractions.html
  21. +1 −1  exercises/adding_fractions_with_common_denominators.html
  22. +1 −1  exercises/adding_negative_numbers.html
  23. +79 −0 exercises/adding_subtracting_mixed_numbers_0.5.html
  24. +3 −3 exercises/adding_subtracting_mixed_numbers_1.html
  25. +1 −1  exercises/adding_vectors.html
  26. +2 −2 exercises/addition_1.html
  27. +1 −1  exercises/addition_2.html
  28. +1 −1  exercises/addition_3.html
  29. +3 −3 exercises/addition_4.html
  30. +32 −32 exercises/addition_rule_of_probability.html
  31. +1 −1  exercises/age_word_problems.html
  32. +1 −1  exercises/algebra_challenge.html
  33. +1 −1  exercises/alternate_exterior_angles.html
  34. +1 −1  exercises/alternate_exterior_angles_2.html
  35. +1 −1  exercises/alternate_interior_angles.html
  36. +1 −1  exercises/alternate_interior_angles_2.html
  37. +2 −2 exercises/angle_bisector_theorem.html
  38. +29 −10 exercises/angle_types.html
  39. +41 −41 exercises/angles_1.html
  40. +36 −36 exercises/angles_2.html
  41. +2 −2 exercises/angles_of_a_polygon.html
  42. +1 −1  exercises/arithmetic_challenge.html
  43. +8 −4 exercises/arithmetic_word_problems.html
  44. +34 −34 exercises/arithmetic_word_problems_1.html
  45. +19 −19 exercises/arithmetic_word_problems_2.html
  46. +1 −1  exercises/average_word_problems.html
  47. +1 −1  exercises/axis_of_symmetry.html
  48. +34 −2 exercises/chain_rule_1.html
  49. +1 −1  exercises/changing_percents_to_fractions.html
  50. +1 −1  exercises/circles_1.html
  51. +3 −3 exercises/circumradius.html
  52. +2 −2 exercises/comparing_absolute_values.html
  53. +3 −3 exercises/comparing_fractions_1.html
  54. +2 −2 exercises/comparing_fractions_2.html
  55. +157 −0 exercises/comparing_improper_fractions_and_mixed_numbers.html
  56. +1 −1  exercises/complementary_and_supplementary_angles.html
  57. +1 −1  exercises/complementary_angles.html
  58. +1 −1  exercises/completing_the_square_1.html
  59. +3 −3 exercises/completing_the_square_2.html
  60. +5 −5 exercises/compound_inequalities.html
  61. +154 −10 exercises/congruency_postulates.html
  62. +3 −3 exercises/congruent_triangles_1.html
  63. +5 −5 exercises/congruent_triangles_2.html
  64. +1 −1  exercises/conic_sections.html
  65. +21 −6 exercises/converting_between_slope_intercept_and_standard_form.html
  66. +14 −24 exercises/converting_fractions_to_decimals.html
  67. +4 −4 exercises/converting_mixed_numbers_and_improper_fractions.html
  68. +2 −2 exercises/converting_repeating_decimals_to_fractions_1.html
  69. +2 −2 exercises/converting_repeating_decimals_to_fractions_2.html
  70. +1 −1  exercises/corresponding_angles.html
  71. +4 −4 exercises/corresponding_angles_2.html
  72. +17 −6 exercises/counting_1.html
  73. +1 −1  exercises/counting_2.html
  74. +141 −0 exercises/creating_bar_charts_1.html
  75. +261 −0 exercises/creating_box_and_whisker_plots.html
  76. +7 −7 exercises/decimals_on_the_number_line.html
  77. +101 −0 exercises/decimals_on_the_number_line_1.html
  78. +108 −0 exercises/decimals_on_the_number_line_2.html
  79. +1 −1  exercises/degrees_to_radians.html
  80. +6 −6 exercises/dependent_probability.html
  81. +11 −11 exercises/derivative_intuition.html
  82. +25 −25 exercises/derivatives_1.html
  83. +1 −1  exercises/determinants_1.html
  84. +1 −1  exercises/direct_and_inverse_variation.html
  85. +237 −0 exercises/distance_between_point_and_line.html
  86. +4 −4 exercises/distance_formula.html
  87. +2 −2 exercises/distributive_property.html
  88. +9 −9 exercises/distributive_property_with_variables.html
  89. +3 −3 exercises/dividing_decimals.html
  90. +1 −1  exercises/dividing_decimals_1.html
  91. +1 −1  exercises/dividing_decimals_2.html
  92. +1 −1  exercises/dividing_fractions.html
  93. +409 −0 exercises/dividing_fractions_word_problems.html
  94. +1 −1  exercises/divisibility.html
  95. +1 −1  exercises/divisibility_0.5.html
  96. +2 −2 exercises/division_0.5.html
  97. +1 −1  exercises/division_1.5.html
  98. +2 −2 exercises/division_1.html
  99. +1 −1  exercises/division_2.html
  100. +1 −1  exercises/division_3.html
  101. +1 −1  exercises/division_4.html
  102. +7 −7 exercises/domain_and_range_0.5.html
  103. +4 −4 exercises/domain_of_a_function.html
  104. +1 −1  exercises/equation_of_a_circle_1.html
  105. +1 −1  exercises/equation_of_a_circle_2.html
  106. +10 −7 exercises/equation_of_a_hyperbola.html
  107. +19 −16 exercises/equation_of_a_line.html
  108. +3 −3 exercises/equation_of_a_parabola.html
  109. +3 −3 exercises/equation_of_an_ellipse.html
  110. +1 −1  exercises/equivalent_fractions.html
  111. +1 −1  exercises/equivalent_fractions_2.html
  112. +13 −11 exercises/estimation_with_decimals.html
  113. +1 −1  exercises/evaluating_expressions_1.html
  114. +1 −1  exercises/evaluating_expressions_2.html
  115. +4 −4 exercises/even_and_odd_functions.html
  116. +1 −3 exercises/even_and_odd_integers.html
  117. +27 −6 exercises/exploring_mean_and_median.html
  118. +135 −0 exercises/exploring_standard_deviation_1.html
  119. +2 −2 exercises/exponent_rules.html
  120. +1 −1  exercises/exponents_1.html
  121. +2 −2 exercises/exponents_2.html
  122. +2 −2 exercises/exponents_3.html
  123. +3 −3 exercises/exponents_4.html
  124. +1 −1  exercises/expressing_ratios_as_fractions.html
  125. +1 −1  exercises/expressions_with_unknown_variables.html
  126. +1 −1  exercises/expressions_with_unknown_variables_2.html
  127. +69 −0 exercises/factor_expressions_by_grouping.html
  128. +44 −163 exercises/fraction_word_problems_1.html
  129. +1 −1  exercises/fractions_cut_and_copy_1.html
  130. +1 −1  exercises/fractions_cut_and_copy_2.html
  131. +4 −4 exercises/fractions_on_the_number_line.html
  132. +84 −0 exercises/fractions_on_the_number_line_1.html
  133. +110 −0 exercises/fractions_on_the_number_line_2.html
  134. +108 −0 exercises/fractions_on_the_number_line_3.html
  135. +11 −9 exercises/functions_1.html
  136. +3 −3 exercises/functions_2.html
  137. +1 −1  exercises/functions_3.html
  138. +1 −2  exercises/geometry_1.html
  139. +3 −3 exercises/graphing_inequalities.html
  140. +11 −11 exercises/graphing_inequalities_2.html
  141. +2 −2 exercises/graphing_linear_equations.html
  142. +1 −1  exercises/graphing_points.html
  143. +1 −1  exercises/graphing_points_2.html
  144. +1 −1  exercises/graphing_systems_of_equations.html
  145. +5 −5 exercises/graphing_systems_of_inequalities.html
  146. +21 −21 exercises/graphing_systems_of_inequalities_2.html
  147. +3 −3 exercises/graphs_of_sine_and_cosine.html
  148. +1 −1  exercises/greatest_common_divisor.html
  149. +1 −1  exercises/herons_formula.html
  150. +4 −4 exercises/inequalities_on_a_number_line.html
  151. +1 −1  exercises/inscribed_angles_1.html
  152. +1 −1  exercises/inscribed_angles_2.html
  153. +1 −1  exercises/inscribed_angles_3.html
  154. +1 −1  exercises/interpreting_linear_equations.html
  155. +6 −7 exercises/inverse_trig_functions.html
  156. +1 −1  exercises/inverses_of_functions.html
  157. +33 −8 exercises/khan-exercise.html
  158. +44 −41 exercises/khan-site.html
  159. +51 −51 exercises/kinematic_equations.html
  160. +1 −1  exercises/least_common_multiple.html
  161. +707 −0 exercises/least_common_multiple_and_greatest_common_divisor_word_problems.html
  162. +4 −4 exercises/lhopitals_rule.html
  163. +1 −1  exercises/limits_1.html
  164. +3 −3 exercises/limits_2.html
  165. +1 −1  exercises/line_graph_intuition.html
  166. +4 −4 exercises/line_relationships.html
  167. +30 −14 exercises/linear_equation_and_inequality_word_problems.html
  168. +7 −3 exercises/linear_equation_word_problems.html
  169. +5 −2 exercises/linear_equations_1.html
  170. +4 −2 exercises/linear_equations_2.html
  171. +4 −2 exercises/linear_equations_3.html
  172. +15 −5 exercises/linear_equations_4.html
  173. +1 −1  exercises/linear_inequalities.html
  174. +1 −1  exercises/logarithms_1.html
  175. +1 −1  exercises/logarithms_2.html
  176. +2 −2 exercises/mean_median_and_mode.html
  177. +20 −14 exercises/measuring_angles.html
  178. +1 −1  exercises/midpoint_formula.html
  179. +2 −2 exercises/multiplication_0.5.html
  180. +1 −1  exercises/multiplication_1.5.html
  181. +2 −2 exercises/multiplication_1.html
  182. +1 −1  exercises/multiplication_2.html
  183. +1 −1  exercises/multiplication_3.html
  184. +1 −1  exercises/multiplication_4.html
  185. +2 −2 exercises/multiplying_and_dividing_negative_numbers.html
  186. +5 −3 exercises/multiplying_decimals.html
  187. +2 −2 exercises/multiplying_expressions_1.html
  188. +6 −6 exercises/multiplying_fractions.html
  189. +38 −0 exercises/multiplying_fractions_0.5.html
  190. +10 −24 exercises/multiplying_fractions_1.html
  191. +428 −0 exercises/multiplying_fractions_word_problems.html
  192. +67 −0 exercises/multiplying_mixed_numbers_1.html
  193. +11 −11 exercises/multiplying_polynomials.html
  194. +1 −1  exercises/multiplying_radicals.html
  195. +2 −2 exercises/negative_number_word_problems.html
  196. +3 −3 exercises/new_definitions_1.html
  197. +4 −4 exercises/new_definitions_2.html
  198. +1 −1  exercises/number_line.html
  199. +1 −1  exercises/number_line_2.html
  200. +2 −2 exercises/number_line_3.html
  201. +168 −0 exercises/number_properties_terminology_1.html
  202. +1 −1  exercises/one_step_equations.html
  203. +1 −1  exercises/one_step_equations_0.5.html
  204. +1 −1  exercises/one_step_inequalities.html
  205. +1 −1  exercises/order_of_operations.html
  206. +1 −1  exercises/ordering_fractions.html
  207. +170 −0 exercises/ordering_improper_fractions_and_mixed_numbers.html
  208. +1 −1  exercises/ordering_negative_numbers.html
  209. +8 −15 exercises/ordering_numbers.html
  210. +1 −1  exercises/parabola_intuition_1.html
  211. +1 −1  exercises/parabola_intuition_2.html
  212. +1 −1  exercises/parabola_intuition_3.html
  213. +1 −2  exercises/parallel_lines_1.html
  214. +1 −2  exercises/parallel_lines_2.html
  215. +4 −4 exercises/percentage_word_problems_1.html
  216. +3 −3 exercises/percentage_word_problems_2.html
  217. +4 −3 exercises/place_value.html
  218. +1 −1  exercises/plugging_in_values.html
  219. +1 −1  exercises/point_slope_form.html
  220. +1 −1  exercises/polygon_intuition.html
  221. +2 −2 exercises/power_rule.html
  222. +1 −1  exercises/pre-algebra_challenge.html
  223. +1 −1  exercises/prime_factorization.html
  224. +1 −1  exercises/prime_numbers.html
  225. +6 −6 exercises/probability_1.html
  226. +1 −1  exercises/product_rule.html
  227. +1 −1  exercises/properties_of_numbers_1.html
  228. +1 −1  exercises/properties_of_numbers_2.html
  229. +1 −1  exercises/pythagorean_theorem_1.html
  230. +1 −1  exercises/pythagorean_theorem_2.html
  231. +6 −6 exercises/quadratic_equation.html
  232. +9 −9 exercises/quadratic_inequalities_1.html
  233. +5 −5 exercises/quadrilateral_angles.html
  234. +1 −1  exercises/quadrilateral_types.html
  235. +1 −1  exercises/quotient_rule.html
  236. +1 −1  exercises/radians_and_degrees.html
  237. +1 −1  exercises/radians_to_degrees.html
  238. +1 −1  exercises/radical_equations.html
  239. +1 −1  exercises/range_of_a_function.html
  240. +1 −1  exercises/rate_problems_0.5.html
  241. +29 −12 exercises/rate_problems_1.html
  242. +7 −9 exercises/rate_problems_2.html
  243. +1 −1  exercises/ratio_word_problems.html
  244. +1 −1  exercises/reading_bar_charts_1.html
  245. +259 −0 exercises/reading_bar_charts_2.html
  246. +383 −0 exercises/reading_bar_charts_3.html
  247. +1 −1  exercises/reading_line_charts_1.html
  248. +128 −0 exercises/reading_pictographs_1.html
  249. +209 −0 exercises/reading_pictographs_2.html
  250. +236 −0 exercises/reading_stem_and_leaf_plots.html
  251. +2 −2 exercises/reading_tables_1.html
  252. +1 −1  exercises/reading_tables_2.html
  253. +1 −1  exercises/recognizing_fractions.html
  254. +1 −1  exercises/recognizing_fractions_0.5.html
  255. +1 −1  exercises/recognizing_percents.html
  256. +116 −0 exercises/representing_numbers.html
  257. +1 −1  exercises/rounding_numbers.html
  258. +2 −2 exercises/rounding_whole_numbers.html
  259. +1 −1  exercises/same_side_exterior_angles.html
  260. +1 −1  exercises/same_side_exterior_angles_2.html
  261. +1 −1  exercises/same_side_interior_angles.html
  262. +1 −1  exercises/same_side_interior_angles_2.html
  263. +13 −13 exercises/scaling_vectors.html
  264. +1 −1  exercises/scientific_notation.html
  265. +3 −3 exercises/shifting_and_reflecting_functions.html
  266. +1 −1  exercises/significant_figures_1.html
  267. +6 −6 exercises/signs_of_a_parabola.html
  268. +1 −1  exercises/similar_triangles_1.html
  269. +115 −0 exercises/simplifying_expressions_with_exponents.html
  270. +3 −3 exercises/simplifying_fractions.html
  271. +1 −1  exercises/simplifying_radicals.html
  272. +4 −4 exercises/slope_of_a_line.html
  273. +1 −1  exercises/solid_geometry.html
  274. +1 −1  exercises/solutions_to_systems_of_equations.html
  275. +4 −2 exercises/solving_for_a_variable.html
  276. +1 −1  exercises/solving_for_the_x-intercept.html
  277. +1 −1  exercises/solving_for_the_y-intercept.html
  278. +1 −1  exercises/solving_quadratics_by_factoring.html
  279. +1 −1  exercises/special_derivatives.html
  280. +1 −1  exercises/squares_and_rectangles.html
  281. +327 −0 exercises/standard_deviation.html
  282. +2 −2 exercises/subtracting_decimals.html
  283. +39 −0 exercises/subtracting_decimals_0.5.html
  284. +1 −1  exercises/subtracting_fractions.html
  285. +1 −1  exercises/subtracting_fractions_with_common_denominators.html
  286. +2 −2 exercises/subtraction_1.html
  287. +1 −1  exercises/subtraction_2.html
  288. +1 −1  exercises/subtraction_3.html
  289. +3 −3 exercises/subtraction_4.html
  290. +1 −1  exercises/supplementary_angles.html
  291. +7 −7 exercises/systems_of_equations.html
  292. +1 −1  exercises/systems_of_equations_with_elimination.html
  293. +1 −1  exercises/systems_of_equations_with_elimination_0.5.html
  294. +1 −1  exercises/systems_of_equations_with_substitution.html
  295. +296 −0 exercises/systems_of_equations_word_problems.html
  296. +6 −6 exercises/telling_time.html
  297. +6 −7 exercises/telling_time_0.5.html
  298. +351 −0 exercises/telling_time_2.html
  299. +8 −5 exercises/triangle_angles_1.html
  300. +1 −1  exercises/triangle_inequality_theorem.html
Sorry, we could not display the entire diff because too many files (342) changed.
View
1  .gitignore
@@ -0,0 +1 @@
+exercises-packed
View
2  README.md
@@ -1,6 +1,6 @@
# Khan Academy Exercises
-Copyright 2011 Khan Academy
+Copyright 2012 Khan Academy
The exercise framework is [MIT licensed](http://en.wikipedia.org/wiki/MIT_License).
View
4,350 build/jshint.js
4,350 additions, 0 deletions not shown
View
4 build/kathjax-config.js
@@ -19,6 +19,7 @@ MathJax.Hub.Config({
Definitions: {
macros: {
lrsplit: "LRSplit",
+ cancel: "Cancel",
lcm: ["NamedOp", 0]
}
},
@@ -33,6 +34,9 @@ MathJax.Hub.Config({
frac.denomalign = MathJax.ElementJax.mml.ALIGN.RIGHT;
frac.linethickness = "0em";
this.Push( frac );
+ },
+ Cancel: function( name ) {
+ this.Push( MathJax.ElementJax.mml.menclose( this.ParseArg( name ) ).With({ notation: MathJax.ElementJax.mml.NOTATION.UPDIAGONALSTRIKE }) );
}
}
}
View
117 build/pack.rb
@@ -0,0 +1,117 @@
+begin
+ require 'rubygems'
+ require 'nokogiri'
+ require 'execjs'
+ require 'uglifier'
+ require 'fileutils'
+rescue LoadError
+ puts
+ puts "-" * 78
+ puts "Oops! Some gems are missing; please run:"
+ puts " sudo gem install nokogiri uglifier therubyracer"
+ puts "-" * 78
+ puts
+ exit 1
+end
+
+begin
+ require 'v8'
+rescue LoadError
+ puts
+ puts "-" * 78
+ puts "Warning! You don't have therubyracer installed, packing might be slow. Try:"
+ puts " sudo gem install therubyracer"
+ puts
+ puts "If you prefer another JS runtime (https://github.com/sstephenson/execjs),"
+ puts "be aware that this script is much faster (around 50x speedup) using"
+ puts "therubyracer, which is based on Chrome's V8 engine."
+ puts "-" * 78
+ puts
+end
+
+JSHINT_ENABLED = false
+JSHINT_OPTIONS = {
+ :laxbreak => true,
+ :eqeqeq => true,
+ :loopfunc => true,
+}
+
+def jshint(js)
+ return unless JSHINT_ENABLED
+ if !@jshint.call("JSHINT", js, JSHINT_OPTIONS)
+ @jshint.eval("JSHINT.errors").each do |err|
+ break if err["reason"] == "Expected ')' to match '(' from line 1 and instead saw ','."
+ # puts "-- #{js}"
+ puts "-- #{err["reason"]} (#{err["line"]}:#{err["character"]})"
+ puts "-- > #{(err["evidence"] || "").strip}"
+ puts "--"
+ end
+ end
+end
+
+# All paths are relative to khan-exercises/ root
+Dir.chdir(File.join(File.dirname(__FILE__), ".."))
+
+@uglifier = Uglifier.new(:copyright => false) # Discard all comments
+@jshint = ExecJS.compile(File.read("build/jshint.js"))
+
+FileUtils.mkdir_p("exercises-packed")
+
+Dir["exercises/*.html"].each do |filename|
+ packed_filename = filename.gsub(/^exercises\//, "exercises-packed/")
+ next if File.exist?(packed_filename) && File.mtime(packed_filename) > File.mtime(filename)
+
+ puts filename
+ cant = 0
+ doc = Nokogiri::HTML::Document.parse(File.read(filename))
+
+ doc.css("var").each do |var|
+ if var.elements.any?
+ puts "-- error: JS element has children"
+ puts var.inner_html
+ exit 1
+ end
+
+ next if var.content !~ /\S/ # only whitespace
+
+ jshint("return (#{var.content});")
+ exp = "(#{var.content})"
+ var.content = @uglifier.compile(exp)
+ end
+
+ doc.css(".graphie", "div.guess", "div.show-guess", "div.show-guess-solutionarea").each do |graphie|
+ if graphie.elements.any?
+ puts "-- error: JS element has children"
+ exit 1
+ end
+
+ js = graphie.content
+ graphie.content = @uglifier.compile(js)
+ end
+
+ doc.css("div.validator-function").each do |validator|
+ if validator.elements.any?
+ puts "-- error: JS element has children"
+ exit 1
+ end
+
+ # need to wrap validator-function content in a function, so uglifier
+ # doesn't get confused by the estranged 'return' statement
+ js = "(function(){" + validator.content + "})()"
+ uglified = @uglifier.compile(js)
+ # strip out the anonymous function wrapper to put things back the way they were
+ validator.content = uglified[ /^\(function\(\)\{(.*)\}\)\(\)$/, 1 ]
+ end
+
+ %w[data-ensure data-if data-else-if].each do |data_attr|
+ doc.css("[#{data_attr}]").each do |el|
+ jshint("return (#{el[data_attr]});")
+ js = el[data_attr]
+ el[data_attr] = @uglifier.compile(js)
+ end
+ end
+
+ File.open(packed_filename, "w") do |f|
+ f.write doc.to_html
+ end
+end
View
0  css/images/non-repeating-sprites.1.png → css/images/non-repeating-sprites.3.png
File renamed without changes
View
34 css/khan-exercise.css
@@ -13,6 +13,10 @@ var { font-style: normal; }
#answer_area ul { list-style: none; }
#answer_area li { margin: 14px 0; }
+#extras li { display: inline; }
+#extras li:before { content: "| "; }
+#extras li:first-child:before { content: ""; }
+
#answer_area #check-answer-results { overflow: hidden; margin: 5px 0; }
#answer_area #check-answer-results .check-answer-message { font-size: 12px; line-height: 20px; margin: 0; }
#sad, #happy { float: left; margin: 0 6px 4px 0; }
@@ -112,7 +116,7 @@ var, div.graphie { white-space: pre; }
}
.user-activity {
- margin: 5px;
+ margin: 8px;
padding: 2px 5px;
border: 1px solid #999;
border-radius: 4px;
@@ -120,7 +124,6 @@ var, div.graphie { white-space: pre; }
-moz-border-radius: 4px;
float: left;
cursor: pointer;
- /*height: 25px;*/
color: white;
}
@@ -307,11 +310,9 @@ div.timeline-total {
}
#warning-bar {
- background: red;
width: 100%;
height: 35px;
text-align: center;
- color: #eee;
font-size: 15px;
display: none;
}
@@ -328,15 +329,28 @@ div.timeline-total {
position: relative;
}
-#warning-bar a {
- color: #eee;
-}
-
#warning-bar-content a {
- color: #eee;
text-decoration: underline;
}
+#warning-bar.error {
+ background-color: red;
+ color: #eee;
+}
+
+#warning-bar.error a {
+ color: #eee;
+}
+
+#warning-bar.warning {
+ background-color: #f5e722;
+ color: #222;
+}
+
+#warning-bar.warning a {
+ color: #222;
+}
+
/* Faux table styles that allow revealing data row by row in hints */
.fake_header > span {
@@ -431,6 +445,8 @@ div.timeline-total {
border: 1px solid #ccc;
border-bottom: 1px solid #aaa;
padding: 13px;
+ position: relative;
+ z-index: 2;
box-shadow: 0 1px 2px #ccc;
-moz-box-shadow: 0 1px 2px #ccc;
View
6,399 css/khan-site.css
6,398 additions, 1 deletion not shown
View
4 exercises/absolute_value.html
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Absolute value</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
- <div class="vars" data-ensure="SIGN == &quot;&quot; || INT != 0 || FRAC != 0">
+ <div class="vars" data-ensure="SIGN === &quot;&quot; || INT !== 0 || FRAC !== 0">
<var id="INT">rand(5) > 0 ? randRange( 1, 9 ) : 0</var>
<var id="FRAC">rand(3) > 0 ? "." + randRange(1, 9) : ""</var>
<var id="SIGN">randFromArray(["", "-"])</var>
View
2  exercises/absolute_value_equations.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math math-format">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Absolute value equations</title>
<script src="../khan-exercise.js"></script>
</head>
View
4 exercises/adding_and_subtracting_decimals_word_problems.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math word-problems spin graphie graphie-helpers-arithmetic">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adding and subtracting decimals word problems</title>
<script src="../khan-exercise.js"></script>
</head>
@@ -33,7 +33,7 @@
<p class="question">How much did <var>person(1)</var> need to pay for <var>his(1)</var> produce?</p></div>
- <div class="solution"><var>fruit_1+fruit_2</var></div>
+ <div class="solution" data-forms="dollar"><var>fruit_1+fruit_2</var></div>
<div class="hints">
<p>To find the total amount <var>person(1)</var> needs to pay, we need to add the price of the <var>plural(fruit(1))</var> and the price of the <var>plural(fruit(2))</var>.</p>
View
2  exercises/adding_and_subtracting_fractions.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math math-format">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adding and subtracting fractions</title>
<script src="../khan-exercise.js"></script>
</head>
View
2  exercises/adding_and_subtracting_negative_numbers.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adding and subtracting negative numbers</title>
<script src="../khan-exercise.js"></script>
</head>
View
8 exercises/adding_and_subtracting_polynomials.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math math-format polynomials functional">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adding and subtracting polynomials</title>
<script src="../khan-exercise.js"></script>
<script type="text/javascript">
@@ -42,9 +42,9 @@
<var id="NON_ZERO_INDICES">randRangeUniqueNonZero( 0, MAX_DEGREE, randRange(2, 3) ).sort().reverse()</var>
<var id="POL_1, POL_2" data-ensure="POL_1.add( POL_2 ).getNumberOfTerms() >= 1 && POL_1.subtract( POL_2 ).getNumberOfTerms() >= 1">tabulate( function() {
var coefs = [];
- for ( var i = 0; i <= MAX_DEGREE; i++ ) {
+ for ( var i = 0; i &lt;= MAX_DEGREE; i++ ) {
var value = 0;
- for ( var j = 0; j < NON_ZERO_INDICES.length; j++ ) {
+ for ( var j = 0; j &lt; NON_ZERO_INDICES.length; j++ ) {
if ( i === NON_ZERO_INDICES[ j ] ) {
value = randRangeNonZero( -7, 7 );
break;
@@ -103,7 +103,7 @@
</div>
<div>
<p>Identify like terms.</p>
- <p><code><span data-each="[ POL_1, POL_2 ] as POL"><span data-each="NON_ZERO_INDICES as n, index" data-unwrap><var>( POL.coefs[ index ] < 0 ) ? "-" : ( n === 0 && POL === POL_1 ) ? "" : "+"</var>\color{<var>COLORS[ n ]</var>}{<var>abs( POL.coefs[ index ] ) === 1 ? "" : abs( POL.coefs[ index ] )</var><var>X</var>^<var>index</var>}</span></span></code></p>
+ <p><code><span data-each="[ POL_1, POL_2 ] as POL"><span data-each="NON_ZERO_INDICES as n, index" data-unwrap><var>( POL.coefs[ index ] &lt; 0 ) ? "-" : ( n === 0 && POL === POL_1 ) ? "" : "+"</var>\color{<var>COLORS[ n ]</var>}{<var>abs( POL.coefs[ index ] ) === 1 ? "" : abs( POL.coefs[ index ] )</var><var>X</var>^<var>index</var>}</span></span></code></p>
</div>
<div>
View
2  exercises/adding_and_subtracting_radicals.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math math-format expressions">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adding and subtracting radicals</title>
<script src="../khan-exercise.js"></script>
</head>
View
48 exercises/adding_decimals.html
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers-arithmetic">
<head>
- <meta charset="UTF-8" />
- <title>Adding decimals</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Adding decimals 2</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
@@ -10,27 +10,47 @@
<div class="vars">
<var id="A">randRange( 100, 999 )</var>
<var id="B">randRange( 100, 999 )</var>
-
- <var id="A_DECIMAL">randRange( 1, 3 )</var>
- <var id="B_DECIMAL">randRange( 1, 3 )</var>
-
- <var id="A_FLOAT">A / pow( 10, A_DECIMAL )</var>
- <var id="B_FLOAT">B / pow( 10, B_DECIMAL )</var>
+ <div data-ensure="B_DECIMAL !== A_DECIMAL">
+ <var id="A_DECIMAL">randRangeWeighted( 0, 3, 0, 0.1 )</var>
+ <var id="B_DECIMAL">randRange( 1, 3 )</var>
+ </div>
+ <var id="NEW_A">A * ( B_DECIMAL &gt; A_DECIMAL ? pow( 10, B_DECIMAL - A_DECIMAL ) : 1)</var>
+ <var id="NEW_B">B * ( A_DECIMAL &gt; B_DECIMAL ? pow( 10, A_DECIMAL - B_DECIMAL ) : 1)</var>
+ <var id="A_DIGITS">
+ (function() {
+ var result = digits( NEW_A );
+ for ( var i = 0; i &lt; ( A_DECIMAL - B_DECIMAL ) || result.length &lt; A_DECIMAL + 1; i++ ) {
+ result.push( 0 );
+ }
+ return result;
+ })()</var>
+ <var id="B_DIGITS">
+ (function() {
+ var result = digits( NEW_B );
+ for ( var i = 0; i &lt; ( B_DECIMAL - A_DECIMAL ) || result.length &lt; B_DECIMAL + 1; i++ ) {
+ result.push( 0 );
+ }
+ return result;
+ })()</var>
+ <var id="DUMMY">[]</var>
</div>
<div class="problems">
<div>
- <p class="question"><code>\Huge{<var>A_FLOAT.toFixed( A_DECIMAL )</var> + <var>B_FLOAT.toFixed( B_DECIMAL )</var> = {?}}</code></p>
- <div class="solution" data-type="decimal"><var>A_FLOAT + B_FLOAT</var></div>
+ <p class="question"><code>\Huge{<var>roundTo( A_DECIMAL, A * pow( 10, -A_DECIMAL ) ).toFixed( A_DECIMAL )</var> + <var>roundTo( B_DECIMAL, B * pow( 10, -B_DECIMAL ) ).toFixed( B_DECIMAL )</var> = {?}}</code></p>
+ <p class="solution" data-type="decimal"><var>A / pow( 10, A_DECIMAL ) + B / pow( 10, B_DECIMAL )</var></p>
+ <div class="graphie" id="numbers">
+ graph.adder = new Adder( NEW_A, NEW_B, A_DIGITS, B_DIGITS );
+ DUMMY = Array( graph.adder.getNumHints() );
+ </div>
</div>
</div>
<div class="hints">
- <div class="graphie" id="numbers">
- graph.adder = new DecimalAdder( A, A_DECIMAL, B, B_DECIMAL );
+ <div class="graphie" data-update="numbers">
graph.adder.show();
- graph.adder.showDecimals();
+ graph.adder.showDecimals( A_DECIMAL, B_DECIMAL );
</div>
- <div class="graphie" data-update="numbers" data-each="DecimalAdder.numHintsFor( A, A_DECIMAL, B, B_DECIMAL ) times">
+ <div class="graphie" data-update="numbers" data-each="DUMMY as dummy">
graph.adder.showHint();
</div>
</div>
View
10 exercises/adding_decimals_1.html → exercises/adding_decimals_0.5.html
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers-arithmetic">
<head>
- <meta charset="UTF-8" />
- <title>Adding decimals 1</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Adding decimals 0.5</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
@@ -10,8 +10,8 @@
<div class="vars">
<var id="A">randRange( 100, 999 )</var>
<var id="B">randRange( 100, 999 )</var>
- <var id="A_DECIMAL">0</var>
- <var id="B_DECIMAL">randRange( 1, 2 )</var>
+ <var id="A_DECIMAL">randRange( 1, 2 )</var>
+ <var id="B_DECIMAL">A_DECIMAL</var>
<var id="NEW_A">A * ( B_DECIMAL &gt; A_DECIMAL ? pow( 10, B_DECIMAL - A_DECIMAL ) : 1)</var>
<var id="NEW_B">B * ( A_DECIMAL &gt; B_DECIMAL ? pow( 10, A_DECIMAL - B_DECIMAL ) : 1)</var>
<var id="A_DIGITS">
@@ -36,7 +36,7 @@
<div class="problems">
<div>
<p class="question"><code>\Huge{<var>roundTo( A_DECIMAL, A * pow( 10, -A_DECIMAL ) ).toFixed( A_DECIMAL )</var> + <var>roundTo( B_DECIMAL, B * pow( 10, -B_DECIMAL ) ).toFixed( B_DECIMAL )</var> = {?}}</code></p>
- <div class="solution" data-type="decimal"><var>A / pow( 10, A_DECIMAL ) + B / pow( 10, B_DECIMAL )</var></div>
+ <p class="solution" data-type="decimal"><var>A / pow( 10, A_DECIMAL ) + B / pow( 10, B_DECIMAL )</var></p>
<div class="graphie" id="numbers">
graph.adder = new Adder( NEW_A, NEW_B, A_DIGITS, B_DIGITS );
DUMMY = Array( graph.adder.getNumHints() );
View
57 exercises/adding_decimals_2.html
@@ -1,57 +0,0 @@
-<!DOCTYPE html>
-<html data-require="math graphie graphie-helpers-arithmetic">
-<head>
- <meta charset="UTF-8" />
- <title>Adding decimals 2</title>
- <script src="../khan-exercise.js"></script>
-</head>
-<body>
- <div class="exercise">
- <div class="vars">
- <var id="A">randRange( 100, 999 )</var>
- <var id="B">randRange( 100, 999 )</var>
- <var id="A_DECIMAL">randRange( 1, 3 )</var>
- <var id="B_DECIMAL" data-ensure="B_DECIMAL===A_DECIMAL">randRange( 1, 3 )</var>
- <var id="NEW_A">A * ( B_DECIMAL &gt; A_DECIMAL ? pow( 10, B_DECIMAL - A_DECIMAL ) : 1)</var>
- <var id="NEW_B">B * ( A_DECIMAL &gt; B_DECIMAL ? pow( 10, A_DECIMAL - B_DECIMAL ) : 1)</var>
- <var id="A_DIGITS">
- (function() {
- var result = digits( NEW_A );
- for ( var i = 0; i &lt; ( A_DECIMAL - B_DECIMAL ) || result.length &lt; A_DECIMAL + 1; i++ ) {
- result.push( 0 );
- }
- return result;
- })()</var>
- <var id="B_DIGITS">
- (function() {
- var result = digits( NEW_B );
- for ( var i = 0; i &lt; ( B_DECIMAL - A_DECIMAL ) || result.length &lt; B_DECIMAL + 1; i++ ) {
- result.push( 0 );
- }
- return result;
- })()</var>
- <var id="DUMMY">[]</var>
- </div>
-
- <div class="problems">
- <div>
- <p class="question"><code>\Huge{<var>roundTo( A_DECIMAL, A * pow( 10, -A_DECIMAL ) ).toFixed( A_DECIMAL )</var> + <var>roundTo( B_DECIMAL, B * pow( 10, -B_DECIMAL ) ).toFixed( B_DECIMAL )</var> = {?}}</code></p>
- <div class="solution" data-type="decimal"><var>A / pow( 10, A_DECIMAL ) + B / pow( 10, B_DECIMAL )</var></div>
- <div class="graphie" id="numbers">
- graph.adder = new Adder( NEW_A, NEW_B, A_DIGITS, B_DIGITS );
- DUMMY = Array( graph.adder.getNumHints() );
- </div>
- </div>
- </div>
- <div class="hints">
- <div class="graphie" data-update="numbers">
- graph.adder.show();
- graph.adder.showDecimals( A_DECIMAL, B_DECIMAL );
- </div>
- <div class="graphie" data-update="numbers" data-each="DUMMY as dummy">
- graph.adder.showHint();
- </div>
- </div>
- </div>
-</body>
-</html>
View
2  exercises/adding_decimals_3.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers-arithmetic">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adding decimals 3</title>
<script src="../khan-exercise.js"></script>
</head>
View
2  exercises/adding_fractions.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math math-format">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adding fractions</title>
<script src="../khan-exercise.js"></script>
</head>
View
2  exercises/adding_fractions_with_common_denominators.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math math-format graphie graphie-helpers">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adding fractions with common denominators</title>
<script src="../khan-exercise.js"></script>
</head>
View
2  exercises/adding_negative_numbers.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adding negative numbers</title>
<script src="../khan-exercise.js"></script>
</head>
View
79 exercises/adding_subtracting_mixed_numbers_0.5.html
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<html data-require="math math-format">
+<head>
+ <title>Adding and subtracting mixed numbers with like denominators</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+
+<body>
+<div class="exercise">
+
+ <div class="problems">
+ <div id="two-numbers">
+ <div class="vars">
+ <var id="PM">randRangeNonZero( -1, 1 )</var>
+ <var id="SIGN">( PM === 1 ? "+" : "-")</var>
+ <var id="W1">randRange( 2, 19 )</var>
+ <var id="W2">( PM === 1 ? randRange( 1, 19 ) : randRange( -W1 + 1, -1 ))</var>
+
+ <div data-ensure="getLCM( D1, D2 ) < 61 && D1 === D2">
+ <var id="D1">randRange( 3, 20 )</var>
+ <var id="D2">randRange( 3, 20 )</var>
+ </div>
+ <div data-ensure="( PM === 1 ? (N1 / D1) + (N2 / D2) < 1 : (N1 / D1) + PM * (N2 / D2) > 0)">
+ <var id="N1">randRange( 1, D1 - 1 )</var>
+ <var id="N2">randRange( 1, D2 - 1 )</var>
+ </div>
+
+ <var id="GCD1">getGCD( N1, D1 )</var>
+ <var id="SIMP_N1">N1 / GCD1</var>
+ <var id="SIMP_D1">D1 / GCD1</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>
+ <var id="GCD">getGCD( SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2 , LCM )</var>
+ </div>
+
+ <p class="problem">Express your answer as a mixed number simplified to lowest terms.</p>
+ <p class="question"><code><var>expr(["+", W1 + fraction( N1, D1 ), W2 + fraction( N2, D2 )])</var> = {?}</code></p>
+ <div class="solution" data-type="mixed"><var>W1 + W2 + N1 / D1 + PM * N2 / D2</var></div>
+
+ <div class="hints">
+ <div>
+ <p>Separate the whole numbers from the fractional parts:</p>
+ <p><code>= \color{red}{<var>W1</var>} + \color{red}{<var>fraction( N1, D1 )</var>} <var>SIGN</var> \color{blue}{<var>abs( W2 )</var>} <var>SIGN</var> \color{blue}{<var>fraction( N2, D2 )</var>}</code></p>
+ </div>
+
+ <div>
+ <p>Bring the whole numbers together and the fractions together:</p>
+ <p><code>= \color{red}{<var>W1</var>} <var>SIGN</var> \color{blue}{<var>abs( W2 )</var>} + \color{red}{<var>fraction( N1, D1 )</var>} <var>SIGN</var> \color{blue}{<var>fraction( N2, D2 )</var>}</code></p>
+ </div>
+
+ <div>
+ <p><span data-if="PM === 1">Add</span><span data-else>Subtract</span> the whole numbers:</p>
+ <p><code>=<var>W1 + W2</var> + \color{red}{<var>fraction( N1, D1 )</var>} <var>SIGN</var> \color{blue}{<var>fraction( N2, D2 )</var>}</code></p>
+ </div>
+
+ <div>
+ <p><span data-if="PM === 1">Add</span><span data-else>Subtract</span> the fractions:</p>
+ <p><code>= <var>expr(["+", W1 + W2, fraction( N1 + PM * N2, D2 )])</var></code></p>
+ </div>
+
+ <div>
+ <p>Combine the whole and fractional parts into a mixed number:</p>
+ <p><code>= <var>W1 + W2 + fraction( SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2, LCM )</var></code></p>
+ </div>
+
+ <div data-if="GCD > 1">
+ <p>Simplify to lowest terms:</p>
+ <p><code>= <var>W1 + W2 + fractionReduce( SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2, LCM )</var></code></p>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+</body>
+</html>
View
6 exercises/adding_subtracting_mixed_numbers_1.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math math-format">
<head>
- <title>Adding and subtracting mixed numbers 1</title>
+ <title>Adding and subtracting mixed numbers with unlike denominators</title>
<script src="../khan-exercise.js"></script>
</head>
@@ -54,12 +54,12 @@
<div>
<p><span data-if="PM === 1">Add</span><span data-else>Subtract</span> the whole numbers:</p>
- <p><code>=<var>W1 + W2</var> + \color{red}{<var>fraction( SIMP_N1, SIMP_D1 )</var>} <var>SIGN</var> \color{blue}{<var>fraction( SIMP_N2, SIMP_D2 )</var>}</code></p>
+ <p><code>=<var>W1 + W2</var> + \color{red}{<var>fraction( N1, D1 )</var>} <var>SIGN</var> \color{blue}{<var>fraction( N2, D2 )</var>}</code></p>
</div>
<div data-if="GCD1 !== 1 || GCD2 !== 1">
<p>Simplify each fraction:</p>
- <p><code>= \color{red}{<var>W1</var>} <var>SIGN</var> \color{blue}{<var>abs( W2 )</var>} + \color{red}{<var>fraction( SIMP_N1, SIMP_D1 )</var>} <var>SIGN</var> \color{blue}{<var>fraction( SIMP_N2, SIMP_D2 )</var>}</code></p>
+ <p><code>= <var>W1+W2</var> + \color{red}{<var>fraction( SIMP_N1, SIMP_D1 )</var>} <var>SIGN</var> \color{blue}{<var>fraction( SIMP_N2, SIMP_D2 )</var>}</code></p>
</div>
<div>
View
2  exercises/adding_vectors.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math math-format graphie">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adding vectors</title>
<script src="../khan-exercise.js"></script>
</head>
View
4 exercises/addition_1.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers-arithmetic word-problems">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Addition 1</title>
<script src="../khan-exercise.js"></script>
</head>
@@ -21,7 +21,7 @@
});
label( [0, 0],
- "\\Huge{\\color{#6495ED}{ <var>A</var> } + \\color{#28AE7B}{ <var>B</var> } = {?}}",
+ "\\Huge{\\color{#6495ED}{" + A + "} + \\color{#28AE7B}{" + B + "} = {?}}",
"right" );
</div>
</div>
View
2  exercises/addition_2.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers-arithmetic">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Addition 2</title>
<script src="../khan-exercise.js"></script>
</head>
View
2  exercises/addition_3.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers-arithmetic">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Addition 3</title>
<script src="../khan-exercise.js"></script>
</head>
View
6 exercises/addition_4.html
@@ -1,18 +1,18 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers-arithmetic">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Addition 4</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
- <var id="A_1000">randRangeWeighted( 0, 9, 0, .25 )*1000</var>
+ <var id="A_1000">randRangeWeighted( 0, 9, 0, 0.25 )*1000</var>
<var id="A_100">randRange( 0, 9 )*100</var>
<var id="A_10">randRange( 0, 9 )*10</var>
<var id="A_1">randRange ( 0, 9 )*1</var>
- <var id="B_1000" data-ensure="B_1000<=A_1000">randRangeWeighted( 0, 9, 0, .25 )*1000</var>
+ <var id="B_1000" data-ensure="B_1000<=A_1000">randRangeWeighted( 0, 9, 0, 0.25 )*1000</var>
<var id="B_100">randRange( 0, 9 )*100</var>
<var id="B_10">randRange( 0, 9 )*10</var>
<var id="B_1">randRange ( 0, 9 )*1</var>
View
64 exercises/addition_rule_of_probability.html
@@ -1,15 +1,15 @@
<!DOCTYPE html>
<html data-require="math math-format probability word-problems stat">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Addition rule of probability</title>
<script src="../khan-exercise.js"></script>
<script type="text/javascript">
function enFunc(innerString, usePercentages) {
- if (usePercentages)
- return "<code>P(</code>" + innerString + "<code>)</code>";
+ if (usePercentages)
+ return "<code>P(</code>" + innerString + "<code>)</code>";
else
- return "<code>\\lvert</code>" + innerString + "<code>\\rvert</code>";
+ return "<code>\\lvert</code>" + innerString + "<code>\\rvert</code>";
}
</script>
</head>
@@ -35,39 +35,39 @@
["In a sample of patients, ", CHOOSE_ATTRIBUTES( ["male", "female"], ["colorblind", "overweight", "underweight", "over sixty", "healthy", "under eighteen", "healthy"] ), "What percentage of the patients are ", "?", true],
["Of the houses in a town, ", CHOOSE_ATTRIBUTES( ["white", "blue", "light green", "solar powered", "near a park"], ["air conditioned", "wooden", "stucco"] ), "What percentage of the houses are ", "?", true],
["A census was recently taken in a certain community, and the results include the following facts about the residents: ", CHOOSE_ATTRIBUTES( ["Hispanic", "Asian", "White", "Black"], ["male", "female", "under 18", "over 65"] ), "What percentage of the residents are ", "?", true],
- ["A car dealer advertises statistics desribing her inventory. Of the cars on her lot, the advertisement states ", CHOOSE_ATTRIBUTES( ["white", "blue", "light green", "red", "grey", "black"], ["trucks", "minivans", "SUVs", "sports cars", "sedans"] ), "What percentage of the cars are ", "?", true],
+ ["A car dealer advertises statistics desribing her inventory. Of the cars on her lot, the advertisement states ", CHOOSE_ATTRIBUTES( ["white", "blue", "light green", "red", "grey", "black"], ["trucks", "minivans", "SUVs", "sports cars", "sedans"] ), "What percentage of the cars are ", "?", true]
])
</var>
- <!-- Randomize the order the variables (X, Y, X_OR_Y, X_AND_Y) are written in the question -->
- <var id="ORDER">shuffle( [0, 1, 2, 3] )</var>
- <!-- Assign values to each variable, subject to constraints so all counts are > 1 and no counts are negative -->
- <var id="VARVALS">
- ( function( usePercentages ) {
- var rangemin = usePercentages ? 1 : 2;
- var rangemax = usePercentages ? 100 : 10;
- var vals = [0, 0, 0, 0];
- vals[VARINDX_X] = randRange( rangemin, rangemax );
- vals[VARINDX_Y] = randRange( rangemin, rangemax );
- vals[VARINDX_X_AND_Y] = randRange( max( rangemin, vals[VARINDX_X]+vals[VARINDX_Y]-100 ), min( vals[VARINDX_X], vals[VARINDX_Y] ) );
- vals[VARINDX_X_OR_Y] = vals[VARINDX_X] + vals[VARINDX_Y] - vals[VARINDX_X_AND_Y];
- return vals;
- } )( USEPERCENTAGES )
- </var>
- <var id="QUESTIONTEXT">
- ( function() {
+ <!-- Randomize the order the variables (X, Y, X_OR_Y, X_AND_Y) are written in the question -->
+ <var id="ORDER">shuffle( [0, 1, 2, 3] )</var>
+ <!-- Assign values to each variable, subject to constraints so all counts are > 1 and no counts are negative -->
+ <var id="VARVALS">
+ ( function( usePercentages ) {
+ var rangemin = usePercentages ? 1 : 2;
+ var rangemax = usePercentages ? 100 : 10;
+ var vals = [0, 0, 0, 0];
+ vals[VARINDX_X] = randRange( rangemin, rangemax );
+ vals[VARINDX_Y] = randRange( rangemin, rangemax );
+ vals[VARINDX_X_AND_Y] = randRange( max( rangemin, vals[VARINDX_X]+vals[VARINDX_Y]-100 ), min( vals[VARINDX_X], vals[VARINDX_Y] ) );
+ vals[VARINDX_X_OR_Y] = vals[VARINDX_X] + vals[VARINDX_Y] - vals[VARINDX_X_AND_Y];
+ return vals;
+ } )( USEPERCENTAGES )
+ </var>
+ <var id="QUESTIONTEXT">
+ ( function() {
var optionalPercentage = USEPERCENTAGES ? "% are " : " ";
- var qstn = INTRO;
- for (var i=0; i< ORDER.length-1; i++) {
+ var qstn = INTRO;
+ for (var i=0; i &lt; ORDER.length-1; i++) {
qstn += (i===ORDER.length-2) ? " and " : "";
qstn += VARVALS[ORDER[i]] + optionalPercentage + VARDESC[ORDER[i]];
- qstn += (i< ORDER.length-2) ? ", " : ". ";
- }
- qstn += QSTNPRETEXT + VARDESC[ORDER[ORDER.length-1]] + QSTNPOSTTEXT;
- return qstn;
- } )()
- </var>
- <!-- this just passes the call to plain JS to avoid problems with unescaped HTML in the function body, while still giving access to vars -->
- <var id="ENFUNC"> function (innerString) { return enFunc(innerString, USEPERCENTAGES); } </var>
+ qstn += (i &lt; ORDER.length-2) ? ", " : ". ";
+ }
+ qstn += QSTNPRETEXT + VARDESC[ORDER[ORDER.length-1]] + QSTNPOSTTEXT;
+ return qstn;
+ } )()
+ </var>
+ <!-- this just passes the call to plain JS to avoid problems with unescaped HTML in the function body, while still giving access to vars -->
+ <var id="ENFUNC"> function (innerString) { return enFunc(innerString, USEPERCENTAGES); } </var>
</div>
<div class="question"><p><var>QUESTIONTEXT</var></p></div>
View
2  exercises/age_word_problems.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math math-format word-problems spin">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Age word problems</title>
<script src="../khan-exercise.js"></script>
</head>
View
2  exercises/algebra_challenge.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Algebra challenge</title>
<script src="../khan-exercise.js"></script>
</head>
View
2  exercises/alternate_exterior_angles.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers angles">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Alternate exterior angles</title>
<script src="../khan-exercise.js"></script>
</head>
View
2  exercises/alternate_exterior_angles_2.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers angles">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Alternate exterior angles 2</title>
<script src="../khan-exercise.js"></script>
</head>
View
2  exercises/alternate_interior_angles.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers angles">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Alternate interior angles</title>
<script src="../khan-exercise.js"></script>
</head>
View
2  exercises/alternate_interior_angles_2.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers angles">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Alternate interior angles 2</title>
<script src="../khan-exercise.js"></script>
</head>
View
4 exercises/angle_bisector_theorem.html
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers graphie-geometry math-format">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Angle Bisector Theorem</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
- <var id="ANGLES" data-ensure="ANGLES[ 0 ] % 2 == 0">randomTriangleAngles.triangle()</var>
+ <var id="ANGLES" data-ensure="ANGLES[ 0 ] % 2 === 0">randomTriangleAngles.triangle()</var>
<var id="SIDES_B">[ [ 0, 1 ], [] ]</var>
<var id="SIDES_C">[ [ 1 ], [ 2] ]</var>
<var id="TR_A">
View
39 exercises/angle_types.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
-<html data-require="math graphie graphie-helpers">
+<html data-require="math graphie angles interactive">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Angle types</title>
<script src="../khan-exercise.js"></script>
<script>
@@ -42,8 +42,8 @@
<!-- somewhat verbose, but draws a right angle symbol or arc based on angle -->
DIFF == 90 ? path([ [1 * cos( ANGLE_ONE_R ), 1 * sin( ANGLE_ONE_R )], [sqrt(2) * cos( ANGLE_ONE_R + PI / 4 ), sqrt(2) * sin( ANGLE_ONE_R + PI / 4)], [1 * cos( ANGLE_TWO_R ), 1 * sin( ANGLE_TWO_R )] ]) : arc( [0,0], 1, ANGLE_ONE, ANGLE_TWO );
- graph.protractor = new Protractor( [22, 0], 8 );
- Khan.scratchpad.disable();
+ addMouseLayer();
+ graph.protractor = new Protractor( [22, 0] );
</div>
</div>
@@ -56,9 +56,16 @@
<div class="hints">
<div class="graphie" data-update="angle">
- protractorHint( graph.protractor, 360 - ANGLE_ONE, DIFF );
+ graph.protractor.moveTo( 0, 0 );
+ graph.protractor.rotateTo( 360 - ANGLE_ONE );
+ label( [ 9 * cos( toRadians( ANGLE_ONE + DIFF ) ), 9 * sin( toRadians( ANGLE_ONE + DIFF ) ) ], "\\color{" + PINK + "}{" + DIFF + "^{\\circ}}" );
+ </div>
+ <div>
+ <p>The shown angle measures less than <code>90^\circ</code>.</p>
+ <div class="graphie" data-update="angle">
+ label( [ 9 * cos( toRadians( ANGLE_ONE + DIFF ) ), 9 * sin( toRadians( ANGLE_ONE + DIFF ) ) ], "\\color{" + PINK + "}{" + DIFF + "^{\\circ}}" );
+ </div>
</div>
- <p>The shown angle measures less than <code>90^\circ</code>.</p>
<p>Therefore, it is an acute angle.</p>
</div>
</div>
@@ -72,9 +79,15 @@
<div class="hints">
<div class="graphie" data-update="angle">
- protractorHint( graph.protractor, 360 - ANGLE_ONE, DIFF );
+ graph.protractor.moveTo( 0, 0 );
+ graph.protractor.rotateTo( 360 - ANGLE_ONE );
+ </div>
+ <div>
+ <p>The shown angle measures <code>90^\circ</code>.</p>
+ <div class="graphie" data-update="angle">
+ label( [ 9 * cos( toRadians( ANGLE_ONE + DIFF ) ), 9 * sin( toRadians( ANGLE_ONE + DIFF ) ) ], "\\color{" + PINK + "}{" + DIFF + "^{\\circ}}" );
+ </div>
</div>
- <p>The shown angle measures <code>90^\circ</code>.</p>
<p>Therefore, it is a right angle.</p>
</div>
</div>
@@ -88,9 +101,15 @@
<div class="hints">
<div class="graphie" data-update="angle">
- protractorHint( graph.protractor, 360 - ANGLE_ONE, DIFF );
+ graph.protractor.moveTo( 0, 0 );
+ graph.protractor.rotateTo( 360 - ANGLE_ONE );
+ </div>
+ <div>
+ <p>The shown angle measures more than <code>90^\circ</code>.</p>
+ <div class="graphie" data-update="angle">
+ label( [ 9 * cos( toRadians( ANGLE_ONE + DIFF ) ), 9 * sin( toRadians( ANGLE_ONE + DIFF ) ) ], "\\color{" + PINK + "}{" + DIFF + "^{\\circ}}" );
+ </div>
</div>
- <p>The shown angle measures more than <code>90^\circ</code>.</p>
<p>Therefore, it is an obtuse angle.</p>
</div>
</div>
View
82 exercises/angles_1.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math graphie">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Angles 1</title>
<script src="../khan-exercise.js"></script>
</head>
@@ -88,7 +88,7 @@
// Label the given angles
if( RAND3 == 0 ) {
- label( [0.5, 1.8], "\\color{green}{<var>ACCUTEANGLE</var>&deg;}",
+ label( [0.5, 1.8], "\\color{green}{" + ACCUTEANGLE + "&deg;}",
"above" );
arc( [0, 0], 1.2, 70, 90, { stroke: "green" } );
@@ -96,7 +96,7 @@
"\\color{blue}{\\angle{AGF}}= {?}", "below left" );
arc( [0, 0], 1.2, 180, 248, { stroke: "blue" } );
} else if ( RAND3 == 1 ) {
- label( [-1.2, -0.75], "\\color{green}{<var>90-ACCUTEANGLE</var>&deg;}",
+ label( [-1.2, -0.75], "\\color{green}{" + (90-ACCUTEANGLE) + "&deg;}",
"below left" );
arc( [0, 0], 1.2, 180, 248, { stroke: "green" } );
@@ -104,7 +104,7 @@
"\\color{blue}{\\angle{CGE}} = {?}", "above" );
arc( [0, 0], 1.2, 70, 90, { stroke: "blue" } );
} else {
- label( [0, -2], "\\color{green}{<var>ACCUTEANGLE</var>&deg;}",
+ label( [0, -2], "\\color{green}{" + ACCUTEANGLE + "&deg;}",
"below left" );
arc( [0, 0], 1.2, 248, 270, { stroke: "green" } );
@@ -138,7 +138,7 @@
because they are opposite angles from each other. Opposite angles
are congruent (equal).
<span class="graphie" data-update="complementary-and-opposite">
- label( [1.2, 0], "\\color{orange}{<var>90 - ACCUTEANGLE</var>&deg;}",
+ label( [1.2, 0], "\\color{orange}{" + (90 - ACCUTEANGLE) + "&deg;}",
"above right" );
arc( [0, 0], 1.2, 0, 68, { stroke: "orange" } );
</span>
@@ -157,7 +157,7 @@
<code>\color{orange}{\angle{EGB}} = \color{purple}{90&deg;}
- \color{green}{\angle{CGE}} = <var>90 - ACCUTEANGLE</var>&deg;</code>
<span class="graphie" data-update="complementary-and-opposite">
- label( [1.2, 0], "\\color{orange}{<var>90 - ACCUTEANGLE</var>&deg;}",
+ label( [1.2, 0], "\\color{orange}{" + (90 - ACCUTEANGLE) + "&deg;}",
"above right" );
arc( [0, 0], 1.2, 0, 68, { stroke: "orange" } );
</span>
@@ -176,7 +176,7 @@
\color{purple}{90&deg;} - \color{green}{\angle{DGF}} =
<var>90 - ACCUTEANGLE</var>&deg;</code>
<span class="graphie" data-update="complementary-and-opposite">
- label( [-1.2, 0], "\\color{orange}{<var>90 - ACCUTEANGLE</var>&deg;}",
+ label( [-1.2, 0], "\\color{orange}{" + 90 - ACCUTEANGLE + "&deg;}",
"below left" );
arc( [0, 0], 1.2, 180, 248, { stroke: "orange" } );
</span>
@@ -190,7 +190,7 @@
<span class="graphie" data-update="complementary-and-opposite">
ORIGINAL_LABEL.remove();
label( [-1.2, -0.75],
- "\\color{blue}{\\angle{AGF}}=<var>90 - ACCUTEANGLE</var>&deg;",
+ "\\color{blue}{\\angle{AGF}}=" + (90 - ACCUTEANGLE) + "&deg;",
"below left" );
</span>
</p>
@@ -202,7 +202,7 @@
<span class="graphie" data-update="complementary-and-opposite">
ORIGINAL_LABEL.remove();
label( [0.5, 1.8],
- "\\color{blue}{\\angle{CGE}} = <var>ACCUTEANGLE</var>&deg;",
+ "\\color{blue}{\\angle{CGE}} = " + ACCUTEANGLE + "&deg;",
"above" )
</span>
</p>
@@ -214,7 +214,7 @@
<span class="graphie" data-update="complementary-and-opposite">
ORIGINAL_LABEL.remove();
label( [1.5, 0],
- "\\color{blue}{\\angle{BGE}} = <var>90 - ACCUTEANGLE</var>&deg;",
+ "\\color{blue}{\\angle{BGE}} = " + (90 - ACCUTEANGLE) + "&deg;",
"above right" );
</span>
</p>
@@ -273,11 +273,11 @@
// Label the angles acording to variation
if( RAND2 == 0 ) {
- label( [3, -2], "\\color{green}{<var>Tri_Y</var>&deg;}",
+ label( [3, -2], "\\color{green}{" + Tri_Y + "&deg;}",
"above left" );
arc( [4, -2], 1.2, 130, 180, { stroke: "green" } );
- label( [0, 1.5], "\\color{purple}{<var>Tri_Z</var>&deg;}",
+ label( [0, 1.5], "\\color{purple}{" + Tri_Z + "&deg;}",
"below" );
arc( [0, 3], 1.5, 230, 310, { stroke: "purple" } );
@@ -285,11 +285,11 @@
"above left" );
arc( [-4, -2], .75, 50, 180, { stroke: "blue" } );
} else {
- label( [-4.7, -2], "\\color{green}{<var>180 - Tri_X</var>&deg;}",
+ label( [-4.7, -2], "\\color{green}{" + (180 - Tri_X) + "&deg;}",
"above left" );
arc( [-4, -2], .75, 50, 180, { stroke: "green" } );
- label( [0, 1.5], "\\color{purple}{<var>Tri_Z</var>&deg;}",
+ label( [0, 1.5], "\\color{purple}{" + Tri_Z + "&deg;}",
"below" );
arc( [0, 3], 1.5, 230, 310, { stroke: "purple" } );
@@ -317,7 +317,7 @@
</code>,
This is because angles inside a triangle add up to 180 degrees.
<span class="graphie" data-update="supplementary-and-triangle">
- label( [-3.3, -2], "\\color{orange}{<var>Tri_X</var>&deg;}",
+ label( [-3.3, -2], "\\color{orange}{" + Tri_X + "&deg;}",
"above right" );
arc( [-4, -2], 0.75, 0, 49, {stroke: "orange"} );
</span>
@@ -331,7 +331,7 @@
because supplementary angles along a line add up to
180 degrees.
<span class="graphie" data-update="supplementary-and-triangle">
- label( [-3.3, -2], "\\color{orange}{<var>Tri_X</var>&deg;}",
+ label( [-3.3, -2], "\\color{orange}{" + Tri_X + "&deg;}",
"above right" );
arc( [-4, -2], 0.75, 0, 49, {stroke: "orange"} );
</span>
@@ -347,7 +347,7 @@
<span class="graphie" data-update="supplementary-and-triangle">
ORIGINAL_LABEL.remove();
label( [-4.7, -2],
- "\\color{blue}{\\angle{DAB}} = <var>Tri_Y + Tri_Z</var>&deg;",
+ "\\color{blue}{\\angle{DAB}} = " + (Tri_Y + Tri_Z) + "&deg;",
"above left" );
</span>
@@ -362,7 +362,7 @@
<span class="graphie" data-update="supplementary-and-triangle">
ORIGINAL_LABEL.remove();
label( [2.80, -2],
- "\\color{blue}{\\angle{ACB}} = <var>Tri_Y</var>&deg;",
+ "\\color{blue}{\\angle{ACB}} = " + Tri_Y + "&deg;",
"above left" );
</span>
</p>
@@ -377,14 +377,14 @@
<ul>
<li><code>\overline{HI} \parallel \overline{JK}</code>,
lines HI and JK are parallel.</li>
- <li data-if="RAND3 == 0 || RAND3 == 1">
+ <li data-if="RAND3 === 0 || RAND3 === 1">
<code>\color{purple}{\angle{BAC}} = <var>Tri_X</var>&deg;</code>
</li>
<li data-else>
<code>\color{purple}{\angle{AKJ}} = <var>Tri_Y</var>&deg;</code>
</li>
- <li data-if="RAND3 == 0">
+ <li data-if="RAND3 === 0">
<code>\color{green}{\angle{AJK}} = <var>Tri_Z</var>&deg;</code>
</li>
<li data-else>
@@ -446,10 +446,10 @@
"\\color{blue}{\\angle{AIH}} = {?}", "left" );
arc( [1.25, -3], .75, 135, 190, {stroke: "blue"} );
- label( [-4.2, 4.25], "\\color{green}{<var>Tri_Z</var>&deg;}", "below" );
+ label( [-4.2, 4.25], "\\color{green}{" + Tri_Z + "&deg;}", "below" );
arc( [-4.47, 5.25], 1, 255, 330, {stroke: "green"} );
- label( [-5.5, -3.5], "\\color{purple}{<var>Tri_X</var>&deg;}",
+ label( [-5.5, -3.5], "\\color{purple}{" + Tri_X + "&deg;}",
"above right" );
arc( [-6, -4], 1, 10, 80, {stroke: "purple"} );
} else if( RAND3 == 1 ) {
@@ -457,10 +457,10 @@
"\\color{blue}{\\angle{AKJ}} = {?}", "above" );
arc( [5.7, -2.3], 0.75, 139, 194, {stroke: "blue"} );
- label( [-4.4, 0.65], "\\color{green}{<var>Tri_Z</var>&deg;}", "below" );
+ label( [-4.4, 0.65], "\\color{green}{" + Tri_Z + "&deg;}", "below" );
arc( [-5.07, 1.75], 1, 257, 326, {stroke: "green"} );
- label( [-5.5, -3.5], "\\color{purple}{<var>Tri_X</var>&deg;}",
+ label( [-5.5, -3.5], "\\color{purple}{" + Tri_X + "&deg;}",
"above right" );
arc( [-6, -4], 1, 10, 80, {stroke: "purple"} );
} else {
@@ -468,10 +468,10 @@
"\\color{blue}{\\angle{BAC}} = {?}", "above right" );
arc( [-6, -4], 1, 10, 80, {stroke: "blue"} );
- label( [4.1, -2.6], "\\color{purple}{<var>Tri_Y</var>&deg;}", "above" );
+ label( [4.1, -2.6], "\\color{purple}{" + Tri_Y + "&deg;}", "above" );
arc( [5.7, -2.3], 0.75, 139, 194, {stroke: "purple"} );
- label( [-4.4, 0.65], "\\color{green}{<var>Tri_Z</var>&deg;}", "below" );
+ label( [-4.4, 0.65], "\\color{green}{" + Tri_Z + "&deg;}", "below" );
arc( [-5.07, 1.75], 1, 257, 326, {stroke: "green"} );
}
@@ -491,7 +491,7 @@
because they are corresponding angles formed by 2 parallel lines and
a transversal line. Corresponding angles are congruent (equal).
<span class="graphie" data-update="parallel-and-triangle">
- label( [-4.60, 0.75], "\\color{orange}{<var>Tri_Z</var>&deg;}",
+ label( [-4.60, 0.75], "\\color{orange}{" + Tri_Z + "&deg;}",
"below" );
arc( [-5.07, 1.75], 1, 260, 325, {stroke: "orange"} );
</span>
@@ -501,7 +501,7 @@
because they are corresponding angles formed by 2 parallel lines and
a transversal line. Corresponding angles are congruent (equal).
<span class="graphie" data-update="parallel-and-triangle">
- label( [-4.00, 4.25], "\\color{orange}{<var>Tri_Z</var>&deg;}",
+ label( [-4.00, 4.25], "\\color{orange}{" + Tri_Z + "&deg;}",
"below" );
arc( [-4.47, 5.25], 1, 257, 325, {stroke: "orange"} );
</span>
@@ -519,7 +519,7 @@
<span class="graphie" data-update="parallel-and-triangle">
ORIGINAL_LABEL.remove();
label( [0, -2.50],
- "\\color{blue}{\\angle{AIH}} = <var>180 - Tri_X - Tri_Z</var>&deg;",
+ "\\color{blue}{\\angle{AIH}} = " + (180 - Tri_X - Tri_Z) + "&deg;",
"left" );
</span>
</p>
@@ -528,11 +528,11 @@
ORIGINAL_LABEL.remove();
if ( RAND3 === 1 ) {
label( [3.3, -2.6],
- "\\color{blue}{\\angle{AKJ}} = <var>Tri_Y</var>&deg;",
+ "\\color{blue}{\\angle{AKJ}} = " + Tri_Y + "&deg;",
"above" );
} else {
label( [-5.5, -3.5],
- "\\color{blue}{\\angle{BAC}} = <var>Tri_X</var>&deg;",
+ "\\color{blue}{\\angle{BAC}} = " + Tri_X + "&deg;",
"above right" );
}
</span>
@@ -617,11 +617,11 @@
"\\color{blue}{\\angle{IAK}} = {?}", "above left" );
arc( [0, 2], 1, 90, 135, {stroke:"blue"} );
- label( [4.75, -2], "\\color{green}{<var>Tri_Y</var>&deg;}",
+ label( [4.75, -2], "\\color{green}{" + Tri_Y + "&deg;}",
"below right" );
arc( [4, -2], .75, 315, 360, {stroke: "green"} );
} else {
- label( [0, 3], "\\color{green}{<var>Tri_Y</var>&deg;}", "above left" );
+ label( [0, 3], "\\color{green}{" + Tri_Y + "&deg;}", "above left" );
arc( [0, 2], 1, 90, 135, {stroke:"green"} );
ORIGINAL_LABEL = label( [4.75, -2],
@@ -643,7 +643,7 @@
because they are alternate exterior angles, formed by 2 parallel lines
and a transversal line, they are congruent (equal).
<span class="graphie" data-update="alternate-exterior-and-complementary">
- label( [-.80, 2], "\\color{orange}{<var>Tri_Y</var>&deg;}",
+ label( [-.80, 2], "\\color{orange}{" + Tri_Y + "&deg;}",
"above left" );
arc( [0, 2], 1, 135, 180, {stroke: "orange"} );
</span>
@@ -651,10 +651,10 @@
angles to achieve the same result (as seen using
<code>\color{pink}{pink}</code>).
<span class="graphie" data-update="alternate-exterior-and-complementary">
- label( [1, 2], "\\color{pink}{<var>Tri_Y</var>&deg;}",
+ label( [1, 2], "\\color{pink}{" + Tri_Y + "&deg;}",
"below right" );
arc( [0, 2], 1, 315, 360, {stroke: "pink"} );
- label( [3, -2], "\\color{pink}{<var>Tri_Y</var>&deg;}",
+ label( [3, -2], "\\color{pink}{" + Tri_Y + "&deg;}",
"above left" );
arc( [4, -2], 1, 135, 180, {stroke: "pink"} );
</span>
@@ -678,7 +678,7 @@
<span class="graphie" data-update="alternate-exterior-and-complementary">
ORIGINAL_LABEL.remove();
label( [0, 3.5],
- "\\color{blue}{\\angle{IAK}} = <var>90 - Tri_Y</var>&deg;",
+ "\\color{blue}{\\angle{IAK}} = " + (90 - Tri_Y) + "&deg;",
"above left" );
</span>
</p>
@@ -690,7 +690,7 @@
and <code>\color{orange}{\angle{DAI}}</code>, make up angle
<code>\color{purple}{\angle{DAK}}</code>.
<span class="graphie" data-update="alternate-exterior-and-complementary">
- label( [-.80, 2], "\\color{orange}{<var>90-Tri_Y</var>&deg;}",
+ label( [-.80, 2], "\\color{orange}{" + (90-Tri_Y) + "&deg;}",
"above left" );
arc( [0, 2], 1, 135, 180, {stroke: "orange"} );
</span>
@@ -706,16 +706,16 @@
angles to achieve the same result (as seen using
<code>\color{pink}{pink}</code>).
<span class="graphie" data-update="alternate-exterior-and-complementary">
- label( [1, 2], "\\color{pink}{<var>90-Tri_Y</var>&deg;}",
+ label( [1, 2], "\\color{pink}{" + (90-Tri_Y) + "&deg;}",
"below right" );
arc( [0, 2], 1, 315, 360, {stroke: "pink"} );
- label( [3, -2], "\\color{pink}{<var>90-Tri_Y</var>&deg;}",
+ label( [3, -2], "\\color{pink}{" + (90-Tri_Y) + "&deg;}",
"above left" );
arc( [4, -2], 1, 135, 180, {stroke: "pink"} );
ORIGINAL_LABEL.remove();
label( [4.75, -2],
- "\\color{blue}{\\angle{GCJ} = <var>90-Tri_Y</var>&deg;}",
+ "\\color{blue}{\\angle{GCJ} = " + (90-Tri_Y) + "&deg;}",
"below right" );
</span>
</p>
View
72 exercises/angles_2.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html data-require="math graphie">
<head>
- <meta charset="UTF-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Angles 2</title>
<script src="../khan-exercise.js"></script>
</head>
@@ -74,12 +74,12 @@
// label angle ABC
arc([-4,3], .75, 312, 360, { stroke: "green" });
- label([-3.2, 3], "\\color{green}{<var>Tri_Y</var>&deg;}",
+ label([-3.2, 3], "\\color{green}{" + Tri_Y + "&deg;}",
"below right", {color: "green"});
// label angle BAC
arc([-1.3,0], .75, 38, 125, { stroke: "purple" });
- label([-1.3, .7], "\\color{purple}{<var>Tri_Z</var>&deg;}",
+ label([-1.3, .7], "\\color{purple}{" + Tri_Z + "&deg;}",
"above", {color: "purple"});
// Label X according to problem variation
@@ -112,7 +112,7 @@
<span class="graphie" data-update="tri-and-parallel">
// label angle BAC
arc([2.5, 3], .75, 180, 220, { stroke: "orange" });
- label([1.8, 3], "\\color{orange}{<var>Tri_X</var>&deg;}",
+ label([1.8, 3], "\\color{orange}{" + Tri_X + "&deg;}",
"below left", {color: "orange"});
</span>
</p>
@@ -124,7 +124,7 @@
<span class="graphie" data-update="tri-and-parallel">
LABEL.remove();
LABEL = label([-3.3, 0],
- "\\color{blue}{\\angle{DAF}}=<var>Tri_X</var>&deg;",
+ "\\color{blue}{\\angle{DAF}}=" + Tri_X + "&deg;",
"below");
</span>
</span>
@@ -134,7 +134,7 @@
<span class="graphie" data-update="tri-and-parallel">
LABEL.remove();
LABEL = label([1, 0],
- "\\color{blue}{&ang;CAE} = <var>Tri_X</var>&deg;",
+ "\\color{blue}{&ang;CAE} = " + Tri_X + "&deg;",
"above", { color: "blue"});
</span>
</span>
@@ -223,15 +223,15 @@
// label angle Y
if(RAND_SWITCH3 == 0) {
arc([1.2, 2], 1.5, 0, 50, { stroke: "purple" });
- label([3.1, 2], "\\color{purple}{\\angle{EGB}}=<var>X</var>&deg;",
+ label([3.1, 2], "\\color{purple}{\\angle{EGB}}=" + X + "&deg;",
"above right");
} else if (RAND_SWITCH3 == 1) {
arc([1.2, 2], 1.5, 180, 220, { stroke: "purple" });
- label([-1, 2], "\\color{purple}{\\angle{AGH}}=<var>X</var>&deg;",
+ label([-1, 2], "\\color{purple}{\\angle{AGH}}=" + X + "&deg;",
"below left");
} else {
arc([1.2, 2], 1, 220, 0, { stroke: "purple" });
- label([1.5, 1.2], "\\color{purple}{\\angle{BGH}}=<var>180 - X</var>&deg;",
+ label([1.5, 1.2], "\\color{purple}{\\angle{BGH}}=" + (180 - X) + "&deg;",
"below right");
}
</div>
@@ -254,7 +254,7 @@
because opposite angles are equal.
<span class="graphie" data-update="opposite-parallel">
arc([1,2], .88, 180, 225, {stroke:"orange"});
- label([0,2], "\\color{orange}{<var>X</var>&deg;}", "below left");
+ label([0,2], "\\color{orange}{" + X + "&deg;}", "below left");
</span>
</p>
<p data-else-if="RAND_COMBO === 10">
@@ -275,26 +275,26 @@
because angles along a line plane add up to 180&deg;.
<span class="graphie" data-update="opposite-parallel">
arc([1,2], .88, 180, 225, {stroke:"orange"});
- label([0,2], "\\color{orange}{<var>X</var>&deg;}", "below left");
+ label([0,2], "\\color{orange}{" + X + "&deg;}", "below left");
</span>
</p>
- <p data-if="RAND_COMBO == 20">
+ <p data-if="RAND_COMBO === 20">
<code>\color{blue}{\angle{GHD}} = \color{orange}{\angle{AGH}}</code>.
We know those 2 angles are equal because they are alternate interior angles
of 2 parallel lines.
</p>
- <p data-else-if="RAND_COMBO == 21 || RAND_COMBO == 1">
+ <p data-else-if="RAND_COMBO === 21 || RAND_COMBO === 1">
<code>\color{blue}{\angle{CHF}} = \color{orange}{\angle{AGH}}</code>.
We know those 2 angles are equal because they are corresponding angles
formed by parallel lines, and a single bisecting lines.
</p>
<p>
Therefore,
- <span data-if="RAND_SWITCH2 == 0">
+ <span data-if="RAND_SWITCH2 === 0">
<code>\angle{GHD} = <var>X</var>&deg;</code>
<span class="graphie" data-update="opposite-parallel">
LABEL.remove();
- label([-2, -2], "\\color{blue}{\\angle{GHD}}=<var>X</var>&deg;",
+ label([-2, -2], "\\color{blue}{\\angle{GHD}}=" + X + "&deg;",
"above right");
</span>
</span>
@@ -302,7 +302,7 @@
<code>\angle{CHF} = <var>X</var>&deg;</code>
<span class="graphie" data-update="opposite-parallel">
LABEL.remove();
- label([-4, -2.5], "\\color{blue}{\\angle{CHF}}=<var>X</var>&deg;",
+ label([-4, -2.5], "\\color{blue}{\\angle{CHF}}=" + X + "&deg;",
"below left");
</span>
</span>.
@@ -363,10 +363,10 @@
label([-3.2, 1.3], "J", "below left");
// Label the given angles
- label([-5.5, -5.2], "\\color{green}{<var>Tri1_Y</var>&deg;}",
+ label([-5.5, -5.2], "\\color{green}{" + Tri1_Y + "&deg;}",