If the *score fields contain any thing I'm thinking that they should be called as variables, so that when you make $whichscore equivalent to them, then $whichscore would be == the information that they contain. As it sits now with what you provided, then $whichscore is equivalent not to the information that the *score fields contain, but to their string names only.
Then with your code, $whichscore would output the name (whichever meets the if statement criteria). Using the one I suggest, the if $answer doesn't equal any of the *answer comparators, then $whichscore will contain and output "4".