def get_array_section_has_problem(course_id):
 course = modulestore().get_course(course_id, depth=4)
 b_section_has_problem = ([False] * len(course.get_children()))
 i = 0
 for section in course.get_children():
  for subsection in section.get_children():
   for unit in subsection.get_children():
    for child in unit.get_children():
     if (child.location.category == 'problem'):
      b_section_has_problem[i] = True
      break
    if b_section_has_problem[i]:
     break
   if b_section_has_problem[i]:
    break
  i += 1
 return b_section_has_problem

def get_array_section_has_problem ( course_id ) : course = modulestore ( ) . get_course ( course_id , depth = 4 ) b_section_has_problem = ( [ False ] * len ( course . get_children ( ) ) ) i = 0 for section in course . get_children ( ) : for subsection in section . get_children ( ) : for unit in subsection . get_children ( ) : for child in unit . get_children ( ) : if ( child . location . category == 'problem' ) : b_section_has_problem [ i ] = True break if b_section_has_problem [ i ] : break if b_section_has_problem [ i ] : break i += 1 return b_section_has_problem
returns an array of true/false whether each section has problems .