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

Sim freezes once Level 5 is completed #169

Closed Nancy-Salpepi closed 2 years ago

Nancy-Salpepi commented 2 years ago

Test device MacBook Air (m1 chip)

Operating System 12.0.1

Browser safari 15

Problem description https://github.com/phetsims/qa/issues/732 On the Solve It! Screen, once Level 5 is completed, the sim freezes.

Steps to reproduce Using ?showAnswers query parameter, complete 10 challenges in Level 5.

Visuals simfreezes

Console Error:

Screen Shot 2021-11-05 at 9 31 35 AM

[Error] TypeError: [qR,CR,xR,IR][e-1] is not a function. (In '[qR,CR,xR,IR][e-1]()', '[qR,CR,xR,IR][e-1]' is undefined) ER (equality-explorer_all_phet.html:870:1589484) showCallback (equality-explorer_all_phet.html:870:1593105) (anonymous function) (equality-explorer_all_phet.html:870:933125) emit (equality-explorer_all_phet.html:870:42657) _notifyListeners (equality-explorer_all_phet.html:870:80915) set (equality-explorer_all_phet.html:870:80341) value (equality-explorer_all_phet.html:870:81367) show (equality-explorer_all_phet.html:870:930191) (anonymous function) (equality-explorer_all_phet.html:870:1593273) emit (equality-explorer_all_phet.html:870:42657) _notifyListeners (equality-explorer_all_phet.html:870:80915) set (equality-explorer_all_phet.html:870:80341) value (equality-explorer_all_phet.html:870:81367) showAnswer (equality-explorer_all_phet.html:870:1479422) listener (equality-explorer_all_phet.html:870:1592560) emit (equality-explorer_all_phet.html:870:42657) (anonymous function) (equality-explorer_all_phet.html:870:85071) execute (equality-explorer_all_phet.html:870:70479) emit (equality-explorer_all_phet.html:870:85308) fire (equality-explorer_all_phet.html:870:912826)

``` Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: ‪Equality Explorer‬ URL: https://phet-dev.colorado.edu/html/equality-explorer/1.1.0-dev.4/phet/equality-explorer_all_phet.html?showAnswers Version: 1.1.0-dev.4 2021-11-03 18:34:34 UTC 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.1 Safari/605.1.15 Language: en-US Window: 1303x698 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: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {} ```
pixelzoom commented 2 years ago

Reproduced in unbuilt master. The unobfuscated stack trace is:

EqualityExplorerRewardNode.js:60 Uncaught TypeError: createNodesFunction[(level - 1)] is not a function
    at new EqualityExplorerRewardNode (EqualityExplorerRewardNode.js:60)
    at Object.showCallback (SolveItSceneNode.js:297)
    at Dialog.js:292
    at TinyProperty.emit (TinyEmitter.js:86)
    at BooleanProperty._notifyListeners (Property.js:279)
    at BooleanProperty.set (Property.js:191)
    at BooleanProperty.set value [as value] (Property.js:353)
    at RewardDialog.show (Popupable.js:118)
    at SolveItSceneNode.js:310
    at TinyProperty.emit (TinyEmitter.js:86)

The number of levels in the game increased from 4 to 5, but an additional reward was not added for the Reward dialog. So when we request the reward for Level 5, it doesn't exit. So we'll need to add a reward level. And we'll need to revisit all of the rewards, because the rewards were specific to level, and (according to https://github.com/phetsims/equality-explorer/issues/164) we replaced the former Level 1 with new Level 1 & Level 2.

pixelzoom commented 2 years ago

@amanda-phet I need your input on what the rewards should be for the new Level 1 and Level 2. If you need to decide by playing with the sim, use master.
Running with ?showAnswers&rewardScore=1 will make it easier to get to rewards.

The challenges for each level are described in Equality Explorer - game challenge generation.

Level 1: What do you want for rewards here? I recommend: variable terms with POSITIVE integer coefficients, constant terms with integer values, red spheres, and blue squares.

Level 2 is currently: variable terms with integer coefficients, constant terms with integer values, apples, and oranges. I recommend: variable terms with NEGATIVE integer coefficients, constant terms with integer values, apples, and oranges.

Levels 3, 4, 5 were previously Levels 2,3,4 respectively, so no changes should be needed. They are:

pixelzoom commented 2 years ago

I went ahead and made the changes that I recommended to Level 1 & 2 rewards. @amanda-phet please review in master. Let me know if you want to change anything. And again, running with ?showAnswers&rewardScore=1 will make it easier to get to rewards.

amanda-phet commented 2 years ago

I like the suggested changes. The only issue I see right now is Level 2. I sometimes see 0x and 1x, so something is off about how you are defining negative coefficients.

image

pixelzoom commented 2 years ago

Good catch @amanda-phet. For Level 2, I had the coefficient range set to [-9,1] instead of [-9,-1]. Fixed in the above commit.

pixelzoom commented 2 years ago

@Nancy-Salpepi back to you to verify in master. Note that running with ?showAnswers&rewardScore=1 will make it faster to get to rewards.

To verify:

  1. Play Level 5 and verify that the sim doesn't crash when you get the reward.
  2. Verify that the reward for Level 1 consists of: variable terms with POSITIVE integer coefficients, constant terms with integer values, red spheres, and blue squares.
  3. Verify that the reward for Level 2 consists of: variable terms with NEGATIVE integer coefficients, constant terms with integer values, apples, and oranges.

Close if everything looks OK.

Nancy-Salpepi commented 2 years ago

Looks good on master.