Closed chrisklus closed 1 year ago
Reproduced in master using these steps:
?showAnswers
caught Error: Assertion failed: Score 2 exceeds perfect score 1
at window.assertions.assertFunction (assert.js:28:13)
at scorePropertyListener (ScoreDisplayStars.ts:59:17)
at TinyProperty.emit (TinyEmitter.ts:119:9)
at NumberProperty._notifyListeners (ReadOnlyProperty.ts:315:23)
at NumberProperty.unguardedSet (ReadOnlyProperty.ts:266:14)
at NumberProperty.set (ReadOnlyProperty.ts:250:12)
at set value [as value] (Property.ts:54:11)
at WaveGameLevel.checkAnswer (WaveGameLevel.js:229:31)
at checkAnswerListener (WaveGameLevelNode.js:243:13)
at TinyEmitter.emit (TinyEmitter.ts:119:9)
The failing assertion is in ScoreDisplayStars.ts:
59 assert && assert( score <= perfectScore, `Score ${score} exceeds perfect score ${perfectScore}` );
Note that ScoreDisplayStarsOptions.perfectScore
defaults to 1, which is not correct for this sim. So it's likely that this option is missing somewhere upstream, in sim-specific code.
This has been broken in master for a long time. It was broken when LevelSelectionButtonGroup (and subclass WaveGameLevelSelectionButtonGroup) was introduced for https://github.com/phetsims/vegas/issues/108. WaveGameLevelSelectionButtonGroup was incorrectly using ScoreDisplayNumber for level-selection buttons, which is only appropriate for "finite challenges" games that have a perfect score. In the above commit, I fixed WaveGameLevelSelectionButtonGroup to use ScoreDisplayNumberAndStar, which is appropriate for "infinite challenges" games.
This problem does not appear in the published version 1.0.12, or the 1.0 branch. Since it was never released into the wild, I'll close this issue.
I tried to use the Wave Game a few times to reference game behavior over in Number Play and ran into the assertion:
Assertion failed: Score 2 exceeds perfect score 1
This seems like a bug, assigning @pixelzoom to take a look at your convenience.