forked from Khan/khan-exercises
/
multiplication_1.html
62 lines (61 loc) · 2.56 KB
/
multiplication_1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html data-require="math graphie graphie-helpers-arithmetic word-problems">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Multiplication 1</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="A">randRange( 1, 10 )</var>
<var id="B">randRange( 0, 10 )</var>
</div>
<div class="problems">
<div>
<div class="graphie" id="numbers">
init({
range: [ [ -1, 12], [ -3, B + 1 ] ],
scale: [ 50, 50 ]
});
KhanUtil.currentGraph.labelHolder = label( [ 0, B ],
"\\Huge{\\color{#6495ED}{" + A + "} \\times \\color{#28AE7B}{" + B + "} = {?}}", "right" );
</div>
<div class="solution"><var>A * B</var></div>
</div>
</div>
<div class="hints">
<div data-if="B > 0" data-unwrap>
<div>
<div class="graphie" data-update="numbers">
label( [ 0, B - 1 ], "Draw " + plural( A, "circle" ) + ".", "right", false );
drawRow( A, B - 3, "#6495ED", 1 );
</div>
</div>
<div>
<div class="graphie" data-update="numbers">
label( [ 0, B - 2 ],
"If there" + ( B === 1 ? " is " : " are " ) + plural( B, "row" )
+ " with " + plural( A, "circle" ) + ( B === 1 ? "" : " each" )
+ ",<br>there are a total of how many circles?",
"right", false );
for ( var i = 1; i < B; i++ ) {
drawRow( A, B - 3 - i, "#28AE7B", A * i + 1 );
}
</div>
</div>
</div>
<div data-else>
<div class="graphie" data-update="numbers">
label( [ 0, B - 1 ], "\\large{\\text{Multiplying any number by 0 equals 0.}}", "right" );
</div>
</div>
<div class="graphie" data-update="numbers">
KhanUtil.currentGraph.labelHolder.remove();
label( [ 0, B ],
"\\Huge{\\color{#6495ED}{" + A + "} \\times \\color{#28AE7B}{" + B + "} = " + ( A * B ) + "}", "right" );
</div>
</div>
</div>
</body>
</html>