For a recent project I had to determine the most commonly selected answer/value in a quiz submission. This quiz was built using Gravity Forms, so I added a custom merge tag that calculates the most common value in the submission array. This is useful for Buzzfeed-style personality quizzes, example: if you selected mostly ‘pony’ value answers you are a pony.

Once this information is available as a merge tag you can display conditional badges for each result.

Previous Article

This post has 11 Comments

11
  1. Your code seems fantastic. Thank you so much for sharing! Would I need to add this in functions.php file?

    You know there is one thing you don’t with Gravity Forms quiz addon and that is sharing your result “I am pony” on social media. It would have been great if it did.

      1. I see. So do I have to add a hidden field named “most_common”? And use that in the confirmation? Or paste that code somewhere?

    1. So funny Becky we must have been looking at each other's pages at the same moment in time…I love love love your beautiful pillow. The lace emmihleslbent is gorgeous and so is your sweet tag!Sending you my best wishes for a good weekend x Kerry

  2. Hi,

    How can I add categories to a GF quiz so I can calculate not only total quiz scores (% and points) but also scores for each category (% and points) – for example: Introversion 78% and Emotional stability 67% or points.

    How can I achieve this with GF?

    Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *