This repository has been archived by the owner on May 11, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Comparing fractions with the same denom
Summary: Finish hints Reviewers: eater Reviewed By: eater Differential Revision: http://phabricator.khanacademy.org/D7144
- Loading branch information
1 parent
ae23541
commit 67b0727
Showing
6 changed files
with
239 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
234 changes: 234 additions & 0 deletions
234
exercises/comparing_fractions_with_the_same_denominator.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,234 @@ | ||
<!DOCTYPE html> | ||
<html data-require="math math-format interactive graphie graphie-helpers word-problems"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title>Ordering fractions with the same denominator</title> | ||
<script src="../khan-exercise.js"></script> | ||
</head> | ||
<body> | ||
<div class="exercise"> | ||
<div class="problems"> | ||
<div id="ordering"> | ||
<div class="vars" data-ensure="NUMERATORS.join(',') !== SORTED_LIST"> | ||
<var id="NUM_ITEMS">3</var> | ||
<var id="DENOMINATOR">randFromArray([3, 4, 6, 8])</var> | ||
<var id="NUMERATORS">randRangeUnique(1, DENOMINATOR, NUM_ITEMS)</var> | ||
<var id="NUMS_SORTED">$.map(NUMERATORS, function(el) { | ||
return el; | ||
}).sort(function(a, b) { | ||
return a - b; | ||
})</var> | ||
<var id="SORTED_LIST">NUMS_SORTED.join(",")</var> | ||
<var id="ANSWER">$.map(NUMS_SORTED, function(el) { | ||
return "\\dfrac{" + el + "}{" + DENOMINATOR + "}"; | ||
}).join(",")</var> | ||
<var id="SORTER">createSorter()</var> | ||
</div> | ||
|
||
<div class="question"> | ||
<p>Order the following fractions from least to greatest:</p> | ||
<ul id="sortable"> | ||
<li data-each="NUMERATORS as N"> | ||
<span class="sort-key"><var>N</var></span> | ||
<code>\dfrac{<var>N</var>}{<var>DENOMINATOR</var>}</code> | ||
</li> | ||
</ul> | ||
<p><var>SORTER.init("sortable")</var></p> | ||
|
||
</div> | ||
|
||
<div class="solution" data-type="custom"> | ||
<div class="instruction"> | ||
Drag the fractions left and right so they are in order from least to greatest | ||
</div> | ||
<div class="guess">SORTER.getContent()</div> | ||
<div class="validator-function"> | ||
if (SORTER.hasAttempted) { | ||
return guess.join(",") === SORTED_LIST; | ||
} else { | ||
return ""; | ||
} | ||
</div> | ||
<div class="show-guess"> | ||
SORTER.setContent(guess); | ||
</div> | ||
</div> | ||
|
||
<div class="hints"> | ||
<div> | ||
<p>We can draw a picture to compare the fractions.</p> | ||
<div class="graphie"> | ||
init({ | ||
range: [[-0.1, 1], [0, NUM_ITEMS * 2]], | ||
scale: [400, 25] | ||
}); | ||
for (var i = 0; i < NUM_ITEMS; i++) { | ||
var y = (NUM_ITEMS - i - 1) * 2; | ||
rectchart([NUMERATORS[i], DENOMINATOR - NUMERATORS[i]], [RED, GRAY], y); | ||
label([-0.05, y + 0.5], "\\dfrac{" + NUMERATORS[i] + "}{" + DENOMINATOR + "}"); | ||
} | ||
</div> | ||
</div> | ||
<p>The order from least to greatest is: <code><var>ANSWER</var></code>.</p> | ||
</div> | ||
</div> | ||
|
||
<div id="comparison-operator"> | ||
<div class="vars"> | ||
<var id="DENOMINATOR">randFromArray([3, 4, 6, 8])</var> | ||
<var id="NUMERATOR_1">randRange(1, DENOMINATOR)</var> | ||
<var id="NUMERATOR_2">randRangeExclude(1, DENOMINATOR, [NUMERATOR_1])</var> | ||
<var id="SOLUTION">NUMERATOR_1 < NUMERATOR_2 ? "<" : ">"</var> | ||
</div> | ||
|
||
<div class="problem"> | ||
<p>Fill in the blank.</p> | ||
<p> | ||
<code>\dfrac{<var>NUMERATOR_1</var>}{<var>DENOMINATOR</var>}</code> ____ | ||
<code>\dfrac{<var>NUMERATOR_2</var>}{<var>DENOMINATOR</var>}</code> | ||
</p> | ||
</div> | ||
<p class="solution"><code><var>SOLUTION</var></code></p> | ||
<ul class="choices" data-category="true"> | ||
<li><code><</code></li> | ||
<li><code>></code></li> | ||
</ul> | ||
<div class="hints"> | ||
<div> | ||
<p>We can draw a picture to compare the fractions.</p> | ||
<div class="graphie"> | ||
init({ | ||
range: [[-0.1, 1], [0, 5.5]], | ||
scale: [425, 25] | ||
}); | ||
|
||
rectchart([NUMERATOR_1, DENOMINATOR - NUMERATOR_1], [RED, GRAY], 3); | ||
rectchart([NUMERATOR_2, DENOMINATOR - NUMERATOR_2], [RED, GRAY], 1); | ||
label([-0.05, 3.5], "\\dfrac{" + NUMERATOR_1 + "}{" + DENOMINATOR + "}"); | ||
label([-0.05, 1.5], "\\dfrac{" + NUMERATOR_2 + "}{" + DENOMINATOR + "}"); | ||
</div> | ||
</div> | ||
<p> | ||
<code>\dfrac{<var>NUMERATOR_1</var>}{<var>DENOMINATOR</var>} <var>SOLUTION</var> | ||
\dfrac{<var>NUMERATOR_2</var>}{<var>DENOMINATOR</var>}</code> | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div id="number-line"> | ||
<div class="vars"> | ||
<var id="DENOMINATOR">randFromArray([2, 3, 4, 6, 8])</var> | ||
<var id="NUMERATOR_1">randRange(1, 10)</var> | ||
<var id="NUMERATOR_2">randRangeExclude(1, 10, [NUMERATOR_1])</var> | ||
<var id="MAX_NUM">ceil(max(NUMERATOR_1, NUMERATOR_2) / DENOMINATOR)</var> | ||
<var id="SOLUTION">randFromArray(["A", "B"])</var> | ||
</div> | ||
|
||
<div class="problem"> | ||
<p>Which number line correctly shows | ||
<code>\dfrac{<var>NUMERATOR_1</var>}{<var>DENOMINATOR</var>}</code> and | ||
<code>\dfrac{<var>NUMERATOR_2</var>}{<var>DENOMINATOR</var>}</code>? | ||
</p> | ||
<div class="graphie"> | ||
init({ | ||
range: [[-0.15, 1.1], [0, 7]], | ||
scale: [400, 25] | ||
}); | ||
|
||
var tick = 0.25; | ||
var labels = [ | ||
0, | ||
"\\dfrac{" + NUMERATOR_1 + "}{" + DENOMINATOR + "}", | ||
"\\dfrac{" + NUMERATOR_2 + "}{" + DENOMINATOR + "}" | ||
]; | ||
|
||
var drawNumberLine = function(y, name, numbers) { | ||
// Seems this only adds an arrow to one end | ||
line([-0.05, y], [1.05, y], { arrows: "<->" }); | ||
line([1.05, y], [-0.05, y], { arrows: "<->" }); | ||
label([-0.1, y], name); | ||
|
||
for (var i = 0; i < numbers.length; i++) { | ||
var x = numbers[i] / DENOMINATOR / MAX_NUM; | ||
line([x, y - tick], [x, y + tick]); | ||
label([x, y - 0.2], labels[i], "below"); | ||
} | ||
}; | ||
|
||
if (SOLUTION === "A") { | ||
drawNumberLine(6, "A", [0, NUMERATOR_1, NUMERATOR_2]); | ||
drawNumberLine(2, "B", [0, NUMERATOR_2, NUMERATOR_1]); | ||
} else { | ||
drawNumberLine(6, "A", [0, NUMERATOR_2, NUMERATOR_1]); | ||
drawNumberLine(2, "B", [0, NUMERATOR_1, NUMERATOR_2]); | ||
} | ||
</div> | ||
</div> | ||
<div class="solution">Number line <code><var>SOLUTION</var></code></div> | ||
<ul class="choices" data-category="true"> | ||
<li>Number line <code>A</code></li> | ||
<li>Number line <code>B</code></li> | ||
</ul> | ||
<div class="hints"> | ||
<div> | ||
<p> | ||
We can draw a picture of a number line showing <code>1</code> divided into <code><var>DENOMINATOR</var></code> equal pieces of | ||
<code>\dfrac{1}{<var>DENOMINATOR</var>}</code> to compare the fractions. | ||
</p> | ||
<div class="graphie" id="hint-line"> | ||
init({ | ||
range: [[-0.1, 1.1], [0, 3]], | ||
scale: [400, 25] | ||
}); | ||
|
||
var y = 2; | ||
line([-0.05, y], [1.05, y], { arrows: "<->" }); | ||
line([1.05, y], [-0.05, y], { arrows: "<->" }); | ||
|
||
var tick = 0.25 | ||
for (var i = 0; i <= MAX_NUM * DENOMINATOR; i++) { | ||
var x = i / DENOMINATOR / MAX_NUM; | ||
line([x, y - tick], [x, y + tick]); | ||
if (i % DENOMINATOR === 0) { | ||
label([x, y], roundTo(1, i / DENOMINATOR), "above"); | ||
} | ||
} | ||
</div> | ||
</div> | ||
<div> | ||
<p data-if="isSingular(NUMERATOR_1)"> | ||
Count <code>\blue{<var>NUMERATOR_1</var>}</code> tick along to add | ||
<code>\blue{\dfrac{<var>NUMERATOR_1</var>}{<var>DENOMINATOR</var>}}</code> to the number line. | ||
</p> | ||
<p data-else=""> | ||
Count <code>\blue{<var>NUMERATOR_1</var>}</code> ticks along to add | ||
<code>\blue{\dfrac{<var>NUMERATOR_1</var>}{<var>DENOMINATOR</var>}}</code> to the number line. | ||
</p> | ||
<p data-if="isSingular(NUMERATOR_2)"> | ||
Count <code>\red{<var>NUMERATOR_2</var>}</code> tick along to add | ||
<code>\red{\dfrac{<var>NUMERATOR_2</var>}{<var>DENOMINATOR</var>}}</code> to the number line. | ||
</p> | ||
<p data-else=""> | ||
Count <code>\red{<var>NUMERATOR_2</var>}</code> ticks along to add | ||
<code>\red{\dfrac{<var>NUMERATOR_2</var>}{<var>DENOMINATOR</var>}}</code> to the number line. | ||
</p> | ||
<div class="graphie" data-update="hint-line"> | ||
label( | ||
[NUMERATOR_1 / DENOMINATOR / MAX_NUM, 1.8], | ||
"\\blue{\\dfrac{" + NUMERATOR_1 + "}{" + DENOMINATOR + "}}", | ||
"below" | ||
); | ||
label( | ||
[NUMERATOR_2 / DENOMINATOR / MAX_NUM, 1.8], | ||
"\\red{\\dfrac{" + NUMERATOR_2 + "}{" + DENOMINATOR + "}}", | ||
"below" | ||
); | ||
</div> | ||
</div> | ||
<p>So number line <code><var>SOLUTION</var></code> is correct.</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters