def get_sequential_open_distrib(course_id):
 db_query = models.StudentModule.objects.filter(course_id__exact=course_id, module_type__exact='sequential').values('module_state_key').annotate(count_sequential=Count('module_state_key'))
 sequential_open_distrib = {}
 for row in db_query:
  row_loc = course_id.make_usage_key_from_deprecated_string(row['module_state_key'])
  sequential_open_distrib[row_loc] = row['count_sequential']
 return sequential_open_distrib

def get_sequential_open_distrib ( course_id ) : db_query = models . StudentModule . objects . filter ( course_id__exact = course_id , module_type__exact = 'sequential' ) . values ( 'module_state_key' ) . annotate ( count_sequential = Count ( 'module_state_key' ) ) sequential_open_distrib = { } for row in db_query : row_loc = course_id . make_usage_key_from_deprecated_string ( row [ 'module_state_key' ] ) sequential_open_distrib [ row_loc ] = row [ 'count_sequential' ] return sequential_open_distrib
returns the number of students that opened each subsection/sequential of the course course_id the course id for the course interested in outputs a dict mapping the module_id to the number of students that have opened that subsection/sequential .