This happens to me too. I've tried using both Safari and Chrome. The first time I get the code right for a level it gives me the victory dialog, but all the gems and xp (and any goodies I've earned) are greyed out and aren't added to my total
I am moved on to the next level, but the level I've just completed says "started" not "completed". My gem tally also doesn't change.
Thanks for the tip about logging out and back in again. If I log in again and then redo the level then my code will be accepted and I'll get my goodies (even though it was the same code I'd previously entered).
Does any one have any ideas why this might be happening? I'd really like to use codecombat with my classes in a couple of weeks, but there's no way they are patient enough to persist through a bug this major.