Ranking unique rows in a table - MySQL
While keeping your approach to the solution, the query will be

SELECT s.id, 
       s.class,
       s.name, 
       s.score, 
       FIND_IN_SET( s.score, ( SELECT GROUP_CONCAT( DISTINCT ss.score
                                                    ORDER BY ss.score DESC ) 
                               FROM scores ss
                               WHERE s.class = ss.class ) ) AS `rank`
FROM scores s
-- WHERE class = 'Grade 1'
ORDER BY class, `rank`