'Returns information relevant to resume course functionality.
Returns a tuple: (has_visited_course, resume_course_url)
has_visited_course: True if the user has ever visted the course, False otherwise.
resume_course_url: The URL of the last accessed block if the user has visited the course,
otherwise the URL of the course root.'

def _get_resume_course_info(self, request, course_id):

    def get_last_accessed_block(block):
        "\n                                                Gets    the    deepest    block    marked    as    'last_accessed'.\n                                                "
        if (not block['last_accessed']):
            return None
        if (not block.get('children')):
            return block
        for child in block['children']:
            last_accessed_block = get_last_accessed_block(child)
            if last_accessed_block:
                return last_accessed_block
        return block
    course_outline_root_block = get_course_outline_block_tree(request, course_id)
    last_accessed_block = (get_last_accessed_block(course_outline_root_block) if course_outline_root_block else None)
    has_visited_course = bool(last_accessed_block)
    if last_accessed_block:
        resume_course_url = last_accessed_block['lms_web_url']
    else:
        resume_course_url = (course_outline_root_block['lms_web_url'] if course_outline_root_block else None)
    return (has_visited_course, resume_course_url)
