The opponent must discard a card, because they did not attack with a creature this turn.
As a spell resolves, its controller follows all of the instructions laid out in its spell abilities, and
Chart a Course's spell abilities tell its controller to discard a card if they haven't attacked with a creature this turn. Player B hasn't, so they must discard.