Permalink
Fetching contributors…
Cannot retrieve contributors at this time
58 lines (56 sloc) 2.85 KB
<!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 &gt; 0 || SMALL_FACTOR_DECIMAL &gt; 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">[]</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>