The question is a tag question: 'All rules have been learned, haven't they?'
A tag question is a statement followed by a mini-question at the end. We use tag questions to confirm information or ask for agreement.
Since the statement is positive ('All rules have been learned'), we expect a negative tag ('haven't they?'). So, the positive answers would be best here.