flgRightAnswer - <div class=rightanswer> - was somehow getting in the way, but I am not sure if it's okay to simply remove this flag. From my preliminary testing the functionality does not seem to be hindered.
Also edited the javascript a bit to prevent from errors.