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

Environment radio buttons are re-enabled when you start sim and don't carry over when loaded #296

Closed
Tracked by #672
KatieWoe opened this issue Jul 1, 2021 · 4 comments
Labels
dev:phet-io type:bug Something isn't working

Comments

@KatieWoe
Copy link
Contributor

KatieWoe commented Jul 1, 2021

Device
Mac and Dell
OS
MacOS 11 and Win 10
Browser
Firefox and Chrome
Problem Description
For phetsims/qa#662. Seen with this element, but may happen with other elements as well. Seems similar to phetsims/gravity-and-orbits#394. naturalSelection.introScreen.view.environmentPanel.environmentRadioButtonGroup.enabledProperty
When you disable the above element, pressing "Add a Mate" reenables the buttons, both in studio or a launched sim. In addition, if you save a sim with that element disabled, reenable it in studio, then "Load" that saved file, the property will not be disabled.
Visuals
reenable2
reenable

@KatieWoe KatieWoe added the type:bug Something isn't working label Jul 1, 2021
@pixelzoom pixelzoom changed the title Environmental button reenable when you start sim and don't cary over when loaded Environment radio buttons are re-enabled when you start sim and don't carry over when loaded Jul 1, 2021
@pixelzoom
Copy link
Contributor

pixelzoom commented Jul 2, 2021

The relevant code is in EnvironmentPanel.js:

    // Simulation mode determines which UI components are enabled. unlink is not necessary.
    model.simulationModeProperty.link( simulationMode => {
      environmentRadioButtonGroup.enabledProperty.value = ( simulationMode !== SimulationMode.COMPLETED );
    } );

The problem is that the sim controls environmentRadioButtonGroup.enabledProperty. When a simulation has "completed" (bunnies have taken over the world, or all bunnies have died), the environmentRadioButtonGroup.enabledProperty is set to false, so that the user can review results, but not change the environment. Any change made to environmentRadioButtonGroup.enabledProperty via Studio/PhET-iO will be overridden by the sim. And there is no way for the sim to know that Studio/PhET-iO changed this Property. Ether the sim can control a Property, or Studio/PhET-iO can control it, not both.

So the options are:

(1) Set environmentRadioButtonGroup.enabledProperty to read-only, so that it can't be changed by Studio/PhET-iO. Instructional designers will not be able to disabled the buttons, but they can hide them.

(2) Remove the above code, so that the sim never changes environmentRadioButtonGroup.enabledProperty. The student will be able to change the environment when reviewing results, which is not ideal, but not tragic.

If the instructional designer doesn't want the student to change the environment, then hiding the radio buttons seems more appropriate than disabling them. So my recommendation is option (1).

This is a PhET-iO design issue, and the associated QA issue is top priority. So assigning to @amanda-phet with top priority.

@amanda-phet
Copy link
Contributor

I agree with @pixelzoom . Option (1) is my preference.

@pixelzoom
Copy link
Contributor

Option (1) has been implemented, patched in master and 1.4 branches.

Ready for testing in the next 1.4 RC.

@KatieWoe
Copy link
Contributor Author

Looks ok in rc.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev:phet-io type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants