# Khan/khan-exercises

Move var blocks inside individial problems.

Showing with 43 additions and 39 deletions.
1. +43 −39 exercises/arithmetic_word_problems.html
82 exercises/arithmetic_word_problems.html
 @@ -6,37 +6,21 @@
-
- - randRange( 3, 12 ) - randRange( 1, ITEMS_PER_GROUP - 1 ) - randRange( 2, 12 ) - GROUPS * ITEMS_PER_GROUP - ITEMS_IN_GROUPS + ITEMS_LEFT - - getNontrivialFactor( TOTAL_ITEMS ) - TOTAL_ITEMS / NEW_ITEMS_PER_GROUP - - - randRange( 4, 12 ) - randRange( 4, 12 ) - randRange( 4, 12 ) - ITEM_1_COUNT * ITEM_1_COST - TOTAL_SPENT_ON_1 + ITEM_2_COST - - - randRange( 10, 99 ) - getNontrivialFactor( TOTAL_ITEMS_3 ) - TOTAL_ITEMS_3 / ITEMS_3 - getNontrivialFactor( TOTAL_ITEMS_3 ) - TOTAL_ITEMS_3 / NEW_ITEMS_3 -
-
+ +
+ randRange( 3, 12 ) + randRange( 1, ITEMS_PER_GROUP - 1 ) + randRange( 2, 12 ) + GROUPS * ITEMS_PER_GROUP + ITEMS_IN_GROUPS + ITEMS_LEFT + + getNontrivialFactor( TOTAL_ITEMS ) + TOTAL_ITEMS / NEW_ITEMS_PER_GROUP +
+
person(1) is putting itemPlural(1) into groupPlural(1). @@ -77,6 +61,15 @@
+ +
+ randRange( 4, 12 ) + randRange( 4, 12 ) + randRange( 4, 12 ) + ITEM_1_COUNT * ITEM_1_COST + TOTAL_SPENT_ON_1 + ITEM_2_COST +
+
person(1) bought plural( ITEM_1_COUNT, storeItem(1, 1), storeItemPlural(1, 1) ), all costing the same amount, from the store(1) store. @@ -109,27 +102,38 @@
+ +
+ randRange( 10, 99 ) + getNontrivialFactor( TOTAL_ITEMS ) + TOTAL_ITEMS / ITEMS + getNontrivialFactor( TOTAL_ITEMS ) + TOTAL_ITEMS / NEW_ITEMS +
+
- When person(1) places plural( ITEMS_3, item(1), itemPlural(1) ) in each - group(1) he(1) ends up with plural( GROUPS_3, group(1), groupPlural(1) ). + When person(1) places plural( ITEMS, item(1), itemPlural(1) ) in each + group(1) he(1) ends up with plural( GROUPS, group(1), groupPlural(1) ). - If he(1) wants plural( NEW_GROUPS_3, group(1), groupPlural(1) ), + If he(1) wants plural( NEW_GROUPS, group(1), groupPlural(1) ), how many itemPlural(1) should he(1) put in each group(1)?
-

NEW_ITEMS_3

+

NEW_ITEMS

- plural( ITEMS_3, item(1), itemPlural(1) ) \times - plural( GROUPS_3, group(1), groupPlural(1) ) = - plural( TOTAL_ITEMS_3, item(1), itemPlural(1) ). + plural( ITEMS, item(1), itemPlural(1) ) \times + plural( GROUPS, group(1), groupPlural(1) ) = + plural( TOTAL_ITEMS, item(1), itemPlural(1) ).

- If we divide the plural( TOTAL_ITEMS_3, item(1), itemPlural(1) ) into - plural( NEW_GROUPS_3, group(1), groupPlural(1) ), then we get - TOTAL_ITEMS_3 \div NEW_GROUPS_3 = NEW_ITEMS_3 + If we divide the plural( TOTAL_ITEMS, item(1), itemPlural(1) ) into + plural( NEW_GROUPS, group(1), groupPlural(1) ), then we get + TOTAL_ITEMS \div NEW_GROUPS = NEW_ITEMS itemPlural(1) per group(1).