How can I calculate the score of the chosen buttons with assigned values

Hi All,

Im new in this forum and starting to learn how to use the app inventor. I'm currently stacked on how to calculate the score of chosen buttons with assigned values.

Example:

TOTAL SCORE:

Group 1
Button A 0
Button B 1
Button C 2

Group 2
Button A 0
Button B 1
Button C 2

Example scenario:
If I chose Button A of Group 1 and Button A of Group 2 (both by clicking), then my TOTAL SCORE will reflect 0.
But if I chose Button B of Group 1 (by clicking), then my TOTAL SCORE will reflect 1 (Button A of Group 2 remains to be chosen).
And if I chose Button C of Group 2 (by clicking), then my TOTAL SCORE will reflect 3 (Button B of Group 1 remains to be chosen).

Hopes someone can help. Thank you very much in advance.

Grace

image

The code and he output. This is something similar to what you wanted. You can change the code to your needs

Add a reset button to enable all buttons, or else add the same in the button7.click event

Thank you so much for the codes. I got an idea on how to do it and will work around on this one. Mine have no calculate button but intend to automatically change the score once the button was chosen. Again, thank you so much for this.

Somewhat looks like this calculator: https://www.mdcalc.com/heart-score-major-cardiac-events

You are welcome @Grace_A :smile:

I think I was able to get it! Thank you so much for the help :slight_smile: