PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Help with redirecting a quiz based on field value totals

  1. I have a quiz of 20 questions, 2 choices for each question, four questions to a page. I've assigned a value to each radio button choice but need some advice as how to:
    (a) total up the field numbers in the functions.php; and then
    (b) change the redirect URL based on a particular total.

    For example, based on a user's selections, if the:
    total <= 125 they go to confirmation page a
    total == 130 they go to confirmation page b
    total == 135 they go to confirmation page c
    total >= 140 they go to confirmation page d

    Thanks

    Posted 12 years ago on Monday August 27, 2012 | Permalink
  2. I've written up a couple things which should be useful to you:
    http://www.gravityhelp.com/forums/topic/gravity-forms-quiz-help-needed
    http://www.gravityhelp.com/forums/topic/mathematics-to-gravity-forms

    Since I wrote those, Gravity Forms has added conditional shortcodes, which may help as well:
    http://www.gravityhelp.com/documentation/page/Shortcodes#Conditional_Shortcode

    Let us know if you need additional help getting started.

    Posted 12 years ago on Monday August 27, 2012 | Permalink
  3. Hi Chris,

    Thanks for your response but need some additional help getting started.

    Have looked through both topics. In the 'mathematics to gravity' understand how the rating field is used to display the message as it relates to the score. I have the same number of questions and the same number of options but the values I've put in to the field numbers are different that of '1' or '0'.

    I have five pages, 4 questions to a page, 2 options per question. For example, first page:
    Q1, option A, value '1'; Q1, option B, value '2';
    Q2, option A, value '3'; Q1, option B, value '4';
    Q3, option A, value '5'; Q1, option B, value '6';
    Q4, option A, value '7'; Q1, option B, value '8';

    The option values then repeat again on the following four pages.
    Page 2: Q5, option A, value '1'; Q1, option B, value '2'; etc., etc., through to '8'.
    Then it starts again on the next page.

    Depending on what they've selected, their score should either be:
    total <= 125 (message/redirect to page a)
    total == 130 (message/redirect to page b)
    total == 135 (message/redirect to page c)
    total >= 140 (message/redirect to page d)

    So, how do I total up the different values for each of the options?

    Posted 12 years ago on Wednesday August 29, 2012 | Permalink