Quiz PHP
- Started
- Last post
- 4 Responses
- e-wo
Looking to create a questionnaire that adds up and displays a response based on the user's answers. I.e.,
"5/15 of your answers are red flags. You might be a racist!" or
"14/15 of your answers are red flags. You're almost certainly racist!"This seems like a middleground between survey and quiz (since there are no right answers). What is this called, and where can I find a template or script to adapt? Thanks.
- ETM0
Sounds like a survey to me with a couple 'if' statements to write out a message at the end. Are you looking for a web service that does it all, ala Survey Monkey, or actual scripting you can work on?
You recording the results in a database or simply need them for that session only?
- e-wo0
Not recording the results, only displaying back a result to the user. Looking for scripting I can work on. Survey Monkey looks great, but overkill for this project.
- kush0
have each answer a number and add to a variable that counts the numbers
you can do it using javascript
if (counter <= 5 ) {
return ""5/15 of your answers are red flags. You might be a racist!" "}elseif (counter => 14 ) {
return "14/15 of your answers are red flags. You're almost certainly racist!" }
- vaxorcist0
question and scores array.... you could easily make this in an excel file and write a script to auto-import it in case you have a million questions and somebody else is edtiing/writing them....
Are the questions True/False or Multiple Choice? Or do you need to search for keywords/phrases in a text answer?
This sounds like a half-day programming gig... often easier to write it yourself than re-write somebody else's code....