I re-wrote your code to a simpler, properly indented example.
if (!empty($_POST)) {
$answers = array(
''/*!important*/, 'a', 'b', 'b', 'a', 'a', 'b', 'c', 'a', 'd', 'a', 'b',
'd', 'a', 'e', 'b', 'c', 'd', 'a', 'b', 'd');
$score = 0;
foreach ($answers as $key => $value) {
if (isset($_POST['q' . $key])) {
if ($value === $_POST['q' . $key]) {
$score += 1;
}
}
}
$sizeof = sizeof($answers) - 1;
if ($sizeof === $score) {
echo 'Congratulations, you got a perfect score.';
} else if (floor($sizeof / 2) < $score) {//11+
echo 'Not bad, you scored average.';
} else {
echo 'You failed the test.';
}
}