I am making an app that can be used to collect points and using the collected points. I have 3 different data resources (properties):
- users (name)
- rules (name, quantity, rate)
- bank (who, what, count, points)
First we add users and then we make rules. Rules consists name of the task, quantity how it is measured (hours / repetition) and how many points one gets doing the task. For example:
Running, 1 (hour), 200 (points) or
Pushups, 1 (repetition), 5 (points).
(name, quantity, rate)
I have a page where you add the points to user when he has done a task. I have two dropdowns where you choose who has done and what task, and input field how many times or how long. Thanks to you the dropdowns are working correctly.
So if Jack has done running for two hours he should get 400 points. The app needs to check the dropdown fields Who and What and check how what is the rate of that task from rules. Multiply it using the number of the input field and save to bank all that info:
Jack, Running, 2, 400
Jill, pushups, 100, 500
(who, what, count, points)
How do I make it count the points using the dropdown fields and rules-resource and save all that data to bank? All that data consists: who, what, count, points and preferably later on the date.
After that we want to see the points one has collected so I want to sum the points from players and show it on main page
Jack 1600
Jill 1850
I am thinking to save the points to “users” data resourse. Is that a good choise? If so, how do I do it?