mysql - Creating a yes or no questionnaire in PHP -


i have scenario in users complete quiz. rubricks follows:

  • a series of questions radio button next them either yes or no
  • each question either +1 or -1 given answer of yes or no
  • each question falls own category (so user score per category)
  • this data collected , presented user
  • the questions category can in random order

my thought process is, have users table in database questions table , answers table.

the question table include id, question itself, category falls into.

the answer table have question id , correct answer (in case either yes or no).

when page loaded x amount of questions grabbed database , put form.

the user completing quiz have score each section associated them, perhaps in score table.

this updated when user submits form.

programmatically, work, or on inflating issue?

possible. possible , can implemented.

you can ensuring have user table store unique primary id user number of categories can have different table or can in single table giving each category particular flag type question particular category can distinguish . if user attempting questions can store answers in separate table can compare them actual answers can show result user score.

for random order generation. store questions particular unique id , store them in array , shuffle them using array shuffler in php , show question accordingly.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -