Permalink
Browse files

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

…ract
  • Loading branch information...
jeresig committed Jan 23, 2013
2 parents 27f52aa + 40918ed commit c9e5f295b1db0602c09812bdbe28e986d6434a3b
Showing with 367 additions and 2,371 deletions.
  1. +4 −0 .arcconfig
  2. +0 −105 exercises/addition_rule_of_probability.html
  3. +0 −30 exercises/algebra_challenge.html
  4. +0 −15 exercises/arithmetic_challenge.html
  5. +0 −31 exercises/changing_decimals_to_percents.html
  6. +0 −45 exercises/changing_fractions_to_decimals_1.html
  7. +0 −59 exercises/changing_fractions_to_percents.html
  8. +0 −30 exercises/changing_percents_to_decimals.html
  9. +0 −44 exercises/changing_percents_to_fractions.html
  10. +0 −33 exercises/common_factors_of_a_polynomial_1.html
  11. +0 −34 exercises/common_factors_of_a_polynomial_2.html
  12. +0 −185 exercises/comparing_objects.html
  13. +0 −246 exercises/distributive_property_with_variables.html
  14. +0 −204 exercises/even_and_odd_integers.html
  15. +0 −53 exercises/factoring_difference_of_squares_4.html
  16. +0 −107 exercises/factoring_polynomials_3.html
  17. +0 −14 exercises/geometry_1.html
  18. +8 −1 exercises/graphing_systems_of_equations.html
  19. +0 −329 exercises/kinematic_equations.html
  20. +1 −1 exercises/least_common_multiple_and_greatest_common_divisor_word_problems.html
  21. +5 −2 exercises/matrix_transpose.html
  22. +0 −179 exercises/ordering_objects.html
  23. +0 −20 exercises/pre-algebra_challenge.html
  24. +0 −13 exercises/similar_triangles_review.html
  25. +0 −34 exercises/simplifying_rational_expressions_1.html
  26. +0 −34 exercises/simplifying_rational_expressions_2.html
  27. +0 −74 exercises/simplifying_square_roots_of_negatives.html
  28. +0 −58 exercises/trig_identities_1.html
  29. +0 −19 exercises/trigonometry_challenge.html
  30. +4 −4 exercises/visualizing_derivatives.html
  31. +290 −319 khan-exercise.js
  32. +20 −20 utils/chemistry.js
  33. +35 −29 utils/visualizing-derivatives.js
View
@@ -0,0 +1,4 @@
+{
+ "project_id": "khan-exercises",
+ "conduit_uri": "http://phabricator.khanacademy.org/"
+}
@@ -1,105 +0,0 @@
-<!DOCTYPE html>
-<html data-require="math math-format probability word-problems stat">
-<head>
- <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>";
- else
- return "<code>\\lvert</code>" + innerString + "<code>\\rvert</code>";
- }
- </script>
-</head>
-<body>
- <div class="exercise">
- <div class="problems">
- <div>
- <div class="vars">
- <var id="VARINDX_X, VARINDX_Y, VARINDX_X_OR_Y, VARINDX_X_AND_Y">[0, 1, 2, 3]</var>
- <var id="CHOOSE_ATTRIBUTES">
- function( attrChoices1, attrChoices2 ) {
- att1 = randFromArray( attrChoices1 );
- att2 = randFromArray( attrChoices2 );
- return [ att1, att2, att1 + " or " + att2, att1 + " and " + att2 ];
- }
- </var>
- <var id="INTRO, VARDESC, QSTNPRETEXT, QSTNPOSTTEXT, USEPERCENTAGES">
- <!-- Put each question in the following structure: [INTRO, [X DESC, Y DESC, X_OR_Y DESC, X_AND_Y DESC], QSTNPRETEXT, QSTNPOSTTEXT, USEPERCENTAGES] -->
- randFromArray([
- ["A local store ran a sale on two items, a watch and a shirt. There were ", ["customers who bought a watch", "customers who bought a shirt", "customers who bought a watch or a shirt", "customers who bought a watch and a shirt"], "What was the number of ", "?", false],
- ["A study group at a nearby high school has ", ["sophomores", "girls", "students who are a sophomore or a girl", "sophomore girls"], "How many ", " are there in the study group?", false],
- ["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]
- ])
- </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() {
- var optionalPercentage = USEPERCENTAGES ? "% are " : " ";
- 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 &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>
- <div class="solution"><var>VARVALS[ORDER[ORDER.length-1]]</var></div>
- <div class="hints">
- <p>Remember the addition rule of probability: <code>P(A\cup B) = P(A) + P(B) - P(A\cap B)</code></p>
- <p data-if="USEPERCENTAGES === false">Because the denominator of the fraction for each probability is the same, for convenience we can also just use cardinality (the number of items in each category) instead of probability: <code>|A\cup B| = |A|+ |B| - |A\cap B|</code></p>
-
- <!-- substitute english descriptions for variables -->
- <p>Substituting variables, <var>ENFUNC(VARDESC[2])</var> = <var>ENFUNC(VARDESC[0])</var> + <var>ENFUNC(VARDESC[1])</var> - <var>ENFUNC(VARDESC[3])</var></p>
-
- <!-- rearrange the unknown to the left hand side IF it wasn't already -->
- <p data-if="ORDER[ORDER.length-1] === 0">Rearranging, <var>ENFUNC(VARDESC[0])</var> = <var>ENFUNC(VARDESC[3])</var> + <var>ENFUNC(VARDESC[2])</var> - <var>ENFUNC(VARDESC[1])</var></p>
- <p data-if="ORDER[ORDER.length-1] === 1">Rearranging, <var>ENFUNC(VARDESC[1])</var> = <var>ENFUNC(VARDESC[3])</var> + <var>ENFUNC(VARDESC[2])</var> - <var>ENFUNC(VARDESC[0])</var></p>
- <p data-if="ORDER[ORDER.length-1] === 3">Rearranging, <var>ENFUNC(VARDESC[3])</var> = <var>ENFUNC(VARDESC[0])</var> + <var>ENFUNC(VARDESC[1])</var> - <var>ENFUNC(VARDESC[2])</var></p>
-
- <!-- substitue vals for vars on RHS -->
- <p data-if="ORDER[ORDER.length-1] === 0"><var>ENFUNC(VARDESC[0])</var> = <code><var>VARVALS[3]</var> + <var>VARVALS[2]</var> - <var>VARVALS[1]</var></code>
- <p data-if="ORDER[ORDER.length-1] === 1"><var>ENFUNC(VARDESC[1])</var> = <code><var>VARVALS[3]</var> + <var>VARVALS[2]</var> - <var>VARVALS[0]</var></code>
- <p data-if="ORDER[ORDER.length-1] === 2"><var>ENFUNC(VARDESC[2])</var> = <code><var>VARVALS[0]</var> + <var>VARVALS[1]</var> - <var>VARVALS[3]</var></code>
- <p data-if="ORDER[ORDER.length-1] === 3"><var>ENFUNC(VARDESC[3])</var> = <code><var>VARVALS[0]</var> + <var>VARVALS[1]</var> - <var>VARVALS[2]</var></code>
-
- <!-- give the final answer -->
- <p data-if="ORDER[ORDER.length-1] === 0"><var>ENFUNC(VARDESC[0])</var> = <code><var>VARVALS[3] + VARVALS[2] - VARVALS[1]</var></code>
- <p data-if="ORDER[ORDER.length-1] === 1"><var>ENFUNC(VARDESC[1])</var> = <code><var>VARVALS[3] + VARVALS[2] - VARVALS[0]</var></code>
- <p data-if="ORDER[ORDER.length-1] === 2"><var>ENFUNC(VARDESC[2])</var> = <code><var>VARVALS[0] + VARVALS[1] - VARVALS[3]</var></code>
- <p data-if="ORDER[ORDER.length-1] === 3"><var>ENFUNC(VARDESC[3])</var> = <code><var>VARVALS[0] + VARVALS[1] - VARVALS[2]</var></code>
- </div>
- </div>
-
- </div>
- </div>
-</body>
-</html>
-
-
@@ -1,30 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Algebra challenge</title>
- <script src="../khan-exercise.js"></script>
-</head>
-<body>
- <div class="exercise" data-name="equation_of_a_line"></div>
- <div class="exercise" data-name="linear_equations_4"></div>
- <div class="exercise" data-name="linear_inequalities"></div>
- <div class="exercise" data-name="average_word_problems"></div>
- <div class="exercise" data-name="solving_quadratics_by_factoring"></div>
- <div class="exercise" data-name="quadratic_equation"></div>
- <div class="exercise" data-name="systems_of_equations"></div>
- <div class="exercise" data-name="even_and_odd_functions"></div>
- <div class="exercise" data-name="inverses_of_functions"></div>
- <div class="exercise" data-name="shifting_and_reflecting_functions"></div>
- <div class="exercise" data-name="percentage_word_problems_2"></div>
- <div class="exercise" data-name="logarithms_1"></div>
- <div class="exercise" data-name="domain_of_a_function"></div>
- <div class="exercise" data-name="age_word_problems"></div>
- <div class="exercise" data-name="midpoint_formula"></div>
- <div class="exercise" data-name="solving_for_a_variable"></div>
- <div class="exercise" data-name="line_relationships"></div>
- <div class="exercise" data-name="absolute_value_equations"></div>
- <div class="exercise" data-name="expressions_with_unknown_variables_2"></div>
- <div class="exercise" data-name="radical_equations"></div>
-</body>
-</html>
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Arithmetic challenge</title>
- <script src="../khan-exercise.js"></script>
-</head>
-<body>
- <div class="exercise" data-name="multiplying_decimals"></div>
- <div class="exercise" data-name="dividing_decimals"></div>
- <div class="exercise" data-name="multiplying_fractions"></div>
- <div class="exercise" data-name="multiplying_and_dividing_negative_numbers"></div>
- <div class="exercise" data-name="dividing_fractions"></div>
-</body>
-</html>
@@ -1,31 +0,0 @@
-<!DOCTYPE html>
-<html data-require="math">
- <head>
- <title>Changing decimals to percents</title>
- <script src="../khan-exercise.js"></script>
- </head>
- <body>
- <div class="exercise">
- <div class="vars">
- <var id="DECIMAL">randRange( 50, 999 ) / 1000</var> <!-- between 0.05 and .999, pcts with 1 decimal place-->
- <var id="SOLN">DECIMAL * 100</var>
- </div>
-
- <div class="problems">
- <div id="original" data-weight="1">
- <p class="question">Express <code><var>DECIMAL</var></code> as a percent.</p>
- <div class="solution" data-type="multiple">
- <p><span class="sol" data-forms="decimal"><var>SOLN</var></span> %</p>
- </div>
-
- <div class="hints">
- <p>To convert a decimal to a fraction, we need to multiply by 100 and add the <code>\%</code> symbol.</p>
- <p>To multiply by 100, we can just move the decimal point two places to the right.</p>
- <p><code><var>DECIMAL</var> \rightarrow <var>DECIMAL * 10 </var> \rightarrow <var>SOLN</var></code></p>
- <p>So <code><var>DECIMAL</var></code> = <code><var>SOLN</var>\%</code>.</p>
- </div>
- </div>
- </div>
- </div>
- </body>
-</html>
@@ -1,45 +0,0 @@
-<!DOCTYPE html>
-<html data-require="math math-format graphie graphie-helpers">
-<head>
- <title>Changing fractions to decimals 1</title>
- <script src="../khan-exercise.js"></script>
-
- <script type="text/javascript">
- function decimalLength( n ) {
- return ( ( n + "" ).split( "." )[1] || "" ).length;
- }
-
- </script>
-</head>
-
-<body>
-<div class="exercise">
- <div class="vars">
- <div data-ensure="decimalLength( DEC ) <= 4">
- <var id="_D">randFromArray([ 4, 5, 8, 10, 16, 20, 25, 40, 50, 100 ])</var>
- <var id="_N">randRange( 1, _D - 1 )</var>
- <var id="DEC">_N / _D</var>
- </div>
-
- <var id="GCD">getGCD( _N, _D )</var>
- <var id="N">round( _N / GCD )</var>
- <var id="D">round( _D / GCD )</var>
- </div>
-
- <div class="problems">
- <div>
- <p class="question">Express <code><var>fraction( _N, _D )</var></code> as a decimal.</p>
- <div class="solution" data-type="decimal"><var>DEC</var></div>
- </div>
- </div>
-
- <div class="hints">
- <p data-if="GCD > 1"><code><var>fraction( _N, _D )</var></code> reduces to <code><var>fraction( N, D )</var></code>.</p>
- <p data-if="D === 10 || D === 100">Denominators of 10 or 100 are easy cases: The decimal form is just the numerator with the decimal place moved left by the number of 0s in the denominator.
- <p data-if="D === 10 || D === 100">For this question, this means <var>D === 10 ? "1 place" : "2 places"</var>.</p>
- <p data-else>To turn <code><var>fractionSmall( N, D )</var></code> into a decimal, perform long division, dividing <code><var>D</var></code> into <code><var>N</var></code> (if you need help with this, try practicing some Division exercises or watching some related videos).</p>
- <p><code><var>N</var> \div <var>D</var> = <var>DEC</var></code></p>
- </div>
-</div>
-</body>
-</html>
@@ -1,59 +0,0 @@
-<!DOCTYPE html>
-<html data-require="math math-format graphie graphie-helpers">
-<head>
- <title>Changing fractions to percents</title>
- <script src="../khan-exercise.js"></script>
-
- <script type="text/javascript">
- function decimalLength( n ) {
- return ( ( n + "" ).split( "." )[1] || "" ).length;
- }
-
- </script>
-</head>
-
-<body>
- <div class="exercise">
- <div class="problems">
- <div>
- <div class="vars">
-
- <div data-ensure="decimalLength( DEC ) <= 4">
- <var id="_D">randFromArray([ 4, 5, 8, 10, 16, 20, 25, 40, 50, 100 ])</var>
- <var id="_N">randRange( 1, _D - 1 )</var>
- <var id="DEC">_N / _D</var>
- </div>
-
- <var id="GCD">getGCD( _N, _D )</var>
- <var id="N">round( _N / GCD )</var>
- <var id="D">round( _D / GCD )</var>
-
- </div>
-
- <p class="question">Express <code><var>fraction( _N, _D )</var></code> as a percent.</p>
-
- <div class="solution" data-type="multiple">
- <span class="sol" data-type="decimal"><var>100 * DEC</var></span> %
- </div>
-
- <div class="hints">
- <div data-if="_D === 100" data-unwrap>
- <p>When the denominator is 100, you can simply take the numerator and apply the % sign:</p>
- <p><code><var>fraction( _N, _D )</var></code> = <var>100 * DEC</var>%</p>
- </div>
- <div data-else data-unwrap>
- <p data-if="GCD > 1"><code><var>fraction( _N, _D )</var></code> reduces to <code><var>fraction( N, D )</var></code>.</p>
- <p>To turn a fraction into a percent, turn the fraction into a decimal and then multiply the decimal by 100.</p>
- <p data-if="D === 10">Denominators of 10 are an easy case: The decimal form is just the numerator with the decimal place moved left by the number of 0s in the denominator - in this case 1 place.</p>
- <p data-else>To turn <code><var>fraction( N, D )</var></code> into a decimal, perform long division, dividing <code><var>D</var></code> into <code><var>N</var></code> (if you need help with this, try practicing some Division exercises or watching some related videos).</p>
- <p><code><var>N</var> \div <var>D</var> = <var>DEC</var></code></p>
- <p>To convert this decimal into a percent, we need to multiply it by 100.</p>
- <p><code><var>DEC</var> = (100 \cdot <var>DEC</var>) \% = <var>roundTo( 2, 100 * DEC )</var>\%</code></p>
- </div>
- </div>
- </div>
- </div>
- </div>
-</body>
-</html>
-
@@ -1,30 +0,0 @@
-<!DOCTYPE html>
-<html data-require="math">
-<head>
- <title>Changing percents to decimals</title>
- <script src="../khan-exercise.js"></script>
-</head>
-<body>
-<div class="exercise">
- <div class="vars">
- <var id="PCT">randRange( 10, 1999 ) / 10</var> <!-- between 1% and 199.9% with 1 decimal place-->
- <var id="SOLN">roundTo( 5 , PCT / 100 )</var>
- </div>
-
- <div class="problems">
- <div id="original" data-weight="1">
- <p class="question">Express <code><var>PCT</var>\%</code> as a decimal.</p>
- <div class="solution" data-type="decimal"><var>SOLN</var></div>
-
- <div class="hints">
- <p><code><var>PCT</var>\%</code> literally means <code><var>PCT</var></code> per 100</p>
- <p><code><var>PCT</var>\%</code> = <code>\dfrac{<var>PCT</var>}{<var>100</var>}</code></p>
- <p>To easily divide by 100, you can just move the decimal point two places to the left.</p>
- <p><code><var>PCT</var> \rightarrow <var>roundTo( 5, PCT / 10 )</var> \rightarrow <var>SOLN</var></code></p>
- <p>So <code><var>PCT</var>\%</code> = <code><var>SOLN</var></code><p>
- </div>
- </div>
- </div>
-</div>
-</body>
-</html>
Oops, something went wrong.

0 comments on commit c9e5f29

Please sign in to comment.