This code snippet works to remove an existing class, before adding a new one, when I specify it directly (ie, \'ratingBlock\', \'ratingBlock1\', \'ratingBlock2\', etc.). But
$.removeClass() doesn't take a selector as a parameter, only a class name (or class names).
$.removeClass()
See: Removing multiple classes (jQuery)
So you basiacally need to call:
$.removeClass('ratingBlock1 ratingBlock2 ratingBlock3 ratingBlock4 ratingBlock5');