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

Commit

Permalink
Fix coach report answer correctness color
Browse files Browse the repository at this point in the history
Summary:
Addresses issue (https://code.google.com/p/khanacademy/issues/detail?id=23292) / task (http://phabricator.khanacademy.org/T1877)

Maybe at some point the validator just returned true/false; now it returns an object, of which x.correct returns true/false.

Possible Concerns:
Do I need to check that the object exists? I don't think so, because if there is a validator to begin with, it should return an object (as far as I know in Perseus)

I'd push, but I forgot my Github password and was too lazy to reset it.

Test Plan: (1) Check that it's the right color

Reviewers: alex

Reviewed By: alex

Subscribers: alpert, khirasaki

Differential Revision: http://phabricator.khanacademy.org/D7616
  • Loading branch information
Brian Merlob committed Mar 25, 2014
1 parent 4ed4e11 commit 75b5e8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions history.js
Expand Up @@ -161,7 +161,7 @@ function renderReadOnlyProblem(event, args) {
(guess.value != null ? guess.value : guess) +
"</p>").runModules()
);
if (validator(guess)) {
if (validator(guess).correct) {
thissolutionarea
.removeClass("incorrect-activity")
.addClass("correct-activity");
Expand All @@ -170,7 +170,7 @@ function renderReadOnlyProblem(event, args) {
thissolutionarea.attr("title", $._("Incorrect Answer"));
}
} else if (answerType === "custom") {
if (validator(guess)) {
if (validator(guess).correct) {
thissolutionarea
.removeClass("incorrect-activity")
.addClass("correct-activity");
Expand All @@ -192,7 +192,7 @@ function renderReadOnlyProblem(event, args) {

thisAnswerData.showGuess(guess);

if (thisAnswerData.validator(guess) === true) {
if (thisAnswerData.validator(guess).correct) {
// If the user didn't get the problem right on the first try, all
// answers are labelled incorrect by default
thissolutionarea
Expand Down

0 comments on commit 75b5e8a

Please sign in to comment.