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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2013
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How to create quiz with 2 conditions?

    I have idea to making quiz. It was succeed when I create with Ms. Excell.
    Now I want to create with JavaScript.
    Can anyone help me with this conditions:

    Quiz Example:

    Question:
    What is this number 777?

    Answer: - Condition 1
    A. 993
    B. 344
    C. 777
    D. 987

    Are you sure with your answer? - Condition 2
    1. YES
    2. No

    So, the student will answer with 2 conditions:
    Example answer: C and 3

    This is the conditios:

    When the answer is right in conditions 1 and YES in condition 2, the score is 100.

    When the answer is right in conditions 1 and NO in condition 2, the score is 100.

    When the answer is false in condition 1, the score is 0.

    The answer sheet must be like this:
    • Right answer : xx (with number)
    • False answer : xx (with number)
    • Right answer and YES : xx % (with pencentage)
    • Right answer and NO : xx % (with pencentage)


    The conditions for percentage is:

    Right answer and YES=
    right answer and YES / total YES

    Right answer and NO=
    right answer and NO / total NO

    Thanks for your attention

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,733
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    This forum is not a free coding service. As a general rule, the people helping out in this forum don't write code for others (especially code that appears to be for homework), but try to help with fixing code that doesn't work. You may perhaps get someone to write this script for you, but you'll be far more likely to get help if you have made a substantial effort and written some code yourself. Then someone here will almost certainly help you correct/improve your work.


    It is your responsibility to die() if necessary….. - PHP Manual

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • Users who have thanked Philip M for this post:

    bonyhardian (05-23-2013)

  • #3
    New to the CF scene
    Join Date
    May 2013
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi Philip, thanks for your answer.
    I'm new in this forum.

    So, where I can get resolve with my idea?



    Quote Originally Posted by Philip M View Post
    This forum is not a free coding service. As a general rule, the people helping out in this forum don't write code for others (especially code that appears to be for homework), but try to help with fixing code that doesn't work. You may perhaps get someone to write this script for you, but you'll be far more likely to get help if you have made a substantial effort and written some code yourself. Then someone here will almost certainly help you correct/improve your work.


    It is your responsibility to die() if necessary….. - PHP Manual

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,733
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Follow the advice I gave you. Write some code, post it here, then someone will doubtless help you correct/improve it.

    If I may say so, your "quiz" sounds pretty silly:-

    When the answer is right in conditions 1 and YES in condition 2, the score is 100.
    When the answer is right in conditions 1 and NO in condition 2, the score is 100.

    So what is the point of "condition 2"?

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    And, by the way, Philip is doing the right thing by not giving you the answers.

    Look here:
    http://www.codingforums.com/rules.htm
    and look especially at rule 1.5
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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