Last active
December 18, 2015 17:01
-
-
Save catherinemaldonado/7bae562e43da5a82d340 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
if (personality === true){ | |
// TALLY SUBMITTED ANSWERS FOR EACH CHARACTER FOR PERSONALITY QUIZ | |
$("input:radio").each( function() { | |
if($(this).prop("checked") === true) { | |
val = $(this).attr("class"); | |
// INCREASE PERSONALITYCOUNT FOR SELECTIONS | |
for (var i = 0; i < personalityOptions.length; i++) { | |
if (personalityOptions[i] === val){ | |
var match = personalityCount.map(function(e) { return e.character; }).indexOf(val); | |
personalityCount[match].count = personalityCount[match].count + 1; | |
} | |
} | |
} | |
}); | |
} else { | |
// CAPTURE SUBMITTED ANSWERS FOR TRIVIA QUIZ | |
$("input:radio").each( function() { | |
if ($(this).prop("checked") === true) { | |
var text = $(this).next("span").text(); | |
submittedAnswers.push(text); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment