Hi there, I’m creating a platform to host multiple quizzes amongst other things but I’m struggling with the final piece of the scoring.
I currently have the following data types:
Quiz: Name (text), Number of questions (number)
Question: Quiz (quizzes), Text (text), Answer 1 (text), Answer 2 (text), Correct answer (text), Score (number)
Submission: Quiz (quizzes), Respondent (user), Questions answered (number), Score (number)
On my page, I have a repeating group which cycles through each of that particular quizzes’ questions, randomly orders the two items (answers) as clickable buttons.
What I’m struggling with is storing the submission. So at the moment, when you click the answer button, my workflow Searches for submissions with the current user as the respondent and the current quiz as the quiz and if that count = 0 it creates a new one with all relevant info and sets the score to 0.
The next step then checks if this item’s answer = the items question’s Correct Answer and if it does it then increments the score by 10 and adds 1 to the questions answers field via an “only if” statement.
The issue is then on the second question, because there IS now a submission for the user the whole thing seems to fall down. What am I missing in terms of updating that specific submission?