fix for reassignment with bad index ref + test

this also removes duplicate case blocks from reassignment submission

http://manage.dimagi.com/default.asp?82824