It really depends on the berry and how well you do. The only true variables are those two things. Bulbagarden states that some Pokemon prefer burnt poffins.
This formula is from Bulbagerden. L is level, B is berry, T is time, and M is mistakes.
Here is the link that I got this info: