Jump to content

Recommended Posts

I am trying to make a site for a school where they want a quiz with a question per page and an open space for written answers. For each answer added to the open space they would like that answer to be added to a drop-down menu for future quiz takers to have similarly phrased answers. They desire this so they can then see a breakdown of the top 3 answers out of the infinite possibilities of answers.

 

Is this even possible in web pages today? They do not want to have a multiple choice style, wish they did...much easier.

Link to comment
https://forums.phpfreaks.com/topic/171198-collaborative-filtering-issue/
Share on other sites

Yeah its very possible. You need to create a database for the questions that get submit, and on that database, have a column with the amount of times that specific question has been submit. Whenever someone chooses that question, update its counter.

 

To create the dropdown, just select everything from the answers table, and iterate through the results, while echoing out the HTML to create the drop down menu

in pseudocode

 

while(row = mysql fetch array){

echo "<option>".row['question']."</option>";

}

 

 

Anything is possible on the web! What you're looking at is intermediate level PHP knowlege and therefore I recommend you purchase a book on PHP to get started. To do something like this would involve sessions, a database, and PHP to tie it all together.

 

I would let people post answers to questions, but also let them see what was posted before them. If they like someone else's answer let them give that answer a "thumbs up" or let them append the answer if they don't totally agree with all of it. This way you can see which solution are rated best, but also gives the user full flexibility in their answer.

Thanks for the help!

 

So for example... let's say the question was "What 3 places in the world have you been the most happy?" The test taker could log in and see if their 3 happy places are in the the drop-down menus labeled 1, 2, and 3, and if not add them to the drop down. After submitting them, the quiz administrator could combine everybody's scores and see the happiest place out of all of the submitted answers. Giving heavier value to the #1 field and so on.

 

This is the sort of thing they want to do. Is there a book you could recommend that would have anything like this? I have a couple books that delve into sessions, arrays, and such but nothing that touches on something like this. I'd hate to tell them I cannot do this for them but it is a little beyond me at the moment.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.