# Khan/khan-exercises

### Subversion checkout URL

You can clone with
or
.
Older
100644 164 lines (142 sloc) 7.18 KB
 7d43e3c Add exercise: Divisibility intuition beneater authored May 25, 2012 1 7041f1b Re-run the linter on the exercises. jeresig authored Apr 23, 2013 2 3 c6949fe Running the clean-exercises.py script against the exercises. jeresig authored Apr 17, 2013 4 7d43e3c Add exercise: Divisibility intuition beneater authored May 26, 2012 5 Divisibility intuition ac1415e Use requirejs for module loading spicyj authored Mar 5, 2014 6 7d43e3c Add exercise: Divisibility intuition beneater authored May 26, 2012 7 8 9
10
11
12
13 randRange(4, 20) 14 getFactors(NUMBER) 15
16 a09b0b2 Specific that factors should be positive and make numbers mathy petercollingridge authored Sep 22, 2014 17

What are the positive factors of NUMBER?

7d43e3c Add exercise: Divisibility intuition beneater authored May 26, 2012 18 35e1ca9 Rearrange answer area content within some exercises xymostech authored Nov 13, 2014 19

20 7d43e3c Add exercise: Divisibility intuition beneater authored May 26, 2012 21
22

a09b0b2 Specific that factors should be positive and make numbers mathy petercollingridge authored Sep 22, 2014 23 You can resize this box with NUMBER dots to help you find the factors: 7d43e3c Add exercise: Divisibility intuition beneater authored May 26, 2012 24

25
26 init({ range: [[-3, NUMBER + 3], [-NUMBER - 3, 3]], scale: [20, 20] }); 27 addMouseLayer(); 28 29 graph.width = NUMBER; 30 graph.height = 1; 31 32 graph.set = bogusShape; 33 graph.handle = bogusShape; 34 graph.topLabel = bogusShape; 35 graph.leftLabel = bogusShape; 36 37 graph.redraw = function() { 38 graph.set.remove(); 39 graph.topLabel.remove(); 40 graph.leftLabel.remove(); 41 graph.height = ceil(NUMBER / graph.width); 42 init({ range: [[-3, graph.width + 3], [-graph.height - 2, 3]], scale: [20, 20] }); 43 44 graph.set = raphael.set(); 45 graph.set.push(path([ 46 [-1, 1], 47 [graph.width, 1], 48 [graph.width, -graph.height], 49 [-1, -graph.height], 50 [-1, 1], [1, 1]],{ stroke: BLUE, opacity: 1.0 })); 51 52 _(NUMBER).times(function(i) { 53 graph.set.push(circle([i % graph.width, -floor(i / graph.width)], 0.25, 54 { stroke: BLUE, fill: BLUE, opacity: 0.6 })); 55 }); 56 c905494 Revert to Raphael 1.5.2 beneater authored Jun 28, 2012 57 graph.handle.translate( 58 graph.width * 20 - graph.handle[0].attr("translation").x, 59 graph.height * 10 - graph.handle[0].attr("translation").y); 7d43e3c Add exercise: Divisibility intuition beneater authored May 26, 2012 60 61 graph.topLabel = label([graph.width / 2 - 0.5, 1], graph.width, "above"); 62 graph.leftLabel = label([-1, -graph.height / 2 + 0.5], graph.height, "left"); 63 }; 64 65 graph.dragHandle = addMovablePoint({ 66 coord: [graph.width, -graph.height / 2 + 0.5], 67 constraints: { 68 constrainY: true 69 }, 70 snapX: 1, 71 onMove: function(x, y) { 72 graph.width = min(max(x, 1), NUMBER); 73 graph.redraw(); 74 return [graph.width, -graph.height / 2 + 0.5]; 75 } 76 }); 77 78 graph.handle = raphael.set(); 79 graph.handle.push(line( 80 [-0.12, 0], 81 [-0.12, 1], { stroke: BLUE, opacity: 1.0 })); 82 graph.handle.push(line( 83 [0.12, 0], 84 [0.12, 1], { stroke: BLUE, opacity: 1.0 })); 85 86 graph.dragHandle.visibleShape.remove(); 87 graph.dragHandle.mouseTarget.attr({ scale: 2.0 }); 88 a31d22f Use mouseTarget.getMouseTarget() where applicable crm416 authored Jan 9, 2015 89 var \$mouseTarget = \$(graph.dragHandle.mouseTarget.getMouseTarget()); 90 \$mouseTarget.bind("vmouseover", function(event) { c905494 Revert to Raphael 1.5.2 beneater authored Jun 29, 2012 91 graph.handle.animate({ scale: 1.5, stroke: BLUE }, 50); 7d43e3c Add exercise: Divisibility intuition beneater authored May 26, 2012 92 }); a31d22f Use mouseTarget.getMouseTarget() where applicable crm416 authored Jan 9, 2015 93 \$mouseTarget.bind("vmouseout", function(event) { c905494 Revert to Raphael 1.5.2 beneater authored Jun 29, 2012 94 graph.handle.animate({ scale: 1.0, stroke: BLUE }, 50); 7d43e3c Add exercise: Divisibility intuition beneater authored May 26, 2012 95 }); 96 97 graph.redraw(); 98 99
100
c6949fe Running the clean-exercises.py script against the exercises. jeresig authored Apr 17, 2013 101
102 FACTOR 7d43e3c Add exercise: Divisibility intuition beneater authored May 26, 2012 103

cbccff8 Apply fixes to exercises again, after fixing some more bugs. jeresig authored Apr 15, 2013 104 Enter all the different factors you can find (one factor per box):
35e1ca9 Rearrange answer area content within some exercises xymostech authored Nov 14, 2014 105 106 c6949fe Running the clean-exercises.py script against the exercises. jeresig authored Apr 17, 2013 107
35e1ca9 Rearrange answer area content within some exercises xymostech authored Nov 14, 2014 108 109 c6949fe Running the clean-exercises.py script against the exercises. jeresig authored Apr 17, 2013 110
35e1ca9 Rearrange answer area content within some exercises xymostech authored Nov 14, 2014 111 112 c6949fe Running the clean-exercises.py script against the exercises. jeresig authored Apr 17, 2013 113 7d43e3c Add exercise: Divisibility intuition beneater authored May 26, 2012 114

115 116
117
118
119 120
121
122

a09b0b2 Specific that factors should be positive and make numbers mathy petercollingridge authored Sep 22, 2014 123 124 The NUMBER dots can be arranged in NUMBER / FACTOR row. 125 126 The NUMBER dots can be arranged in NUMBER / FACTOR rows. 127 128 129 Each row has FACTOR dot each, so 130 \pink{NUMBER / FACTOR} is a factor of NUMBER: 131 132 Each row has FACTOR dots each, so 133 \pink{NUMBER / FACTOR} is a factor of NUMBER: 134 7d43e3c Add exercise: Divisibility intuition beneater authored May 26, 2012 135

136
137 graph.width = FACTOR; 138 graph.height = ceil(NUMBER / graph.width); 139 init({ range: [[-3, graph.width + 3], [-graph.height - 2, 3]], scale: [7, 7] }); 140 141 graph.set = raphael.set(); 142 graph.set.push(path([ 143 [-1, 1], 144 [graph.width, 1], 145 [graph.width, -graph.height], 146 [-1, -graph.height], 147 [-1, 1], [1, 1]],{ stroke: BLUE, opacity: 1.0 })); 148 149 _(NUMBER).times(function(i) { 150 graph.set.push(circle([i % graph.width, -floor(i / graph.width)], 0.25, 151 { stroke: BLUE, fill: BLUE, opacity: 0.6 })); 152 }); 153
154
155

a09b0b2 Specific that factors should be positive and make numbers mathy petercollingridge authored Sep 22, 2014 156 The positive factors of NUMBER are fbe052d Resolve some I18N todos, and simplify toSentence. csilvers authored May 31, 2013 157 toSentenceTex(FACTORS.reverse(), function(){return true;}, "hint_pink"). 7d43e3c Add exercise: Divisibility intuition beneater authored May 26, 2012 158

159
160 161
7041f1b Re-run the linter on the exercises. jeresig authored Apr 23, 2013 162 163
Something went wrong with that request. Please try again.