Khan/khan-exercises — pull request #79405 by richard-to (2013-09-23 02:16:52+00:00)
Title: Allow empty for ordering exercises

Here is bug fix one of the checklist items in this Trello card: listed in the following Trello Card: https://trello.com/c/KBqG0gEw/579-exercises-shouldn-t-accept-blank-answers

The card mentioned `ordering_negative_numbers`. But I found that this issue also applied to `ordering_fractions`, `ordering_improper_fractions_and_mixed_numbers`, and `ordering_numbers`.

A few notes:

- End up adding a flag to check if the tile has been dragged and moved. If a tile has not been moved then the exercise is counted as "empty".
- In terms of being "moved", it's counted as moved even if the user drags the tile back to its initial spot.
- It will not count as a being "moved" if they the tile is just clicked.
- I ended up repeating the conditional code in the validator div for each exercise. Not the best solution, but I wasn't sure where to extract that code. I considered putting it inside the sorter object, but that didn't make too much sense.

My test cases for each exercise:

- Click "Check Answer". Should be counted as "empty" (passed)
- Click tile and drag tile. Should be counted as incorrect (passed)
- Drag tiles to correct order. Should be counted as correct (passed)
- Continue to next problem and click "Check Answer". Should be counted as "empty" (passed)
- Click tile and drag tile. Should be counted as incorrect (passed)
- Drag tiles to correct order. Should be counted as correct (passed)