I am new to this and building an app to ask a 10 questions and award ten point for a correct answer. The question number is incrementing fine but the variable score remains zero. I
From the few blocks you shared, the score should change by 10 when you submit the text input but only IF the text input exactly equals the two values added together.
The problem is that the text input’s “Text” is a text string while N1’s Text + N2’s Text is a number. They are never going to equal each other.
To fix this, add zero to Text_Input3’s Text before comparing it to the other sum.
You’re right! Good catch. The way you have it set up, @meer51, you are telling Thunkable that you want to set the variable with the name of the value in app variable SCORE. So if the score is 0, you would be trying to set the variable named “0”.
Instead of using that block, try the change variable by block near the top of the Variables drawer.
It’s a drop down menu click on it and you can change the variable.
Your current code creates a new variable variable 0 with the score as it’s value.
Just because you type in a number like 45 into a text input component doesn’t make it a “number” type in Thunkable. It will still be a text string.
The easiest way to show this is to have two text input components and compare their values to see if one is greater than the other.
If you type 22 into the first and 100 into the second and then check to see if 22 > 100, you will see that it returns true because “22” comes after “100” alphabetically.
But if you convert each text input value to a number by adding zero to each and then compare the two new values, you will see that 22 > 100 is now false.
You are right. I did not realise you could do this to variable on left hand side of screen. It now works since I changed existing variable with drop down menu.I learnt some new today.Thanks for your reply.