code-dot-org/blockly — pull request #787 by Bjvanminnen (2014-08-04 19:02:25+00:00)
Title: [Finishes #66362504] Infinity ideal should allow for any number of blocks

I logged this bug a while ago, but didn't fix it at the time because it seemed a little risky. I just ran into this again while doing something else, and would like to fix it. Given that we have more test coverage, and I have more knowledge about our code base in general, I'm less worried about the fix.

The bug is that if we don't specify an ideal number of blocks in the level, IDEAL_BLOCK_NUM is set to Infinity. Given that we have yet to have a student submit a solution with an infinite number of blocks, this means that any time BlocklyApps.levelComplete resolves to false, we end up claiming TOO_FEW_BLOCKS_FAIL instead of LEVEL_INCOMPLETE_FAIL. This does result in slightly different messaging. I don't know that I think one message is any better/worse than the other, but I would prefer to be returning an accurate test result.

TOO_FEW_BLOCKS
![image](https://cloud.githubusercontent.com/assets/1767466/3801883/22a1cd22-1c09-11e4-8f76-8480f8e56ea6.png)

LEVEL_INCOMPLETE
![image](https://cloud.githubusercontent.com/assets/1767466/3801902/4e24de26-1c09-11e4-95d0-c5507e1823c2.png)