From 481e660617ea74d2cb8717ff105cc106a6ec4564 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Thu, 21 Jul 2016 12:23:18 +0200 Subject: [PATCH] Make 3 stars possible in ep, stalemate, piece value and protection --- ui/learn/package.json | 2 +- ui/learn/src/score.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/learn/package.json b/ui/learn/package.json index 4d8dfcb15f..07c52dfe2f 100644 --- a/ui/learn/package.json +++ b/ui/learn/package.json @@ -28,7 +28,7 @@ "watchify": "~3.7" }, "dependencies": { - "chess": "github:ornicar/chess.js#learn", + "chess.js": "github:ornicar/chess.js#learn", "chessground": "github:ornicar/chessground#v3.8.0", "mithril": "github:ornicar/mithril.js#v1.0.0" } diff --git a/ui/learn/src/score.js b/ui/learn/src/score.js index 1d521b095d..b591f75054 100644 --- a/ui/learn/src/score.js +++ b/ui/learn/src/score.js @@ -39,7 +39,7 @@ function getStageMaxScore(s) { function getStageRank(s, score) { var max = getStageMaxScore(s); if (typeof score !== 'number') score = score.reduce(function(a, b) { return a + b; }, 0); - if (score === max) return 1; + if (score >= max) return 1; if (score >= max - Math.max(200, s.levels.length * 150)) return 2; return 3; }