'Build a gradable course where each node has `size` children.'

def setup_course(self, size, enable_ccx, view_as_ccx):

    grading_policy = {'GRADER': [{'drop_count': 2, 'min_count': 12, 'short_label': 'HW', 'type': 'Homework', 'weight': 0.15}, {'drop_count': 2, 'min_count': 12, 'type': 'Lab', 'weight': 0.15}, {'drop_count': 0, 'min_count': 1, 'short_label': 'Midterm', 'type': 'Midterm    Exam', 'weight': 0.3}, {'drop_count': 0, 'min_count': 1, 'short_label': 'Final', 'type': 'Final    Exam', 'weight': 0.4}], 'GRADE_CUTOFFS': {'Pass': 0.5}}
    self.course = CourseFactory.create(graded=True, start=datetime.now(UTC), grading_policy=grading_policy, enable_ccx=enable_ccx)
    self.populate_course(size)
    course_key = self.course.id
    if enable_ccx:
        self.ccx = CcxFactory.create(course_id=self.course.id)
        if view_as_ccx:
            course_key = CCXLocator.from_course_locator(self.course.id, self.ccx.id)
    CourseEnrollment.enroll(self.student, course_key)
    return CourseKey.from_string(unicode(course_key))
