Hi, I have what I would expect to be a very simple task to do, but am not winning at all or finding any solution elsewhere. I think I might be missing something very vital :P
I have a simple form that has 10 Option Controls, each with 4 choices. This is set up like a multiple choice test so that for each Option control there is one correct answer.This is not set up repeating, as all 10 questions are on on page (clients choice).
For each of the Option Controls I have made the correct answer = 1 and the other three 2,3,4. The type is Whole Number (integer), and the default value is set to 0.
At the bottom of the questions I have a button which goes back to the intro page that displays the results. I have a field called 'Score' to get the total value of the Option buttons. I set a rule on the button that first resets the Score to 0, then updates it to add all the option button values together, BUT ONLY WHEN Option Button = 1.
The expression I use for this is the following:
my:Math1[. = 1] + my:Math2[. = 1] + my:Math3[. = 1] + my:Math4[. = 1]
Unfortunately, if one of the options is NOT 1 then Score shows NaN.
How do I achieve this so that I can add the scores for a sheet each time only when the answer is correct. Is there something missing in my f(x)? How do I do an 'IF' opposed to a filter that returns no value and gives an Nan?