I am making a basic quiz program, that when finished will allow the user to complete quizzes being read from a MySQL database, and write quizzes to be stored in the database.
I have a variable for question number ($qn
), which when incremented changes the question, and the four possible choices to the next question in the database.
My question is: How can I have a button on my main form, that (once the user has selected a radio button) recordes the radio button result, then increments $qn
to display the next question, then does that process again, until $qn == $numberOfQuestions
, at that point it needs to show the page results.php and add up the results from all the radio buttons on the quiz.php page.
I am quite new to PHP, so sorry if this is a particularly stupid question, or if I have worded it in an unclear way. And I am very open to suggestions is there is an easier or more efficient way of doing this.
Thank you in advance for any answers, really grateful :)