def section_problem_grade_distrib(request, course_id, section):
 data = {}
 course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id)
 if has_instructor_access_for_class(request.user, course_key):
  try:
   data = dashboard_data.get_d3_section_grade_distrib(course_key, section)
  except Exception as ex:
   log.error('Generating metrics failed with exception: %s', ex)
   data = {'error': 'error'}
 else:
  data = {'error': "Access Denied: User does not have access to this course's data"}
 return HttpResponse(json.dumps(data), content_type='application/json')

def section_problem_grade_distrib ( request , course_id , section ) : data = { } course_key = SlashSeparatedCourseKey . from_deprecated_string ( course_id ) if has_instructor_access_for_class ( request . user , course_key ) : try : data = dashboard_data . get_d3_section_grade_distrib ( course_key , section ) except Exception as ex : log . error ( 'Generating metrics failed with exception: %s' , ex ) data = { 'error' : 'error' } else : data = { 'error' : "Access Denied: User does not have access to this course's data" } return HttpResponse ( json . dumps ( data ) , content_type = 'application/json' )
creates a json with the grade distribution for the problems in the specified section .