phetsims / center-and-variability

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

Unable to extract statistical data with Chrome #596

Closed Nancy-Salpepi closed 1 year ago

Nancy-Salpepi commented 1 year ago

Test device MacBook Air M1 chip

Operating System 14.0

Browser Chrome

Problem description For https://github.com/phetsims/qa/issues/999 and related to https://github.com/phetsims/center-and-variability/issues/537, This command now works in Safari, but not in Chrome: let mean = await phetioClient.invokeAsync( 'centerAndVariability.variabilityScreen.model.selectedSceneModelProperty', 'getValue' ) .then(async sceneElement => phetioClient.invokeAsync( sceneElement.phetioID + '.meanValueProperty', 'getValue' ) );

@KatieWoe was also unable to get this working with Win11 + Chrome.

Visuals In Safari:

Screenshot 2023-10-25 at 11 27 48 AM

In Chrome:

Screenshot 2023-10-25 at 11 41 58 AM
marlitas commented 1 year ago

I'm getting the error: Uncaught ReferenceError: phetioClient is not defined

I'm still not good at debugging these... marking as help-wanted.

marlitas commented 1 year ago

The bug I was experiencing was a very simple fix of having my console point to top instead of to simFrame.

@Nancy-Salpepi I was able to get it working on Chrome:

image

You will have to call the variable mean afterwards to get the value to show up. The first command just assigns the variable so it doesn't return anything. I know that's a bit jargony so may be confusing. Let me know if you want to discuss synchronously.

I don't think we need to change anything here... @catherinecarter or @samreid does the documentation need to clarify that you have to call the variable as well?

samreid commented 1 year ago

In my opinion, no new documentation is needed to explain how to access the variable value.

Nancy-Salpepi commented 1 year ago

Thanks @marlitas! That second step is missing from the examples doc, so QA didn't know what to do.

Screenshot 2023-10-25 at 3 26 59 PM
marlitas commented 1 year ago

Yeah that makes sense. It sounds like the opinion is that this is not needed for the document, but I wonder if it would be helpful for QA in the future to make note that variable assignment does not guarantee the value will be printed out, and that examples such as these may require and additional step of calling the variable itself to see the value that was stored there.

Not sure what's the best way to document this... @Nancy-Salpepi what would be most helpful?

Nancy-Salpepi commented 1 year ago

No worries. I can discuss how to update the QA book with @KatieWoe tomorrow morning. I am wondering if the additional step is something the instructional designer would need to know or is that type of example for the developer?

marlitas commented 1 year ago

I'll leave this open for @catherinecarter to answer when she get's back. From my understanding instructional designers should have preliminary knowledge with coding that would not require the need to document that step, but I don't feel comfortable making that call on my own.

catherinecarter commented 1 year ago

I don't remember this command working as it does now. IMHO, I think the examples document indeed needs updating to reflect the additional command as I don't see needing to type another command is obvious.

My question, though, is whether I should add something to specifically indicate how to get the statistical measure values per browser type? Or just say something like, "If you get an undefined returned value, follow this with the measure desired." and then give an example?

@arouinfar - would love to get your input on this as well.

catherinecarter commented 1 year ago

I have a better understanding of the process now, after talking briefly with @arouinfar (thank you!). So, I revert my original statement about needing to put additional documentation and instead agree with @samreid's comment above.

Thanks! I think this can be closed if all else is well.

marlitas commented 1 year ago

Great. Closing!