'Traverses the tree and fills in the ordered_blocks OrderedDict with the blocks in
the order that they appear in the course.'

def _traverse_tree(self, block, unordered_structure, ordered_blocks, parent=None):

    cur_block = unordered_structure[block]
    if parent:
        cur_block['parent'] = parent
    ordered_blocks[block] = cur_block
    for child_node in cur_block['children']:
        self._traverse_tree(child_node, unordered_structure, ordered_blocks, parent=block)
