Debugger doesn't match DB issue

Hi - I’m making a little quiz app and having an issue with working out where I’m going wrong on a workflow.

SO I have. a button to start the quiz which creates a new submission and sets all the fields.

I have a field called questionsAnswered and then I’m checking that when the questionsAnswered = numberofQuestions for that specific quiz then show the pop up which tells them their score.

All questions have option a button and option b button and when they click one, it checks if this is the right answer or not, if so, then it should +1 to questions answered among a few other things like score.

However, when you click a button - it seems to immediately think that questionsAnswered = 2 in the step by step debugger so triggers the pop up after 1 question instead of the second (just doing 2 for a test).

In the database - the field questionsAnswered is only 1 though so I don’t understand why it thinks it’s 2 on the site.

Any help would be greatly appreciated! Screenshots below:

This topic was automatically closed after 70 days. New replies are no longer allowed.