Permalink
Browse files

Make primeFactorization also take a * (fix #373)

  • Loading branch information...
1 parent b07bfad commit 7f507638fa1a9466b3a8f09c93b403daac175575 @spicyj spicyj committed Jul 23, 2011
Showing with 5 additions and 4 deletions.
  1. +5 −4 utils/answer-types.js
View
@@ -24,7 +24,7 @@ jQuery.extend( Khan.answerTypes, {
input.val() :
fallback ?
fallback + "" :
- ""
+ "";
ret.guess = val;
@@ -54,7 +54,7 @@ jQuery.extend( Khan.answerTypes, {
}
guess = jQuery.trim( guess.substring( 0, guess.length - 1) );
return Khan.answerTypes.decimalVerifier( correct, guess );
- }
+ };
return Khan.answerTypes.text( solutionarea, solution, fallback, verifier );
},
@@ -335,9 +335,10 @@ jQuery.extend( Khan.answerTypes, {
primeFactorization: function( solutionarea, solution, fallback ) {
var verifier = function( correct, guess ) {
guess = guess.split(" ").join("").toLowerCase();
- guess = KhanUtil.sortNumbers( guess.split( "x" ) ).join( "x" );
+ guess = KhanUtil.sortNumbers( guess.split( /x|\*/ ) ).join( "x" );
return guess === correct;
- }
+ };
+
return Khan.answerTypes.text( solutionarea, solution, fallback, verifier );
}
} );

0 comments on commit 7f50763

Please sign in to comment.