Comparing values

I’m building a game where an invention is listed and then 4 users try to guess what year the invention was discovered in but I have issues in comparing the user answer to the true answer and amongst other users’ answers.

Try a couple of things:

1. setting a fixed timezone for the expected answer as well as the users’ answers
2. While checking whether the answer is correct, round the user’s answer down to date - this will keep the date the same and make the time 00:00.
` :rounded down to date`

This problem comes up because there is a time mismatch on what the users answer and what your expected answer is.

I’m using integers as the answer.

Heya miha, are you meaning a question that multiple users will be looking at from their own device (4 devices)?

“comparing the user answer to the true answer”: - check whether the answer is this answer and have some feedback based on a conditional - see example below:

" amongst other users’ answers.": -
You’ll need to think about how all 4 users could answer and reference the same data (i.e. see each others scores)

Hope that helps

Hej Djack, thanks a ton for going the extra mile, let me elaborate.

The MVP is meant to be played in a group setting where only one instance of the app is open.

To win this you will have to be closer than the other players.

After each round, the players are ranked on how close they are.
Based on their standing they receive points.

So my issue is checking how close someone is and then randing them among each other.

Hope this makes sense

Okay, that should be easy enough to do through Bubble - you can play around with custom states to achieve this and then compare it with each user’s answer in workflows.

The challenge will be when you want to use dynamic values - e.g. more than 4 players, custom users etc. This is because it can be hard to reference data within a repeating group.

As far as comparison, you can give a certain number of points for a correct answer (e.g. 100) and then a negative number of points whether it is over or above. To achieve negative values you just need to ensure that the calculation is (smaller number - bigger number)

Hope this helps.

1 Like

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