'Sets the module user state, including grades and comments, and also scoring in db\'s courseware_studentmodule
Arguments:
user (django.contrib.auth.models.User):  Actual user whose module state is to be set
score (float):  user\'s numeric score to set.  Must be in the range [0.0, 1.0]
max_score (float):  max score that could have been achieved on this module
comment (unicode):  comments provided by the grader as feedback to the student
Returns:
nothing'

def set_user_module_score(self, user, score, max_score, comment=u''):

    if ((score is not None) and (max_score is not None)):
        scaled_score = (score * max_score)
    else:
        scaled_score = None
    self.system.rebind_noauth_module_to_user(self, user)
    self.system.publish(self, 'grade', {'value': scaled_score, 'max_value': max_score, 'user_id': user.id})
    self.module_score = scaled_score
    self.score_comment = comment
