Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
i18n-ize some exercises
Browse files Browse the repository at this point in the history
Summary:
i18n-ize inscribed angles exercises, indepdent probability, and identifying
points 1

Test Plan: View those exercises, notice that they're not horribly broken

Reviewers: eater, emily

Reviewed By: eater

CC: alpert

Differential Revision: http://phabricator.khanacademy.org/D2063
  • Loading branch information
Michael Chang committed Feb 25, 2013
1 parent f91730c commit 6b75a76
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 38 deletions.
2 changes: 1 addition & 1 deletion exercises/identifying_points_1.html
Expand Up @@ -86,7 +86,7 @@
<div class="graphie" data-update="grid">
var point = POINTS[FORGOTTEN];
label( point, PAIR( point ), "above right");
label( point, "\\text{was not graphed.}", "right" );
label( point, "\\text{" + $._("was not graphed") + "}", "right" );
circle( point, 0.3, { stroke: "red" } );
</div>
</div>
Expand Down
71 changes: 46 additions & 25 deletions exercises/independent_probability.html
Expand Up @@ -10,28 +10,48 @@
<div class="problems">
<div id="coindie">
<div class="vars">
<var id="HT">random() &lt; 0.5 ? "heads" : "tails"</var>
<var id="HT">random() &lt; 0.5 ? $._("heads") : $._("tails")</var>
<var id="RESULT_DESC, RESULT_POSSIBLE">randFromArray([
["a 1", [1]],
["a 2", [2]],
["a 3", [3]],
["a 4", [4]],
["a 5", [5]],
["a 6", [6]],
["at least a 2", [2, 3, 4, 5, 6]],
["at least a 3", [3, 4, 5, 6]],
["at least a 4", [4, 5, 6]],
["more than a 2", [3, 4, 5, 6]],
["more than a 3", [4, 5, 6]],
["more than a 4", [5, 6]],
["less than a 4", [1, 2, 3]],
["less than a 5", [1, 2, 3, 4]],
["less than a 6", [1, 2, 3, 4, 5]],
["an even number", [2, 4, 6]],
["an even number", [2, 4, 6]],
["an odd number", [1, 3, 5]],
["an odd number", [1, 3, 5]],
["a prime number", [2, 3, 5]]
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("a 1"), [1]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("a 2"), [2]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("a 3"), [3]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("a 4"), [4]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("a 5"), [5]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("a 6"), [6]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("at least a 2"), [2, 3, 4, 5, 6]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("at least a 3"), [3, 4, 5, 6]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("at least a 4"), [4, 5, 6]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("more than a 2"), [3, 4, 5, 6]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("more than a 3"), [4, 5, 6]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("more than a 4"), [5, 6]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("less than a 4"), [1, 2, 3]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("less than a 5"), [1, 2, 3, 4]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("less than a 6"), [1, 2, 3, 4, 5]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("an even number"), [2, 4, 6]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("an even number"), [2, 4, 6]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("an odd number"), [1, 3, 5]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("an odd number"), [1, 3, 5]],
/* I18N: Shows up in a question of the form, "what is the probability you will ... roll ___ ?" */
[$._("a prime number"), [2, 3, 5]]
])</var>
<var id="PRETTY_N">RESULT_POSSIBLE.length / getGCD(RESULT_POSSIBLE.length,12)</var>
<var id="PRETTY_D">12 / getGCD(RESULT_POSSIBLE.length,12)</var>
Expand Down Expand Up @@ -65,6 +85,7 @@
</div>
<div id="freethrows">
<div class="vars">
<!-- TODO: i18n the sport to something less US-centric -->
<var id="FREE_THROWS">
[["Carmelo Anthony", .84],
["Trevor Ariza", .70],
Expand Down Expand Up @@ -377,10 +398,10 @@
<var id="P_MISS_PRETTY">"\\dfrac{" + (PIRATE_DEM/PGCD - PIRATE_NUM/PGCD) + "}{" + PIRATE_DEM/PGCD + "}"</var>
<var id="INDEX">randRange(0,3)</var>
<var id="QUESTION">
["the Captain hits the pirate ship, but the pirate misses",
"the pirate hits the Captain's ship, but the Captain misses",
"both the pirate and the Captain hit each other's ships",
"both the Captain and the pirate miss"][INDEX]
[$._("the Captain hits the pirate ship, but the pirate misses"),
$._("the pirate hits the Captain's ship, but the Captain misses"),
$._("both the pirate and the Captain hit each other's ships"),
$._("both the Captain and the pirate miss")][INDEX]
</var>
<var id="ANS_N, ANS_D, ANSWER">
[[CAPTAIN_NUM * (PIRATE_DEM-PIRATE_NUM), CAPTAIN_DEM*PIRATE_DEM, CAPTAIN_PROB*(1-PIRATE_PROB)],
Expand Down
8 changes: 4 additions & 4 deletions exercises/inscribed_angles_1.html
Expand Up @@ -16,8 +16,8 @@
<var id="RADIUS">4</var>

<var id="GIVEN">CENTRAL</var>
<var id="GIVEN_LABEL">"blue"</var>
<var id="ASKED_LABEL">"orange"</var>
<var id="GIVEN_LABEL">$._("blue")</var>
<var id="ASKED_LABEL">$._("orange")</var>
</div>
<p class="question">If the <var>GIVEN_LABEL</var> angle measures <var>GIVEN</var> degrees, what does the <var>ASKED_LABEL</var> angle measure?</p>
<p>This is a special case where the blue and orange angles' sides share the same line. The blue angle is called a central angle, and the orange angle is called an inscribed angle.</p>
Expand Down Expand Up @@ -81,8 +81,8 @@
<div id="find-central-on" data-type="find-angle">
<div class="vars">
<var id="GIVEN">CENTRAL / 2</var>
<var id="GIVEN_LABEL">"orange"</var>
<var id="ASKED_LABEL">"blue"</var>
<var id="GIVEN_LABEL">$._("orange")</var>
<var id="ASKED_LABEL">$._("blue")</var>
</div>
<div class="solution" data-type="multiple">
<span class="sol" data-forms="integer, decimal"><var>CENTRAL</var></span> degrees
Expand Down
8 changes: 4 additions & 4 deletions exercises/inscribed_angles_2.html
Expand Up @@ -16,8 +16,8 @@
<var id="RADIUS">4</var>

<var id="GIVEN">CENTRAL</var>
<var id="GIVEN_LABEL">"blue"</var>
<var id="ASKED_LABEL">"orange"</var>
<var id="GIVEN_LABEL">$._("blue")</var>
<var id="ASKED_LABEL">$._("orange")</var>
</div>
<p class="question">If the <var>GIVEN_LABEL</var> angle measures <var>GIVEN</var> degrees, what does the <var>ASKED_LABEL</var> angle measure?</p>
<p>This is a special case where the center of the circle is inside the inscribed orange angle. The blue angle is called a central angle.</p>
Expand Down Expand Up @@ -92,8 +92,8 @@
<div id="find-central-on" data-type="find-angle">
<div class="vars">
<var id="GIVEN">CENTRAL / 2</var>
<var id="GIVEN_LABEL">"orange"</var>
<var id="ASKED_LABEL">"blue"</var>
<var id="GIVEN_LABEL">$._("orange")</var>
<var id="ASKED_LABEL">$._("blue")</var>
</div>
<div class="solution" data-type="multiple">
<span class="sol" data-forms="integer, decimal"><var>CENTRAL</var></span> degrees
Expand Down
8 changes: 4 additions & 4 deletions exercises/inscribed_angles_3.html
Expand Up @@ -38,8 +38,8 @@
<var id="RADIUS">4</var>

<var id="GIVEN">CENTRAL</var>
<var id="GIVEN_LABEL">"blue"</var>
<var id="ASKED_LABEL">"orange"</var>
<var id="GIVEN_LABEL">$._("blue")</var>
<var id="ASKED_LABEL">$._("orange")</var>
</div>
<p class="question">If the <var>GIVEN_LABEL</var> angle measures <var>GIVEN</var> degrees, what does the <var>ASKED_LABEL</var> angle measure?</p>
<p>This is a special case where the center of the circle is outside the inscribed orange angle. The blue angle is called a central angle.</p>
Expand Down Expand Up @@ -140,8 +140,8 @@
<div id="find-central" data-type="find-inscribed-outside">
<div class="vars">
<var id="GIVEN">CENTRAL / 2</var>
<var id="GIVEN_LABEL">"orange"</var>
<var id="ASKED_LABEL">"blue"</var>
<var id="GIVEN_LABEL">$._("orange")</var>
<var id="ASKED_LABEL">$._("blue")</var>
</div>
<div class="solution" data-type="multiple">
<span class="sol" data-forms="integer, decimal"><var>CENTRAL</var></span> degrees
Expand Down

0 comments on commit 6b75a76

Please sign in to comment.