Does this show a random flag each time? You could use a spaced-repitition algorithm to pick which flag to show based on correct/incorrect previous answers.
The order of flags is randomized on page load, but incorrectly-answered flags are sent to the back of the question set. Those remain in the order they were answered.