Created
May 16, 2013 14:00
-
-
Save jewlofthelotus/5591940 to your computer and use it in GitHub Desktop.
Adjusting the level calculation for 3 ranking levels.
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
// Calculates knowledge level based on number of correct answers | |
calculateLevel: function(correctAnswers) { | |
var percent = (correctAnswers / questionCount).toFixed(2), | |
level = 0; | |
if (plugin.method.inRange(0, 0.330, percent)) { | |
level = 3; | |
} else if (plugin.method.inRange(0.331, 0.660, percent)) { | |
level = 2; | |
} else if (plugin.method.inRange(0.661, 1.00, percent)) { | |
level = 1; | |
} | |
return level; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment