So, i do my project which is “Measure Stress by Questionnaire”. I have 41 question and has put it in thunkable, mean to answer and see score work well.
But after answer all question, i want to make “Result Screen” mean the user able to see their final score. I dont know how to do it.
You can actually do this more simply, since this is one big if / else if statement. For the first else if, you already know the label is >19 (unless negative values are possible?), so you can just check that the value is <39, for the next one that it is <59, etc.
Does it matter? Probably not unless you’re going to do a LOT of comparisons (or you’ve got database access/stored variables/cloud variables built into those comparisons), but you’ll drag fewer blocks if you take advantage of the way if/else if works.
No. Because the first conditional statement checks to see if the score is less than 20. Since 10 is less than 20, that statement evaluates as true and the string “Your Stress is Low” is assigned.
You said you wanted to check their score on the Result screen so I would do it there.
Look at the if/else if blocks @human posted above. See if you can construct something similar. The difference is that you’ll use the equals (=) block from the Logic drawer. You can find the number blocks in the Math drawer.
If you still need help, post a screenshot of the blocks you’re using and explain what happens when you preview your project.
Hmm. That looks like it should work except for the fact that you’re comparing text to numbers. You need to compare numbers to numbers.
I also generally avoid using labels in comparison blocks (≥, <, =, etc.). You can use them but it’s best to stick to variables for that sort of thing.
So… you need to convert your score to a number. If it’s already a number in app variable score then just use that instead of YourScore's Text in all your blocks above.
I’m guessing that’s the case. If not, then convert the app variable score value to a number by adding zero (0) to it. If you add zero to a text string, it becomes a number.
Another issue:
YourScore’s text would be Score : 15 (or something like that), so you’d be comparing “Score : 15” against your numbers. You’ll have to use your variable.