Skip to content

Add "Learn From Mistakes" feature to Analysis Page #147

@kevinjosethomas

Description

@kevinjosethomas

We just added the Deep Analysis (Analyze Entire Game) feature to the Analysis Page, which allows players to hit the "Analyze Entire Game" button, specify a certain Stockfish depth, and then leave the tab open as it goes position to position and analyzes every move on the client-side with both the Maia and Stockfish engines.

To improve on this feature, I want to add another feature where players can hit a button in the same section below the GameBoard called “Learn from Mistakes”. Just like Deep analysis, it will analyze every position in the game with both Stockfish and Maia engines on the client-side, to a pre-configured depth of 15 (make this a constant in the constants/ directory so I can easily change it). After completing this analysis, it should know every inaccuracy/blunder the player made.

Now, it will go to every position where the move I made was classified as an inaccuracy or a blunder. It will say something like "8... Nb4?? (or ?! for inaccuracies) was played. Find a better move for white/black (whichever side I played as the player)". Now, as the player learning from the mistakes, I must play the best move in that position. I have infinite attempts. There are three flows:

  • At any time, I can hit "Show me the solution" which will then make that move on the game board (which will also correspondingly create a variation in the game tree that shows up in the move list).
  • If I get it wrong, it should undo the move on the game board and say something like "You can do better. Try another move for white/black (whichever side I played as the player".
  • If I get it right, it'll tell me this was the correct move, and not undo the move (which will also correspondingly create a variation in the game tree that shows up in the move list).

During this time, all the analysis components on the right side of the screen should also be hidden automatically. Once I get the right move or choose "Show me the solution", all the analysis components should automatically be unhidden so I can analyze the position

At any point, I can also hit "Next" to go to the next inaccuracy/blunder I made. If I do so, it should automatically hide all the analysis components once again. At any point, I should also be able to stop this "Learn from your mistakes" session which will remove these prompts. I don't want all of this to be in a modal or anything— it should be in the analysis page itself.

Most of the methods you require, especially all the analysis logic is already implemented. Even the deep analysis logic is already implemented. You just need to create the "Learn from your mistakes" flow. Do not repeat code that already exists; we want to have ground truth methods and not have a bunch of different implementations of the same methods and functionality.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions