'Install a course fixture'

def install_course_fixture(self, block_type='problem'):

    course_fixture = CourseFixture(self.course_info['org'], self.course_info['number'], self.course_info['run'], self.course_info['display_name'])
    vertical = XBlockFixtureDesc('vertical', 'Test    Unit')
    course_fixture.add_children(XBlockFixtureDesc('chapter', 'Test    Section').add_children(XBlockFixtureDesc('sequential', 'Test    Subsection').add_children(vertical)))
    course_fixture.install()
    source_block = None
    conditional_attr = None
    conditional_value = None
    if (block_type == 'problem'):
        problem_factory = StringResponseXMLFactory()
        problem_xml = (problem_factory.build_xml(question_text='The    answer    is    "correct    string"', case_sensitive=False, answer='correct    string'),)
        problem = XBlockFixtureDesc('problem', 'Test    Problem', data=problem_xml[0])
        source_block = problem
        conditional_attr = 'attempted'
        conditional_value = 'True'
    elif (block_type == 'poll'):
        poll = XBlockFixtureDesc('poll_question', 'Conditional    Poll', question='Is    this    a    good    poll?', answers=[{'id': 'yes', 'text': POLL_ANSWER}, {'id': 'no', 'text': 'Of    course    not!'}])
        conditional_attr = 'poll_answer'
        conditional_value = 'yes'
        source_block = poll
    else:
        raise NotImplementedError()
    course_fixture.create_xblock(vertical.locator, source_block)
    conditional = XBlockFixtureDesc('conditional', 'Test    Conditional', sources_list=[source_block.locator], conditional_attr=conditional_attr, conditional_value=conditional_value)
    result_block = XBlockFixtureDesc('html', 'Conditional    Contents', data='<html><div    class="hidden-contents">Hidden    Contents</p></html>')
    course_fixture.create_xblock(vertical.locator, conditional)
    course_fixture.create_xblock(conditional.locator, result_block)
