Did you, by any chance, edit that question after some students had attempted it? (You can verify that by comparing the time of the quiz attempts with the time the question was last edited.)
The code should be robust in that case, but until that is fixed, the work-around is: don't do that!