# Khan/khan-exercises

Fix issues with extraneous paragraphs in extracted strings.

1 parent 2f199d6 commit af60424c5f5d94b09fb5bde67ed9e5708ed66ed0 jeresig committed Jan 23, 2013
 @@ -94,6 +94,10 @@ def test_json_output_from_all_files(self): self.assertNotRegexpMatches(string, r' are found in the extracted string + self.assertNotRegexpMatches(string, r'
 @@ -59,13 +59,14 @@
-
Given
+

\qquad m ANGLE_ONE = COEF_1x + CONST_1, and
\qquad m ANGLE_TWO = COEF_2x + CONST_2,
, and
- \qquad m LARGE_ANGLE = largeAngle,
-

+ \qquad m LARGE_ANGLE = largeAngle,

+

+
init({
 @@ -122,7 +122,7 @@

The goal block 1 of length CODE_OFFSPRING_2 units can be rewritten as fraction(N_OFFSPRING_2, D_OFFSPRING_2).

Cutting the starting block into x pieces is the same as dividing it by x.

-

We want to cut the starting block into a piece that can be copied into both goal block 1 and goal block 2.

A +

We want to cut the starting block into a piece that can be copied into both goal block 1 and goal block 2.

The least common denominator of D_OFFSPRING_1 and D_OFFSPRING_2 (the denominators of the goal blocks) is LCM. Therefore you can copy a block \dfrac{1}{LCM} units long to make both goal blocks.

To find the number of slices to cut the starting block into we solve for s in the following equation:

 @@ -18,7 +18,7 @@
- Graph the following equation: +

Graph the following equation:

expr([ "*", B, "y" ]) = C

@@ -82,7 +82,7 @@
- Graph the following equation: +

Graph the following equation:

expr([ "*", B, "x" ]) = C

@@ -162,7 +162,7 @@
- Graph the following equation: +

Graph the following equation:

expr([ "+", [ "*", A, "x" ], [ "*", B, "y" ] ]) = C

 @@ -102,11 +102,10 @@ LESS_THAN ? "less than" : "greater than" Y1 . So we should use a LESS_THAN ? "< or ≤" : "> or ≥" sign.

- Another way to see this is to try plugging in a point. The easiest point to plug in is (0,0): +

Another way to see this is to try plugging in a point. The easiest point to plug in is (0,0):

y \; ? \; ( SLOPE === -1 ? "-" : ( SLOPE === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 ))) x + fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 )

0 \; ? \; ( SLOPE === -1 ? "-1*" : ( SLOPE === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 ) + "*")) 0 + fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 )

- Since (0,0) is ORI_IN ? "" : "not" in the shaded area, this expression must be ORI_IN ? "true" : "false" So, the ? must be either LESS_THAN ? "< or ≤" : "> or ≥" . -
+

Since (0,0) is ORI_IN ? "" : "not" in the shaded area, this expression must be ORI_IN ? "true" : "false" So, the ? must be either LESS_THAN ? "< or ≤" : "> or ≥" .

The line of the graph is INCLUSIVE ? "solid" : "dashed", so the points on the boundary are INCLUSIVE ? "" : "not"

 @@ -90,7 +90,7 @@
- \Large{(}XM, YM\Large{)} +

\Large{(}XM, YM\Large{)}

integers, like 6

simplified proper fractions, like 3/5

simplified improper fractions, like 7/4

@@ -160,7 +160,7 @@
- (X2, Y2) +

(X2, Y2)

integers, like 6

simplified proper fractions, like 3/5

simplified improper fractions, like 7/4

 @@ -201,8 +201,8 @@
- Balance the scale with UNKNOWN alone on - one side and enter the weight: +

Balance the scale with UNKNOWN alone on + one side and enter the weight:

