>>39717970You get rated based on your ability to complete certain goals during a battle. So, for a basic trainer battle it would be:
D - Beat the trainer.
C - Beat the trainer without using an item.
B - Beat the trainer without having any of your Pokemon faint.
A - Beat the trainer without receiving any damage OR beat the trainer with an overall level handicap where the average level of your Pokemon must be 3 levels or more lower than the opponent.
S - Fulfill all of the requirements for the previous ranks PLUS beat the opponent in under 10 turns.
SS - Same as S rank but with 3 or less Pokemon in your party.
SSS - Same as S rank but with only 1 Pokemon in your Party.
You would get a special item early on that keeps track of the number of victories you have for each rank and you can rematch every opponent later to try and get better ranks.