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

Zero appears in the answer box #195

Closed
Nancy-Salpepi opened this issue Jul 5, 2022 · 5 comments
Closed

Zero appears in the answer box #195

Nancy-Salpepi opened this issue Jul 5, 2022 · 5 comments
Assignees
Labels

Comments

@Nancy-Salpepi
Copy link

Test device
MacBook Air (m1 chip)

Operating System
12.4

Browser
Safari

Problem description
While testing phetsims/qa#817, on the Division screen I noticed that after the first question, a zero is present in the box where you need to type your answer instead of it being empty. In the published version, the box is empty.

I am not sure if it has to do with the work that was done in phetsims/vegas#102 or other work that was completed. I also didn't see this on the other 2 screens.

Steps to reproduce

  1. Go to the Division screen
  2. Choose any level to play
  3. Correctly answer the first challenge--there will now be a zero in the answer box for the next challenge (and all other challenges after that)

Visuals
On Master:

zero.mp4

**
In the published version:

Screen Shot 2022-07-05 at 7 06 33 PM

Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: Arithmetic URL: https://bayes.colorado.edu/dev/phettest/arithmetic/arithmetic_en.html?ea&brand=phet Version: 1.1.0-dev.3 (unbuilt) Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15 Language: en-US Window: 1381x665 Pixel Ratio: 2/1 WebGL: WebGL 1.0 GLSL: WebGL GLSL ES 1.0 (1.0) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 30 uniform: 256 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}
@amanda-phet
Copy link
Contributor

Yikes! This is a very serious bug, thanks for finding it @Nancy-Salpepi . Hopefully we don't re-publish the sim with this issue.

@jbphet
Copy link
Contributor

jbphet commented Jul 27, 2022

Good eye @Nancy-Salpepi!

@marlitas - This errant behavior is caused by the switch from parseInt to Number that was done in 29f79fc. In this sim, the code is counting on the NaN value that was coming from parseInt to blank out the input box, but as you and I found out while working on the problem that came up in expression-exchange, Number('') produces a value of zero.

Please have a look, see if you can resolve it, and let me know if you need any help. I dug through the code for a bit and a good place to start looking is DivideEquationNode, line 33, but there may be other problems, so I'd suggest a thorough regression test.

@jbphet jbphet assigned marlitas and unassigned jbphet Jul 27, 2022
@marlitas
Copy link
Contributor

@jbphet I took a look and implemented a fix in DivideEquationNode.js
Not sure what the best tools for a regression test here are, but I did go through every screen/screen-view to ensure that nothing funky stood out in terms of number/strings in both the answer boxes as well as the grids.

Pleas let me know if there are other tools you recommend I use or look at.

Assigning back to @jbphet for final review of fix.

@marlitas marlitas assigned jbphet and unassigned jbphet Jul 28, 2022
@jbphet
Copy link
Contributor

jbphet commented Jul 29, 2022

@marlitas - thanks for the fix.

@Nancy-Salpepi - Can you please take a look around the sim and see if you see any occurrences of his problem?

@jbphet jbphet assigned Nancy-Salpepi and unassigned marlitas Jul 29, 2022
@Nancy-Salpepi
Copy link
Author

@jbphet @marlitas looks fixed to me!

@jbphet jbphet closed this as completed Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants