phetsims / build-a-nucleus

"Build a Nucleus" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 5 forks source link

Have sim reset to values specified in query parameters #195

Closed Nancy-Salpepi closed 12 months ago

Nancy-Salpepi commented 12 months ago

Test device MacBook Air M1 chip

Operating System 13.5.1

Browser Safari 16.6

Problem description For https://github.com/phetsims/qa/issues/977, when using the query parameters decayScreenNeutrons + decayScreenProtons (or chartIntroScreenNeutrons + chartIntroScreenProtons) pressing Reset All clears all of the particles rather than returning the sim to the state it was launched in.

I feel like a similar case is with Natural Selection. For example, when using the ?introPopulation query parameter the sim resets to the amount of bunnies specified in the query parameter.

Steps to reproduce

  1. add ?decayScreenNeutrons=30&decayScreenProtons=30
  2. Press Reset All on the Decay screen
Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: ‪Build a Nucleus‬ URL: https://phet-dev.colorado.edu/html/build-a-nucleus/1.0.0-dev.23/phet/build-a-nucleus_all_phet.html Version: 1.0.0-dev.23 2023-09-12 15:57:17 UTC Features missing: applicationcache, applicationcache, touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Language: en-US Window: 1439x724 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: 31 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}
zepumph commented 12 months ago

@ariel-phet, this is your call. I could see it either way. @Nancy-Salpepi's suggestion is in line with how we support PhET-iO state startup customization. I could also see it as annoying if your query parameters put particles in the hundreds.

arouinfar commented 12 months ago

I could see it either way.

My initial instinct was that I would want it to reset to the values specified in the query parameter, but I also can see it going either way.

If the goals are centered on larger nuclei or comparing to a particular baseline, it seems helpful to reset to the query parameter values. On the other hand, if the goal is just to quickly build a certain nucleus, it may be acceptable to clear it on reset all.

ariel-phet commented 12 months ago

@arouinfar @Nancy-Salpepi @zepumph

My instinct would be that if someone is using a link with such query parameters, the sim should reset to the query parameters.

  1. Since this approach is inline with PhET-iO state startup, seems good to be consistent
  2. If an educator has made the decision to specifically use the query parameters, especially for a classroom use, I would assume they would want to have the sim continue to reset to that chosen state
zepumph commented 12 months ago

Implemented above. Want to test main?

Nancy-Salpepi commented 12 months ago

I gave it a spin on main and it looks good to me!