Why does my vote counts don't increase? Help me please

When I voted candidate for the first time, I can see that the vote result change to 1 to the person I've voted for. But when I do another vote, the vote result doesn't add up. Please help me I'm a student and I'm new to this MIT stuff :")) Don't mind some of the necessary items such as canvas because I just want to fulfill my assignment requirement haha. and also sorry for the no-effort interface because I want to finish my blocks before adding proper colors, indent and stuff.

So firstly my idea is you have to enter ID number and then go vote. After that to test whether the vote counts increase or not, you need to vote the SAME PERSON for the second time. Then after that you click the Admin button on Screen1 and enter the username "Admin" and pass "123456" and SUPPOSEDLY the vote result will become 2 for the selected person. I hope someone can lend me a help..

MPPVOTING_APP.aia (248.2 KB)

show your relevant blocks here.


I repeat the same blocks for each checkbox that indicates different candidates.


And then I retrieve the vote result from the data that is saved in TinyDB (in the DCSMPPVoting screen) using different tags that assigned for each candidates (ex : NumOfVotesMPP1 , NumOfVotesMPP2)

Mpp1_votes should be initialized to (TinyDB.getValue("Mpp1_votes"))

Can you please show me how the blocks would be? I'm sorry I'm confused sir :sweat_smile:

image

I'm new to this so I'm not so sure... Guide me :sob:

Initialize global mppvotes = 0;

When checkboxName1.Changed

If checkboxName1.checked

set mppvotes = TinyDB.GetValues ("MppVotes", 0);
set mppvotes = mppvotes+1;

...

OMG YES I GOT IT THANK YOU SO MUCH FOR HELPING ME!!! :sob: :pray: :pray: :heart: :heart:

Next time, to obtain high-quality screenshots, please right-click and select Download Blocks as PNG.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.