'Create or update the grader of the given type (string key) for the given course. Returns the modified
grader which is a full model on the client but not on the server (just a dict)'

@staticmethod
def update_grader_from_json(course_key, grader, user):

    descriptor = modulestore().get_course(course_key)
    index = int(grader.get('id', len(descriptor.raw_grader)))
    grader = CourseGradingModel.parse_grader(grader)
    if (index < len(descriptor.raw_grader)):
        descriptor.raw_grader[index] = grader
    else:
        descriptor.raw_grader.append(grader)
    modulestore().update_item(descriptor, user.id)
    _grading_event_and_signal(course_key, user.id)
    return CourseGradingModel.jsonize_grader(index, descriptor.raw_grader[index])
