def _get_proctoring_requirements(course_key):
 from edx_proctoring.api import get_all_exams_for_course
 requirements = []
 for exam in get_all_exams_for_course(unicode(course_key)):
  if (exam['is_proctored'] and exam['is_active'] and (not exam['is_practice_exam'])):
   try:
    usage_key = UsageKey.from_string(exam['content_id'])
    proctor_block = modulestore().get_item(usage_key)
   except (InvalidKeyError, ItemNotFoundError):
    LOGGER.info("Invalid content_id '%s' for proctored block '%s'", exam['content_id'], exam['exam_name'])
    proctor_block = None
   if proctor_block:
    requirements.append({'namespace': 'proctored_exam', 'name': exam['content_id'], 'display_name': exam['exam_name'], 'start_date': (proctor_block.start if proctor_block.start else None), 'criteria': {}})
 if requirements:
  log_msg = "Registering the following as 'proctored_exam' credit requirements: {log_msg}".format(log_msg=requirements)
  LOGGER.info(log_msg)
 return requirements

def _get_proctoring_requirements ( course_key ) : from edx_proctoring . api import get_all_exams_for_course requirements = [ ] for exam in get_all_exams_for_course ( unicode ( course_key ) ) : if ( exam [ 'is_proctored' ] and exam [ 'is_active' ] and ( not exam [ 'is_practice_exam' ] ) ) : try : usage_key = UsageKey . from_string ( exam [ 'content_id' ] ) proctor_block = modulestore ( ) . get_item ( usage_key ) except ( InvalidKeyError , ItemNotFoundError ) : LOGGER . info ( "Invalid content_id '%s' for proctored block '%s'" , exam [ 'content_id' ] , exam [ 'exam_name' ] ) proctor_block = None if proctor_block : requirements . append ( { 'namespace' : 'proctored_exam' , 'name' : exam [ 'content_id' ] , 'display_name' : exam [ 'exam_name' ] , 'start_date' : ( proctor_block . start if proctor_block . start else None ) , 'criteria' : { } } ) if requirements : log_msg = "Registering the following as 'proctored_exam' credit requirements: {log_msg}" . format ( log_msg = requirements ) LOGGER . info ( log_msg ) return requirements
will return list of requirements regarding any exams that have been marked as proctored exams .