The amount of stars you get from each level is not static. It all depends on the best score someone have at any given time. 5 stars is allways given to those who share the least amount of steps.
Calculating the rest of the stars given are a bit more complicated.
spread = 200; sqr = 1 / 50; dif = spread * Pow((2 * steps + 10) / (2 * worldBest + 10), sqr) - spread; stars = FloorToInt(5 - dif); return Clamp(stars, 1, 5);