Mathematical Conditions: Adding field values

  • pixelplaza
    Asked on October 6, 2014 at 5:21 PM

    My form has a quiz with true and false answers. Each correct answer earns one point. How do I calculate a score for each person completing the quiz?

    Thank you

  • Welvin Support Team Lead
    Replied on October 6, 2014 at 6:17 PM

    Hi,

    You can take advantage of our calculation widget: http://www.jotform.com/help/259-How-to-perform-calculation-in-the-form.

    Or, you can use our quiz app: http://apps.jotform.com/app/quiz_form

    Please get back to us if you need further assistance.

    Thank you!

  • pixelplaza
    Replied on October 6, 2014 at 6:24 PM

    The calculation is fine for adding up items in the one field but how do I add up only correct answers from a group of fields?

  • pixelplaza
    Replied on October 6, 2014 at 6:27 PM

    I can't use the quiz widget as the answer total will be a hidden field so the contestant doesn't know their score. The score will be emailed to the administrator.

     

  • Charlie
    Replied on October 6, 2014 at 7:24 PM

    Hi pixelplaza,

    What I understand is that you would like to give values to questions depending on their answers? Counting the number of correct answers but not visible to the user/contestant?

    You can achieve this by using the "Conditions" feature, then you can have a hidden "Total Points" field to place or add up all the correct items there.

    Here are possible tutorial links that may help you:

    Using Conditions for Smart Forms.

    Mathematical condition in Forms

     

    Here's a sample I did using your form that I cloned.

    1. I set up hidden fields that will server as a storage of the value depending on the answers of the user (ex. If he/she answers "True" in question #1 that would equal to 1 point hidden field #1)

    Mathematical Conditions: Adding field values Image 1 Screenshot 50

    2. Set up "Conditions" to identify what is a correct answer and add the corresponding value points to it.

    Mathematical Conditions: Adding field values Image 2 Screenshot 61

    3. Create other condition based from the questions you want to have a value. In my case I have 3 hidden fields named "1", "2" and "3" that will serve as a temporary storage, I will add them up and the value will be showed to the "Total Points" field depending on their answers.

    Mathematical Conditions: Adding field values Image 3 Screenshot 72

    4. These are my conditions.

    Mathematical Conditions: Adding field values Image 4 Screenshot 83

    You can check the working clone here, cloned form. Note: Fill in the "Full Name" section and only questions 1-3 with true or false are working.

    If you don't want the users to see the "Total Points" live, you can just hide it.

     

    Let us know if this helps you.

    Thanks.