def answer_problem(course, request, problem, score=1, max_value=1):
 user = request.user
 grade_dict = {'value': score, 'max_value': max_value, 'user_id': user.id}
 field_data_cache = FieldDataCache.cache_for_descriptor_descendents(course.id, user, course, depth=2)
 module = get_module(user, request, problem.scope_ids.usage_id, field_data_cache)._xmodule
 module.system.publish(problem, 'grade', grade_dict)

def answer_problem ( course , request , problem , score = 1 , max_value = 1 ) : user = request . user grade_dict = { 'value' : score , 'max_value' : max_value , 'user_id' : user . id } field_data_cache = FieldDataCache . cache_for_descriptor_descendents ( course . id , user , course , depth = 2 ) module = get_module ( user , request , problem . scope_ids . usage_id , field_data_cache ) . _xmodule module . system . publish ( problem , 'grade' , grade_dict )
records a correct answer for the given problem .