phetsims / balancing-chemical-equations

"Balancing Chemical Equations" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/balancing-chemical-equations
GNU General Public License v3.0
2 stars 5 forks source link

Spinners continue to update after checking answer #111

Closed phet-steele closed 8 years ago

phet-steele commented 8 years ago

Probably not an obvious use case, but fun to report nonetheless @pixelzoom. In the game screens, with a multi touch device, the coefficient spinners can be held down while also checking an answer. This causes the inputted answer to change after the sim has checked for correctness. Easy way to reproduce some consequences of this:

  1. This is easiest to perform on an equation where the correct answer for one of the coefficients is "7". In the below screenshots it's the O2 molecule that should be 7.
  2. Once an equation fitting this criteria is given, make only the coefficients other than the O2 correct (O2 is just for this example). Make sure the O2 is wrong, preferably 0.
  3. With one finger, hold down the spinner to start increasing the coefficient. Before the number reaches 7, use another finger to press check. Don't let go of the spinner until it's at max.
  4. If check was successfully pressed before O2 hit seven, you'll be prompted with the wrong answer. However, clicking "Show Why" will show a balanced answer:

img_0054

Furthermore, if this procedure is done on the second attempt of an answer and "Show Answer" is pressed you get some points...sort of: img_0053

Video: https://drive.google.com/file/d/0B3HJopSo_QqLY1k4QXBBaFA0NkE/view?usp=sharing

ariel-phet commented 8 years ago

@phet-steele fun find....I doubt much can be done about this multitouch issue, but we will see what @pixelzoom says

pixelzoom commented 8 years ago

When the "Check" button is pressed, the spinner arrows disappear, and interaction with them should cease - but it doesn't. This is a double bug in scenery-phet, involving NumberPicker (the "spinner") and FireOnHoldInputListener.

When NumberPicker.setArrowsVisible(false) is called (which hides the arrow buttons), the "fire-on-hold" interaction with the arrow buttons isn't canceled. So as long as you continue to hold down the arrow button, it will continue to change the value, even though the button is no longer visible. And FireOnHoldInputListener (which handles the events) has nothing in its API to support canceling this interaction.

Since this affects all sims that use either of these common-code types, this issue should be moved to scenery-phet and addressed.

I don't think that it needs to be addressed for BCE 1.1.0-rc.1, since it's not a new problem, and rather obscure. @ariel-phet do you agree?

pixelzoom commented 8 years ago

Looks like BCE is the only client of NumberPicker that currently uses the setArrowsVisible call.

ariel-phet commented 8 years ago

@pixelzoom sounds good....lets mark this issue as "won't fix" and create an issue in scenery-phet

pixelzoom commented 8 years ago

sun.PushButtonModel has a similar fire-on-hold feature, but does not use FireOnHoldInputListener. Looks like it properly handles stopping the associated timer when the button is disabled.

pixelzoom commented 8 years ago

Thanks @ariel-phet, will do.

pixelzoom commented 8 years ago

Issue moved to https://github.com/phetsims/scenery-phet/issues/212. Will not address this for BCE 1.1.0. Closing.

pixelzoom commented 8 years ago

Related to RC test https://github.com/phetsims/tasks/issues/371.

pixelzoom commented 8 years ago

Reopening this so that I can have @phet-steele verify after addressing phetsims/scenery-phet#212.

pixelzoom commented 8 years ago

Fixed the issue in NumberPicker, tested ion iPad and desktop, demonstrated in: http://www.colorado.edu/physics/phet/dev/html/balancing-chemical-equations/1.2.0-dev.1/balancing-chemical-equations_en.html

@phet-steele Can you please verify this fix?

phet-steele commented 8 years ago

@pixelzoom works for me.

pixelzoom commented 8 years ago

Thanks @phet-steele.