i want to make a simple 10 multichoice questions test my theory of how to do it as follows:
Test Page:
question followed by 4 radio buttons with same same group but with different name like A1, A2, A3, A4 then i was going to use $POST['Q1'] like so
A1 is the correct answer
if($_POST['Q1'] == A1)
{
$ans1 = 1
}
else
{
$ans1 = 0
}
i will make 10 of these if statments one for each question
$finalscore = $ans1 + $ans2 + $ans3 + $ans4 + $ans5 + $ans6 + $ans7 + $ans8 + $ans9 + $ans10
if($finalscore >=8)
{
echo ("Congratulations you got 80% or more please wait while we save your score and pass you to the application form");
**some kind of pause script**
header("apply.htm");
}
else
{
exit("Sorry but you didnt make the pass grade");
}
would this work? or am i missing something?