I have been using cloud db for my voting app
So when the user click the vote button the number of votes gained must be displayed in other screen
The votes must be displayed here with the leading contestant Below
Please help
I have been using cloud db for my voting app
So when the user click the vote button the number of votes gained must be displayed in other screen
can you please show ur blocks? for both screens
How are you storing the total number of votes for each item in cloudDB ?
Actually that's what I need Actually I'm saving
The contestant names in cloud db with the election name as tag
Doing what you are doing is open to error, because another user might make a vote while you are in the middle of the vote.
Probably better to append votes to a list in a tag, then total them up in the app when you want to see the totals. Unfortunately, cloudDB itself does not have an incrementing value (even though the underlying redis database does handle an increment.) You could use firebase instead ?
Actually this is just a prototype, And I was facing error while using firebase. So, Can you please provide the screen and block pictures for the idea you mentioned to save votes
Probably better to append votes to a list in a tag, then total them up in the app when you want to see the totals. For this one please
Have you written the code/blocks for only allowing one vote button to be clicked, allow user to change their mind, then eventually submit their vote? (More complicated if they can vote for more than one candidate!)
Do that, then when you have the vote for the candidate append a 1
to the list for the candidates cloudDB tag.
To get the total for a candidate, call back the list from their tag, and then add up all the 1
s in the list (or just get length of list)
1 vote per user only. And can you please provide the block design
Less than 10 person may use this app
Can you provide a block picture or a tutorial it will be really helpful please
Then as said by taitun, firebase would be better. I didn't find any exact tutorial but they are simple logics only
When any button clicked. , Run notifier to play along with an clock to timer with interval of 3k or 2k. Meanwhile set beep to play. Call the particular button tag value
(Once fb get value, add +1 and immediately save the value in the same fb tag)
this will over within the clock to finish the timer
Once timer over,
Set the clicked button ro red, stop the music, and clock
That's all dear .
Ok I will try
Thank you so much buddy I will implement this in my app
Vote(1).aia (17.3 KB)
also check this too ( Firebase) - just add your fb url.. This will allow per user per click. Then reset to for next vote
Hey can you answer my other post