def _add_timed_exam_info(user, course, section, section_context):
 section_is_time_limited = (getattr(section, 'is_time_limited', False) and settings.FEATURES.get('ENABLE_SPECIAL_EXAMS', False))
 if section_is_time_limited:
  from edx_proctoring.api import get_attempt_status_summary
  timed_exam_attempt_context = None
  try:
   timed_exam_attempt_context = get_attempt_status_summary(user.id, unicode(course.id), unicode(section.location))
  except Exception as ex:
   log.exception(ex)
  if timed_exam_attempt_context:
   section_context.update({'proctoring': timed_exam_attempt_context})

def _add_timed_exam_info ( user , course , section , section_context ) : section_is_time_limited = ( getattr ( section , 'is_time_limited' , False ) and settings . FEATURES . get ( 'ENABLE_SPECIAL_EXAMS' , False ) ) if section_is_time_limited : from edx_proctoring . api import get_attempt_status_summary timed_exam_attempt_context = None try : timed_exam_attempt_context = get_attempt_status_summary ( user . id , unicode ( course . id ) , unicode ( section . location ) ) except Exception as ex : log . exception ( ex ) if timed_exam_attempt_context : section_context . update ( { 'proctoring' : timed_exam_attempt_context } )
add in rendering context if exam is a timed exam .