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
/
multiplying_decimals.html
57 lines (56 loc) · 2.99 KB
/
multiplying_decimals.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
<!DOCTYPE html>
<html data-require="math math-format graphie graphie-helpers-arithmetic word-problems">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Multiplying decimals</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="SMALL_FACTOR">randRange( 100, 999 )</var>
<var id="BIG_FACTOR">randRange( 100, 999 )</var>
<var id="PRODUCT">SMALL_FACTOR * BIG_FACTOR</var>
<div data-ensure="BIG_FACTOR_DECIMAL > 0 || SMALL_FACTOR_DECIMAL > 0">
<var id="BIG_FACTOR_DECIMAL">randRange( 0, 3 )</var>
<var id="SMALL_FACTOR_DECIMAL">randRange( 0, 3 )</var>
</div>
<var id="SMALL_FACTOR_DIGITS">padDigitsToNum( digits( SMALL_FACTOR ), SMALL_FACTOR_DECIMAL + 1 )</var>
<var id="BIG_FACTOR_DIGITS">padDigitsToNum( digits( BIG_FACTOR ), BIG_FACTOR_DECIMAL + 1 )</var>
<var id="ANSWER">PRODUCT / pow(10, BIG_FACTOR_DECIMAL + SMALL_FACTOR_DECIMAL)</var>
<var id="DUMMY">Array( new Multiplier(BIG_FACTOR, SMALL_FACTOR, BIG_FACTOR_DIGITS, SMALL_FACTOR_DIGITS, BIG_FACTOR_DECIMAL, SMALL_FACTOR_DECIMAL).getNumHints() )</var>
</div>
<div class="problems">
<div>
<p class="problem"><code>
\Large{<var>localeToFixed(BIG_FACTOR * pow(10, -BIG_FACTOR_DECIMAL), BIG_FACTOR_DECIMAL)</var> \times
<var>localeToFixed(SMALL_FACTOR * pow(10, -SMALL_FACTOR_DECIMAL), SMALL_FACTOR_DECIMAL)</var> = {?}}
</code></p>
<div class="render-answer-area-here"></div>
<div class="graphie" id="numbers">
graph.multiplier = new Multiplier(BIG_FACTOR, SMALL_FACTOR, BIG_FACTOR_DIGITS, SMALL_FACTOR_DIGITS, BIG_FACTOR_DECIMAL, SMALL_FACTOR_DECIMAL);
DUMMY = Array( graph.multiplier.getNumHints() );
</div>
<div class="solution" data-type="decimal"><var>ANSWER</var></div>
</div>
</div>
<div class="hints">
<div class="graphie" data-update="numbers">
graph.multiplier.show();
graph.multiplier.showDecimals();
</div>
<div class="graphie" data-each="DUMMY as dummy" data-update="numbers">
graph.multiplier.showHint();
</div>
<div class="graphie" data-update="numbers">
graph.multiplier.showDecimalsInProduct();
</div>
<p><code>\Large{
<var>localeToFixed(BIG_FACTOR * pow(10, -BIG_FACTOR_DECIMAL), BIG_FACTOR_DECIMAL)</var> \times
<var>localeToFixed(SMALL_FACTOR * pow(10, -SMALL_FACTOR_DECIMAL), SMALL_FACTOR_DECIMAL)</var> =
<var>localeToFixed(ANSWER, BIG_FACTOR_DECIMAL + SMALL_FACTOR_DECIMAL)</var>}
</code></p>
</div>
</div>
</body>
</html>