def get_problems_in_section(section):
 problem_descriptors = defaultdict()
 if (not isinstance(section, UsageKey)):
  section_key = UsageKey.from_string(section)
 else:
  section_key = section
 section_descriptor = modulestore().get_item(section_key, depth=3)
 for subsection in section_descriptor.get_children():
  for vertical in subsection.get_children():
   for component in vertical.get_children():
    if ((component.location.category == 'problem') and getattr(component, 'has_score', False)):
     problem_descriptors[unicode(component.location)] = component
 return problem_descriptors

def get_problems_in_section ( section ) : problem_descriptors = defaultdict ( ) if ( not isinstance ( section , UsageKey ) ) : section_key = UsageKey . from_string ( section ) else : section_key = section section_descriptor = modulestore ( ) . get_item ( section_key , depth = 3 ) for subsection in section_descriptor . get_children ( ) : for vertical in subsection . get_children ( ) : for component in vertical . get_children ( ) : if ( ( component . location . category == 'problem' ) and getattr ( component , 'has_score' , False ) ) : problem_descriptors [ unicode ( component . location ) ] = component return problem_descriptors
this returns a dict having problems in a section .