phetsims / equality-explorer

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

Add gameLevels query parameter. #165

Closed pixelzoom closed 3 years ago

pixelzoom commented 3 years ago

From https://github.com/phetsims/vegas/issues/86...

Add a public query parameter to specify which game levels to include. Name it gameLevels, and add it to EqualityExplorerQueryParameters.js. Levels should retain their original numbers on buttons, descriptions, etc.

Estimate: 2 hours to implement, test, in master only.

pixelzoom commented 3 years ago

This is fully implemented.

The values for gameLevel must be unique integers, in ascending order, from the range [1,5].

Examples:

Valid: gameLevels=1,3,5 Invalid: gameLevels=5,3,1 // not in ascending order Invalid: gameLevels=1,2,2,3 // contains duplicates Invalid: gameLevels=1,3,6 // contains an invalid level number

I'll wait to have this reviewed with https://github.com/phetsims/equality-explorer/issues/164.

pixelzoom commented 3 years ago

@amanda-phet @kathy-phet ready for review in 1.1.0-dev.3

amanda-phet commented 3 years ago

Seems to be working well. I checked the info button, button icons, and level descriptions. All seems to be working.

pixelzoom commented 3 years ago

Excellent. Labeling as "fix-awaiting-deploy" for verification in the next QA cycle.

liammulh commented 3 years ago

The gameLevels query parameter seems to be working as intended on master. Reassigning @pixelzoom.

pixelzoom commented 3 years ago

Thanks @liam-mulhall.

I've added gameLevels to the query parameters spreadsheet.

Closing.

pixelzoom commented 3 years ago

Reopening. As I learned over in https://github.com/phetsims/fourier-making-waves/issues/145, excluding the creation of any instrumented element will change the PhET-iO API of the running sim, and cause an "API compatibility failure". It can also cause a failure during playback, for example if you exclude a game level and playblack a session that contained the exclused level.

Nothing about the public-facing query parameter needs to change, but how it's used in the sim implementation does need to change. The recommend way of doing this (according to https://github.com/phetsims/fourier-making-waves/issues/145#issuecomment-899953746) is to still create everything, but hide elements of the view -- specifically LevelSelectionButton instances.

pixelzoom commented 3 years ago

Done, this implementation will now play nice with PhET-iO. Nothing in the model and view is conditionally instantiated. gameLevels simply affects visibility of the level-selection buttons.

Tested with a bunch of different values, including ?gameLevels=1,3,5, ?gameLevels=2,4, and (for errors) ?gameLevels=4,2 and ?gameLevels=1,6.

Closing.

pixelzoom commented 3 years ago

Ready for testing the next time that a new release of this sim is published.

pixelzoom commented 3 years ago

Assigning to @amanda-phet to decide when and how this gets deployed. Note that this work was only done in master, so a maintenance release would require more work.

amanda-phet commented 3 years ago

@pixelzoom I think we are ready to publish this sim, and QA has capacity to test. Can you go ahead and start the maintenance release process?

pixelzoom commented 3 years ago

@amanda-phet asked:

... Can you go ahead and start the maintenance release process?

This cannot be done via a maintenance release. The 1.0 branch is pre-ES6, and cannot be easily patched. Re-publishing requires a full QA process.

Unassigning until there's a QA plan in https://github.com/phetsims/equality-explorer/issues/167.

KatieWoe commented 3 years ago

Looks good in dev.4