phetsims / expression-exchange

"Expression Exchange" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 2 forks source link

destinationReachedListener is lingering and causes expressions to combine when they shouldn't #114

Closed phet-steele closed 7 years ago

phet-steele commented 7 years ago

To pull this off, you need two expressions that are the correct answer to a target on the Game screen.

  1. Create two expressions that will work as an answer for a single target. This is easy in level 6, for example, where some challenges have three identical targets.
  2. Correctly answer a target with one of your expressions.
  3. Click Undo on that answer.
  4. Take your second expression and combine it with the first expression. However, before the expressions can combine, drag the first expression into the collection area to answer the target.
  5. The expressions will fail to combine, yay!
  6. Press Undo again. This will position the first expression snug against the second.
  7. Now just click the second expression. Or drag it around. Doesn't matter. Just make sure that when it is released, that you are releasing it over an empty collection area for which it is the correct answer (even if the collection area is really far away).

This will simultaneously answer the target (since the second expression is the correct answer) and combine the two expressions. You can freely drag this expression away from the collection area, if you'd like.

ee16

Repeat, profit:

screen shot 2017-06-20 at 1 26 18 pm

It's theoretically possible to pull this off with single terms, but is pretty humanly difficult. Seen on macOS 10.12.5 Chrome. For phetsims/tasks/issues/860.

URL: http://www.colorado.edu/physics/phet/dev/html/expression-exchange/1.1.0-dev.3/expression-exchange_en.html Version: 1.1.0-dev.3 2017-06-13 18:51:38 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36 Language: en-US Window: 1920x1013 Pixel Ratio: 2/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 32 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 80) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {"assert":{"sha":"5c3f9204","branch":"master"},"axon":{"sha":"045bd1b0","branch":"master"},"babel":{"sha":"6d9fa297","branch":"master"},"brand":{"sha":"c904b097","branch":"master"},"chipper":{"sha":"80ae1f14","branch":"master"},"dot":{"sha":"6b4ec39c","branch":"master"},"expression-exchange":{"sha":"5d9ee7b4","branch":"master"},"joist":{"sha":"b35547e9","branch":"master"},"kite":{"sha":"7d2df183","branch":"master"},"phet-core":{"sha":"76ec0204","branch":"master"},"phetcommon":{"sha":"ca2f62cd","branch":"master"},"query-string-machine":{"sha":"c74e454e","branch":"master"},"scenery":{"sha":"c2248424","branch":"master"},"scenery-phet":{"sha":"01067d19","branch":"master"},"sherpa":{"sha":"812fdf9e","branch":"master"},"sun":{"sha":"32cc2197","branch":"master"},"tandem":{"sha":"7b8b8188","branch":"master"},"vegas":{"sha":"45acc1de","branch":"master"},"vibe":{"sha":"5e8151e1","branch":"master"}}

jbphet commented 7 years ago

There was a path through the code that was not removing a listener for the end of the expression animation, and since that was lingering, the expressions could still combine in some circumstances. Nice catch @phet-steele. I have fixed this, please retest and see if the problem appears to be addressed. I was unable to duplicate it after the change, but I only tried for a few minutes.

phet-steele commented 7 years ago

@jbphet I can't reproduce either. Supposedly like everything else, let's leave this open to verify in the next release.

phet-steele commented 7 years ago

Looks good in dev.4!