This repository has been archived by the owner on May 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 863
/
addition_2.html
50 lines (47 loc) · 2.05 KB
/
addition_2.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
<!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>Add within 20</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="A">randRange(1, 19)</var>
<var id="B">randRange(1, 20 - A)</var>
</div>
<div class="problems">
<div>
<div class="question">
<div class="graphie">
init({
range: [[0, 12], [-1, 1]]
});
var equation = rand(2) === 0 ?
"\\Huge{\\blue{" + A + "} + \\green{" + B + "} = {?}}" :
"\\Huge{{?} = \\blue{" + A + "} + \\green{" + B + "}}"
label([0, 0], equation, "right");
</div>
</div>
<div class="solution" data-forms="integer"><var>A + B</var></div>
<div class="hints">
<div class="graphie" style="float: left;">
drawCircles(A, BLUE);
</div>
<div class="graphie" style="float: left;">
drawCircles(B, GREEN);
</div>
<p style="clear: left;">
<span data-if="isSingular(A)">There is <code>\blue{<var>A</var>}</code> blue dot.</span>
<span data-else="">There are <code>\blue{<var>A</var>}</code> blue dots.</span>
<span data-if="isSingular(B)">There is <code>\green{<var>B</var>}</code> green dot.</span>
<span data-else="">There are <code>\green{<var>B</var>}</code> green dots.</span>
</p>
<p>There are a total of <var>A + B</var> dots.</p>
</div>
</div>
</div>
</div>
</body>
</html>