I’m currently trying to implement a questionnaire where the user has given the option to choose between 5 different ways to answer a question. It’s built within a Repeating Group. Each of these options is an unfilled icon that gets filled once the user clicks on it.
( ) - ( ) - ( ) - ( ) - ( )
Depending on which of these options the user clicks on, I make a change for a User’s NumberCount (default = 0) that I’ve created as a field for the type User. For example, let’s add +1 to NumberCount when the user clicks the first icon:
If the user decides to switch to an other answer to a question (let’s say the second icon will add +2 to NumberCount), I need to reset his previous choice and therefore the workflow, too. Otherwise, the +1 will stay in the database which will give inaccurate results in the test.
Hey @chrschw97 Instead of keeping a count of the User’s answers, can you store the list of questions with the User’s answers, and then use the :sum option? Once the User is finished answering the questions in the repeating group, then you can also store the :sum as the User’s NumberCount. Here is a forum example:
Hi Faye, thanks a lot! It’s a smart way to solve it, however, it doesn’t work if Number is not existing in the database - it’s just empty then. Moreover, I added some question dummies to Question.
Have a look at the Preview. This is how it should work on the front-end. So, I applied it to my app and nothing changed in the database. However, in the testing app it works.
My end goal is it to :sum the results of A1/A2 and B1/B2 (in the background, not visible for the user) because these question packs are from the same categories. Not the overall sum of everything in the RepeatingGroup. Additionally, the value should be reseted to 0 after every finished questionnaire. So if another user uses the same questions, the value of Number shouldn’t be changing randomly while the user answers the questions.
Actually, I’m searching for a way to let it work only when a user is logged in/signed up (not changing anything for Question because it is used by many people at the same time). Something like a “Temporary Number” that is connected to the User and the Question and doesn’t change any data for Question.
No problem at all! Sorry for the delay (just saw this!) Can you create a new list of questions/answers and save it to the User when the User begins to answer questions (not modifying the original questions)? I know in the forum example it modifies the questions themselves, but in your app if you stored the list of questions on the Users (answers blank), then use the repeating group method to determine the correct sum?
Got it! I’m currently struggling to edit the List of Questions that I created as a New Field (This field is a list) for the User. I’m reading that I have to do it manually and am not able to do in the database. How did you solve that?
Hi Misha, thanks for your response! Yes, this is how the visuals should work. However, I just use different vectors (filled, unfilled) for the circles. So it already works. My problem is the back-end now - that I’m not able to use a list for a Thing’s (User) Field (Questions). It seems quiet difficult to use lists for a field. My previous posts describe the problem in a more detailed way.