Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning paper number temporarily makes sum incorrect #299

Open
chrisklus opened this issue Aug 4, 2021 · 0 comments
Open

Returning paper number temporarily makes sum incorrect #299

chrisklus opened this issue Aug 4, 2021 · 0 comments

Comments

@chrisklus
Copy link
Contributor

chrisklus commented Aug 4, 2021

In phetsims/number-play#23, I generalized the target nodes from ExplorePanel into CountingCreatorNode (to replace OnesCreatorNode in Number Play). While doing so, I moved the max sum of 9999 from the explore panel to instead be the max of the range of sumProperty in MakeATenExploreModel, which felt like a nice improvement (and it made for a consistent way to get the max sum value in CountingCreatorNode).

However, I discovered that when a paper number is returned to the ExplorePanel, its value is actually temporarily added to the current sum before it is subtracted from the sum. So for example, if i make the max sum 400, when I peel off 100 from the 400 in the explore area and try to return it, an assertion fires from the model sumProperty that it got a value of 500 (seen in the console):

image

I don't have time to investigate more now, but it seems reasonable that the sumProperty should never exceed its intended maximum value. I have a recollection of coming across this during the initial sprint for Number Play when trying to sync up the sumProperty of paper numbers and the currentNumberProperty from the Number Play model. Marking as blocks-sim-publication.

@chrisklus chrisklus self-assigned this Aug 4, 2021
@chrisklus chrisklus removed their assignment May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant