It's based on how quickly you solve it - you get a percentage score afterwards. I think it also depends on the difference between the problem rating and your rating.
If you get no moves right, it's always 0%, usually a 14-16 point loss.
If you get every move right very quickly, you get 100%, usually a 14-16 point gain.
If you get every move right but very slowly, you get 20% (losing a few points).
And then everything inbetween.

How does it work? Sometimes I get puzzles right and get anything between 6-14 points in rating, but it seems that whenever I get one wrong it usually takes between 13-16 off me. Just curious as to why its so harsh?