repeat_elements function used now mainly by questions/quiz stuff (thought it can be more generally usable).
It's current interface for number of blanks handling based on using a button which reloads a form adding some number of blanks. Isn't very useful actually, especially if there are questions with 3 blanks and 30 (the last was actually seen on production site). Having 5 blanks and a button to add 3 of them it's quite unconvenient to get more than 12 blanks.
An alternative way is to get text field, in which user can enter a required number of blanks and get it in one page reload (furthemore, it can be saved in user preferences to use later). The hard thing is reducing the number of blanks - we can delete only empty blanks. This'll require some more work from the caller, as it's quite hard (if possible) to tell if an arbitrary blank is empty.
MDL-17064 holds a patch and discussion. If there will be agreement on the patch before February, I can upgrade all pages in the core that use this function too. I'll be quite busy later on.