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.

Value of Zero not Showing in Calculation

  1. I am creating a quiz using Gravity Forms that incorporates values of '1' for correct answers and '0' for incorrect answers. I have hidden number fields that calculates the users overall score, as well as the score for each section of the quiz. Each score is shown in the confirmation. The issue is that if a user gets an entire section wrong there is no score at all, where there should be a zero. I'm not sure how to correct this. Any help with this issue would be greatly appreciated. Thanks!

    My form: http://bizassure.com/publicsandbox/members/ce-credits/bizassure-certification-exam/

    Posted 11 years ago on Thursday July 12, 2012 | Permalink
  2. David Peralty

    It is members only. Can you show the calculation you are using? I don't know if you can just use a hidden number field and the built-in calculation. You might need to create a PHP function for this.

    Posted 11 years ago on Thursday July 12, 2012 | Permalink
  3. Thanks for your quick response! I have changed the user permissions so you should be able to view the form now (sorry about that). You can view the PHP function I'm using on PasteBin here: http://pastebin.com/MxrCkJYs

    Posted 11 years ago on Thursday July 12, 2012 | Permalink
  4. Just as a note, this issue is not limited to the confirmation. It is also showing up in the automated gform emails.

    Posted 11 years ago on Thursday July 12, 2012 | Permalink
  5. David Peralty

    Sorry, I don't want the function you have to display various messages. I want to see how you are counting the scores. That is quite the form.

    Posted 11 years ago on Thursday July 12, 2012 | Permalink
  6. Here's how I'm calculating the score for the overall form:
    ( {INS 73:90} + {BD 72:88} + {BD 71:87} + {BD 70:86} + {BD 69:85} + {T 68:83} + {T 67:82} + {T 66:81} + {T 65:80} + {T 64:79} + {T 63:78} + {T 62:77}+ {T 61:76} + {T 60:75} + {DR 59:73} + {SRS 58:71} + {SRS 57:70} + {SRS 56:69} + {SRS 55:68} + {SRS 54:67} + {SRS 53:66} + {SRS 52:65} + {BC 51:63} + {BC 50:62} + {BC 49:61} + {S 48:59} + {S 47:58} + {S 46:57} + {S 45:56} + {S 44:55} + {S 43:53} + {BA 41:50} + {BA 42:51} + {BA 40:49} + {BA 39:48} + {BA 38:47} + {BA 37:46} + {BA 36:45} + {BA 35:44} + {ECR 34:42} + {ECR 33:41} + {ECR 32:40} + {JM 31:38} + {JM 30:37} + {JM 29:36} + {JM 28:35} + {JM 27:34} + {CCR/XMod 26:32} + {CCR/XMod 25:31} + {CCR/XMod 24:30} + {CCR/XMod 23:29} + {CCR/XMod 22:28} + {CCR/XMod 21:27} + {CCR/XMod 20:26} + {HB 19:24} + {HB 18:23} + {HB 17:22} + {HB 16:21} + {HB 15:20} + {HB 14:19} + {Con 13:17} + {Con 12:16} + {Con 11:15} + {Con 10:14} + {Con 9:13} + {Con 8:12} + {BSP 7:10} + {BSP 6:9} + {e) Find and develop those needs by completing the Risk Survey.:108.5} + {d) Move on to the next prospect that has need.:108.4} + {c) Agree with the prospect since that is the polite thing to do.:108.3} + {b) Respectfully but with EQ discuss what “could” and “often does” happen to businesses that are over confident.:108.2} + {a) I may be trying to sell them too early. I need to only tell them the time ... not how the watch works until Step 3.:108.1} + {d) ___ is a great tool to address typical areas of risk for most companies.:107.4} + {c) ___ is the definitive tool to determining risk within a company.:107.3} + {b) ___ works best with moderate to highly sophisticated accounts.:107.2} + {a) ___ should be used on all accounts.:107.1} + {BSP 3:7} + {BSP 1:2} ) / 73 * 100

    Here is an example of a section score calculation (pretty much the same, just slightly reduced):
    ({BD 72:88} + {BD 71:87} + {BD 70:86} + {BD 69:85}) / 4 * 100

    Posted 11 years ago on Thursday July 12, 2012 | Permalink
  7. I'm just giving this a bump hoping that a resolution has been found to this issue. I have modified it so the total number wrong no longer show in the confirmation message–only in the automated email. The issue with '0' not showing up is still occurring. Any help with this issue would be awesome!

    Posted 11 years ago on Tuesday July 17, 2012 | Permalink