To begin with, you are a prince, or a farmer's third son, or a young woman. You will come upon the test: a fairy pretending to need somebody's last bit of bread, or a challenge to do something impossible. You display your virtue, usually clever perpendicular thinking but possibly generosity, hard work, mercy, or piety, and earn the prize: a princess, kingdom, treasure, wish, or a combination of the above.
Here's the catch: you're flawed. The most important bit is when you overcome your flaw. You have to learn your lesson from it before it's too late. Did you fail the test but learn a valuable moral lesson? Then the lesson was the test, and overcoming your flaw was your virtue. Move ahead, collect your prize.
Maybe you discover your flaw later. You've passed the test and you're ready to collect your prize. Here is where your flaw rears its ugly head: pride, or greed, or ambition maybe. Despite passing the test, your prize recedes from your grasp. Only overcoming your flaw at this late stage—when it again becomes your real test—will get you what you seek.
But what if the story's over without finding your flaw? You've quested, tested, bested, and want to be rested. But without a flaw, then the story's not over... or yours is a morality tale, and it's about to make an example of you.