def _create_entrance_exam(request, course_key, entrance_exam_minimum_score_pct=None):
 if (entrance_exam_minimum_score_pct is None):
  entrance_exam_minimum_score_pct = _get_default_entrance_exam_minimum_pct()
 course = modulestore().get_course(course_key)
 if (course is None):
  return HttpResponse(status=400)
 parent_locator = unicode(course.location)
 created_block = create_xblock(parent_locator=parent_locator, user=request.user, category='chapter', display_name=_('Entrance Exam'), is_entrance_exam=True)
 course = modulestore().get_course(course_key)
 metadata = {'entrance_exam_enabled': True, 'entrance_exam_minimum_score_pct': unicode(entrance_exam_minimum_score_pct), 'entrance_exam_id': unicode(created_block.location)}
 CourseMetadata.update_from_dict(metadata, course, request.user)
 create_xblock(parent_locator=unicode(created_block.location), user=request.user, category='sequential', display_name=_('Entrance Exam - Subsection'))
 add_entrance_exam_milestone(course.id, created_block)
 return HttpResponse(status=201)

def _create_entrance_exam ( request , course_key , entrance_exam_minimum_score_pct = None ) : if ( entrance_exam_minimum_score_pct is None ) : entrance_exam_minimum_score_pct = _get_default_entrance_exam_minimum_pct ( ) course = modulestore ( ) . get_course ( course_key ) if ( course is None ) : return HttpResponse ( status = 400 ) parent_locator = unicode ( course . location ) created_block = create_xblock ( parent_locator = parent_locator , user = request . user , category = 'chapter' , display_name = _ ( 'Entrance Exam' ) , is_entrance_exam = True ) course = modulestore ( ) . get_course ( course_key ) metadata = { 'entrance_exam_enabled' : True , 'entrance_exam_minimum_score_pct' : unicode ( entrance_exam_minimum_score_pct ) , 'entrance_exam_id' : unicode ( created_block . location ) } CourseMetadata . update_from_dict ( metadata , course , request . user ) create_xblock ( parent_locator = unicode ( created_block . location ) , user = request . user , category = 'sequential' , display_name = _ ( 'Entrance Exam - Subsection' ) ) add_entrance_exam_milestone ( course . id , created_block ) return HttpResponse ( status = 201 )
internal workflow operation to create an entrance exam .