Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How to Make a Quiz Need a Tutorial

    Hello everyone

    I need some help, I am making a website and I need to make a quiz for it. So I have 100 or so questions and what I need the quiz to do is randomly take 10 questions from the 100 and then display them. The questions only have true/false or four possible answers and at the end of the quiz it must display the percentage of answers correct.

    I need some help finding a web tutorial or book (I don't mind buying a good tutorial/book) on how to build a quiz which draws 10 questions randomly from the group of 100. I think I should use PHP to make the quiz but I don't mind using other things as long as they are compatible with iPhones.
    Please note I have never done something like this before so I'm sorry if I missed something out.

    Thanks for any help.

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    First stop is Google of course, so what did you find there? Anything promising?

  • #3
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,373
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    So many other questions ....

    Do you have an existing website/webhost account already?
    Do the 100 questions need to be changed on a regular basis?
    Does the person taking the test need to login somehow?
    You only need to display the results to the user ... nothing else?
    When the user refreshes the page, they get a new set of 10 random questions?
    What if they refresh the page on question #5?
    What if the next set of questions has 2 or 3 of them the same as the previous test?
    Is what you're doing a homework assignment for a school or class?

  • Users who have thanked mlseim for this post:

    RussSki (02-20-2013)

  • #4
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    So many other questions ....

    Do you have an existing website/webhost account already?
    Do the 100 questions need to be changed on a regular basis?
    Does the person taking the test need to login somehow?
    You only need to display the results to the user ... nothing else?
    When the user refreshes the page, they get a new set of 10 random questions?
    What if they refresh the page on question #5?
    What if the next set of questions has 2 or 3 of them the same as the previous test?
    Is what you're doing a homework assignment for a school or class?
    Ok thank you both for the replies, greatly appreciated! .

    Fumigator I did do a Google search but didn't find anything good so I came here.

    mlseim here are the answers to your questions:

    I have made a very basic website before just using HTML and CSS
    No I don't need to change the questions on a regular basis however I will add/remove questions from time to time.
    No login required.
    Only the user needs to see the results I don't need to log the results or anything.
    If the user refreshes the page I don't mind if they get a new set of questions or the quiz does not reset which ever is easier.
    It doesn't matter if there are 2 to 3 questions from the previous quiz.
    Yes I am doing this for a school project but it is not getting marked/given a grade so it's not worth any credits/points this project is more of a project that I want to do for fun and learning.

    Thanks for the replies again!

    Edit: Also I thought that I better add in that I'm not looking for someone to write out all the code for me here because I know that would be completely unreasonable what I really just want is for someone to give me some guidance so I can find some tutorials or books which will help me make my website.
    Last edited by RussSki; 02-20-2013 at 08:20 PM.

  • #5
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,373
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    You can make it as simple as a plain text file (flat file database).

    Create a text file called "questions.txt".
    Each line is one question with the parts separated by pipes |

    Example

    An Elephant is a|B|fish|mammal|reptile|bird

    Question | correct answer | choice 1 | choice 2 .... etc

    Use a Php script to open that file, put all lines into an array, shuffle the array, loop through the first 10 lines, explode each line by pipes and display the question.

    Google all of those php terms. Find a fellow student who knows php to help you.


    .
    Last edited by mlseim; 02-21-2013 at 04:17 AM.

  • #6
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you for the reply, at least I now know what to look for


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •