- simulate a game using stockfish
- for each move (except few moves at the beginning) compare the move made by player with the list suggested by engine - if the move chosen by player is on the list generated by engine, than give that player some points (depending on the position of the move on the list)
- do some math considering player's ELO and some other stuff (I can't remember exactly).
Definitely not an ideal solution, but also open for improvements. Btw it wasn't my idea - chess players provided the exact algorithm, so it must have been known.