[
 @@ -19,13 +19,13 @@

- Let's try building the re-arrangements (or permutations) letter by letter. The word is WORD.length - letters long: +

Let's try building the re-arrangements (or permutations) letter by letter. The word is WORD.length + letters long:

_.map(_.range(WORD.length), function(l){ return "_ "; }).join("")

Now, for the first blank, we have WORD.length choices of letters to put in.

- After we put in the first letter, let's say it's PERM[0], we have WORD.length-1 blanks left. +

After we put in the first letter, let's say it's PERM[0], we have WORD.length-1 blanks left.

PERM[0]+" "+_.map(_.range(WORD.length-1), function(l){ return "_ "; }).join("")

For the second blank, we only have WORD.length-1 choices of letters left to put in. So far, there were WORD.length \cdot WORD.length-1 unique choices we could have made.

 @@ -48,35 +48,33 @@

- Let's try building the arrangements (or permutations) letter by letter. The word is WORD.length - letters long: +

Let's try building the arrangements (or permutations) letter by letter. The word is WORD.length + letters long:

_.map(_.range(WORD.length), function(l){ return "_ "; }).join("")

Now, for the first blank, we have WORD.length choices of letters to put in.

- After we put in the first letter, let's say it's PERM[0], we have WORD.length-1 blanks left. +

After we put in the first letter, let's say it's PERM[0], we have WORD.length-1 blanks left.

PERM[0]+" "+_.map(_.range(WORD.length-1), function(l){ return "_ "; }).join("")

For the second blank, we only have WORD.length-1 choices of letters left to put in. So far, there were WORD.length \cdot WORD.length-1 unique choices we could have made.

- We can continue in this fashion to put in a third letter, then a fourth, and so on. At each step, we have one fewer choice to - make, until we get to the last letter, and there's only one we can put in. -

+

We can continue in this fashion to put in a third letter, then a fourth, and so on. At each step, we have one fewer choice to + make, until we get to the last letter, and there's only one we can put in.

- Using this method, the total number of arrangements is _.map(_.range(WORD.length).reverse(), function(l){ return (++l);}).join("\\cdot") = factorial(WORD.length). Another way of writing this is WORD.length!, - or WORD.length factorial, but this isn't quite the right answer. -

+

Using this method, the total number of arrangements is _.map(_.range(WORD.length).reverse(), function(l){ return (++l);}).join("\\cdot") = factorial(WORD.length). Another way of writing this is WORD.length!, + or WORD.length factorial, but this isn't quite the right answer.

- Using the above method, we assumed that all the letters were unique. But they're not! There are REPTIMES +

Using the above method, we assumed that all the letters were unique. But they're not! There are REPTIMES REPLETTERs, so we're counting every permutation multiple times. So every time we have these - factorial(REPTIMES) permutations: + factorial(REPTIMES) permutations:

PERM_UNIQUE.join("</br>")

- We actually should have only one permutation: +

We actually should have only one permutation:

PERM

 @@ -76,7 +76,7 @@ \sin{45}^{\circ} = \dfrac{\sqrt{2}}{2}.

- Solving for x, we get +

Solving for x, we get

\qquad x \cdot \sin {45}^{\circ} = AC

\qquad x \cdot \dfrac{\sqrt{2}}{2} = @@ -138,7 +138,6 @@ Solving for x, we get x = AB \cdot \cos {45}^{\circ} = AB \cdot \dfrac{\sqrt{2}}{2} -

So, x = AB/2 \sqrt{2}. @@ -194,7 +193,6 @@ Solving for x, we get x = AB\sqrt{2} \cdot \cos {45}^{\circ} = AB\sqrt{2} \cdot \dfrac{\sqrt{2}}{2} -

So, x = AB @@ -251,7 +249,7 @@ that \sin{30}^{\circ} = \dfrac{1}{2}.

- Solving for x, we get +

Solving for x, we get

\qquad x \cdot \sin{30}^{\circ} = BCdisp

\qquad x \cdot \dfrac{1}{2} = @@ -314,7 +312,7 @@ that \cos{30}^{\circ} = \dfrac{\sqrt{3}}{2}.

- Solving for x, we get +

Solving for x, we get

\qquad x \cdot \cos{30}^{\circ} = ACdisp

\qquad x \cdot \dfrac{\sqrt{3}}{2} = @@ -376,7 +374,7 @@ that \cos{60}^{\circ} = \dfrac{1}{2}.

- Solving for x, we get +

Solving for x, we get

\qquad x = ABdisp \cdot \cos{60}^{\circ}

\qquad x = ABdisp \cdot @@ -437,7 +435,7 @@ that \sin{60}^{\circ} = \dfrac{\sqrt{3}}{2}.

- Solving for x, we get +

Solving for x, we get

\qquad x = ABs \cdot \sin{60}^{\circ}

 @@ -41,7 +41,7 @@

What is his( 1 ) average speed for the entire trip from home to the store( 1 ) store and back?

- RATE_AVG mph +

RATE_AVG mph

@@ -93,7 +93,7 @@

How many minutes does it take PEOPLE_FINAL people to paint WALL_FINAL walls?

- TIME_FINAL minutes +

TIME_FINAL minutes

Imagine that each person is assigned one wall, and all PEOPLE_INIT people begin painting at the same time.

@@ -115,7 +115,7 @@

PEOPLE_INIT people can paint WALL_INIT walls in TIME_INIT minutes.

How many minutes will it take for PEOPLE_FINAL people to paint WALL_FINAL walls? Round to the nearest minute.

- TIME_FINAL minutes +

TIME_FINAL minutes

the number of minutes, rounded to the nearest minute

 @@ -169,7 +169,7 @@