diff --git a/exercises/converting_decimals_to_percents.html b/exercises/converting_decimals_to_percents.html index 3c602abe5..98960649b 100644 --- a/exercises/converting_decimals_to_percents.html +++ b/exercises/converting_decimals_to_percents.html @@ -15,7 +15,7 @@

Express the decimal as a percent.

DECIMAL

-

PERCENT

+

DECIMAL

Rewrite the decimal as a fraction with a denominator of 100.

diff --git a/exercises/empirical_rule.html b/exercises/empirical_rule.html index a12a5d9b5..4f7a790fe 100644 --- a/exercises/empirical_rule.html +++ b/exercises/empirical_rule.html @@ -51,7 +51,7 @@ roundTo( 1, MEAN + STDDEV * Z ) years.

-
ANSWER
+
ANSWER / 100

We can try to estimate using the empirical rule, also known as the 68-95-99.7 percent rule.

@@ -396,7 +396,7 @@ roundTo( 1, MEAN + STDDEV * Z1 ) and roundTo( 1, MEAN + STDDEV * Z2 ) years.

-
AREA
+
AREA / 100
diff --git a/exercises/independent_probability.html b/exercises/independent_probability.html index eadbeadec..a336cb491 100644 --- a/exercises/independent_probability.html +++ b/exercises/independent_probability.html @@ -41,7 +41,7 @@ If you flip a coin and roll a 6-sided die, what is the probability that you will flip a HT and roll RESULT_DESC?

-
0.5 * RESULT_POSSIBLE.length / 6
+
0.5 * RESULT_POSSIBLE.length / 6

@@ -408,7 +408,7 @@ If both fire their cannons at the same time, what is the probability that QUESTION?

-
ANSWER
+
ANSWER

diff --git a/exercises/percentage_word_problems_1.html b/exercises/percentage_word_problems_1.html index 0355f1cc1..1dd246fae 100644 --- a/exercises/percentage_word_problems_1.html +++ b/exercises/percentage_word_problems_1.html @@ -42,7 +42,7 @@

person(1) has BANK_MORE dollars in the bank today. Yesterday, he(1) had BANK_FEWER dollars in the bank. By what percentage did person(1)'s bank account increase over the past day? (Round your answer to the nearest hundredth of a percent.)

-

round(((BANK_MORE - BANK_FEWER) * 10000) / BANK_FEWER) / 100

+

roundTo(4, (BANK_MORE - BANK_FEWER) / BANK_FEWER)

The bank account grew by BANK_MORE - BANK_FEWER = BANK_MORE - BANK_FEWER dollars

\frac{BANK_MORE - BANK_FEWER}{BANK_FEWER} \approx round(((BANK_MORE - BANK_FEWER) * 10000) / BANK_FEWER) / 100\%

@@ -51,7 +51,7 @@

person(1) has BANK_FEWER dollars in the bank today. Yesterday, he(1) had BANK_MORE dollars in the bank. By what percentage did person(1)'s bank account decrease over the past day? (Round your answer to the nearest hundredth of a percent.)

-

round(((BANK_MORE - BANK_FEWER) * 10000) / BANK_MORE) / 100

+

roundTo(4, (BANK_MORE - BANK_FEWER) / BANK_MORE)

The bank account decreased by BANK_MORE - BANK_FEWER = BANK_MORE - BANK_FEWER dollars

\frac{BANK_MORE - BANK_FEWER}{BANK_MORE} \approx round(((BANK_MORE - BANK_FEWER) * 10000) / BANK_MORE) / 100\%

diff --git a/exercises/z_scores_2.html b/exercises/z_scores_2.html index d30075359..9559cf845 100644 --- a/exercises/z_scores_2.html +++ b/exercises/z_scores_2.html @@ -69,8 +69,8 @@
rowzgrid
-
- roundTo(2, ANSWER * 100) +
+ roundTo(4, ANSWER)
diff --git a/exercises/z_scores_3.html b/exercises/z_scores_3.html index ab669fa88..07f0e1c6c 100644 --- a/exercises/z_scores_3.html +++ b/exercises/z_scores_3.html @@ -106,8 +106,8 @@
rowzgrid
-
- roundTo( 2, ANSWER * 100 ) +
+ roundTo(4, ANSWER)
diff --git a/utils/answer-types.js b/utils/answer-types.js index d62867663..6337c1299 100644 --- a/utils/answer-types.js +++ b/utils/answer-types.js @@ -211,6 +211,15 @@ Khan.answerTypes = $.extend(Khan.answerTypes, { }, $(solution).data()); var acceptableForms = options.forms.split(/\s*,\s*/); + // If percent is an acceptable form, make sure it's the last one + // in the list so we don't prematurely complain about not having + // a percent sign when the user entered the correct answer in a + // different form (such as a decimal or fraction) + if (_.contains(acceptableForms, "percent")) { + acceptableForms = _.without(acceptableForms, "percent"); + acceptableForms.push("percent"); + } + // Take text looking like a fraction, and turn it into a number var fractionTransformer = function(text) { text = text @@ -374,6 +383,7 @@ Khan.answerTypes = $.extend(Khan.answerTypes, { var transformed = forms.decimal(text); $.each(transformed, function(ix, t) { t.exact = hasPercentSign; + t.value = t.value / 100; }); return transformed; },