Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
74 lines (71 sloc) 3.27 KB
<!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>Basic multiplication</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="A">randRange(0, 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" data-forms="integer"><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 ],
$.ngettext("Draw %(num)s circle.", "Draw %(num)s circles.", A),
"right", false );
drawRow( A, B - 3, "#6495ED", 1 );
</div>
</div>
<div>
<div class="graphie" data-update="numbers">
if (isSingular(A)) {
label( [ 0, B - 2 ],
$.ngettext(
"If there is %(num)s row with %(a)s circle, &lt;br&gt; there are a total of how many circles?",
"If there are %(num)s rows with %(a)s circle each, &lt;br&gt;there are a total of how many circles?",
B, {a: A}), "right", false );
} else {
label( [ 0, B - 2 ],
$.ngettext(
"If there is %(num)s row with %(a)s circles, &lt;br&gt; there are a total of how many circles?",
"If there are %(num)s rows with %(a)s circles each, &lt;br&gt;there are a total of how many circles?",
B, {a: A}), "right", false );
}
for ( var i = 1; i &lt; 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>
Jump to Line
Something went wrong with that request. Please try again.