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

showAnswers fails on Game Screens #32

Closed
Denz1994 opened this issue Dec 17, 2018 · 5 comments
Closed

showAnswers fails on Game Screens #32

Denz1994 opened this issue Dec 17, 2018 · 5 comments
Assignees
Labels
type:bug Something isn't working

Comments

@Denz1994
Copy link
Contributor

Found in #29. Clicking the showAnswers button on the screen causes and error.

Fractions-Intro: Game Screen

FractionChallenge.js?bust=1545060328223:471 Uncaught TypeError: Cannot read property 'forEach' of undefined
at FractionChallenge.cheat (FractionChallenge.js?bust=1545060328223:471)
at Emitter.listener (BuildingGameScreenView.js?bust=1545060328223:186)
at Emitter.emit (Emitter.js?bust=1545060328223:202)
at PushButtonModel.fire (PushButtonModel.js?bust=1545060328223:155)
at Array.downPropertyObserver (PushButtonModel.js?bust=1545060328223:88)
at Emitter.emit3 (Emitter.js?bust=1545060328223:281)
at BooleanProperty._notifyListeners (Property.js?bust=1545060328223:288)
at BooleanProperty.setValueAndNotifyListeners (Property.js?bust=1545060328223:270)
at BooleanProperty.set (Property.js?bust=1545060328223:203)
at Emitter.emit3 (Emitter.js?bust=1545060328223:281)

Fractions-Intro: Game Screen

FractionChallenge.js?bust=1545061500708:564 Uncaught TypeError: Cannot read property 'length' of undefined
at findSolution (FractionChallenge.js?bust=1545061500708:564)
at findSolution (FractionChallenge.js?bust=1545061500708:569)
at findSolution (FractionChallenge.js?bust=1545061500708:569)
at Function.findShapeSolution (FractionChallenge.js?bust=1545061500708:579)
at FractionChallenge.cheat (FractionChallenge.js?bust=1545061500708:469)
at Emitter.listener (BuildingGameScreenView.js?bust=1545061500708:186)
at Emitter.emit (Emitter.js?bust=1545061500708:202)
at PushButtonModel.fire (PushButtonModel.js?bust=1545061500708:155)
at Array.downPropertyObserver (PushButtonModel.js?bust=1545061500708:88)
at Emitter.emit3 (Emitter.js?bust=1545061500708:281)

Fractions-Equality: Game Screen
The button never appears on screen.
image

@Denz1994 Denz1994 added the type:bug Something isn't working label Dec 17, 2018
@jonathanolson
Copy link
Contributor

Looks like when I got rid of for-of loops I accidentally reused the variable i in an inner scope. It got shadowed and messed up the logic (function parameter and the let both used i).

Should be fixed now, can you verify?

And for now I don't know of plans to add the showAnswers setup for the matcher sim.

@Denz1994
Copy link
Contributor Author

This is working great in great in intro and mixed-numbers. However, there is no showAnswers button present in the game screen of fractions-equality.
image

This sim may require different behavior, because there can only be one proposed solution at a time unlike the other sims. Unless all of the solutions are made immediately present in the top level answer boxes. This sounds like a design question. Thoughts @jonathanolson?

@jonathanolson
Copy link
Contributor

That's a screen that is pulled directly from fraction-matcher. I'm fine to either create an issue to look into handling showAnswers (which won't happen before the 1.0 release for the other sims), or to leave it out (since those levels aren't as difficult).

Thoughts?

@Denz1994
Copy link
Contributor Author

I propose making an issue, referencing this one, and not handling showAnswers for this screen right now because the behavior may be different. Once we get around to updating the code base for fraction-matcher we can handle this showAnswers behavior as well.

I'll leave to you to create the issue and close this one if that sounds good.

@jonathanolson
Copy link
Contributor

Sounds good, created #34, thanks. Closing.

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

No branches or pull requests

2 participants