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.

Calculation number of "a" answers, "b" answers, etc

  1. I'm trying to write a form that will calculate the number of "a" answers, "b" answers, "c" answers, and "d" answers indicated for about 12 questions. In the end, what we want to know is if you answered mostly "a", "b", "c", "d".

    Has anyone figured out how to make that calculation work with the new calculation fields?

    Posted 11 years ago on Friday February 22, 2013 | Permalink
  2. It might be worth trying the Quiz Add-On. The result page will give you the data you are looking for to enable you to do an analysis.

    http://www.gravityhelp.com/gravity-forms-quiz-add-on-v1-0-beta-2-released/

    Posted 11 years ago on Friday February 22, 2013 | Permalink
  3. Thanks for the idea Rob, unfortunately, there is no right or wrong answer here. Just 12 questions that if the majority are answered with "A" makes you an "A" type. same with B, C, and D. In looking at the quiz and poll functions neither seem quite right. Am I missing something?

    Is the best option custom java calculations?

    Posted 11 years ago on Monday February 25, 2013 | Permalink
  4. You won't be able to do this with calculation fields or with the polls or quiz add-ons. What you can do is use the gform_pre_submission_filter:

    http://www.gravityhelp.com/documentation/page/Gform_pre_submission_filter

    to count up all the answers (so, you would count the number of A, B, C and D responses) and the one with the greatest total determines what text you show them (on screen or in the confirmation email?)

    Here is one example I worked on a while ago showing some of the techniques you could use:
    http://pastebin.com/SKBNHtza

    And another example: http://pastebin.com/uz7VX2NP

    Posted 11 years ago on Tuesday February 26, 2013 | Permalink