def set_score(user_id, usage_key, score, max_score):
 (student_module, created) = StudentModule.objects.get_or_create(student_id=user_id, module_state_key=usage_key, course_id=usage_key.course_key, defaults={'grade': score, 'max_grade': max_score})
 if (not created):
  student_module.grade = score
  student_module.max_grade = max_score
  student_module.save()
 return student_module.modified

def set_score ( user_id , usage_key , score , max_score ) : ( student_module , created ) = StudentModule . objects . get_or_create ( student_id = user_id , module_state_key = usage_key , course_id = usage_key . course_key , defaults = { 'grade' : score , 'max_grade' : max_score } ) if ( not created ) : student_module . grade = score student_module . max_grade = max_score student_module . save ( ) return student_module . modified
set the score and max_score for the specified user and xblock usage .